0
$\begingroup$

How can i add the object to a view layer? I mean not just with code, but even manually how can i do that?

i trying to execute a script and first time it works fine, but second time it gives an error message: Python: Traceback (most recent call last): ******, line 32, in RuntimeError: Error: Object ‘Base_01_Low.001’ can’t be selected because it is not in View Layer ‘ViewLayer’!

here is a screenshot the explains the problem more detailed: https://drive.google.com/file/d/1nqvG02BWha7jubSIPqpV_JD5Ke_TNN8-/view?usp=sharing

and here is the blend file that shows the problem (script included in the text editor): https://drive.google.com/file/d/1eo54H4Jmb4MA8yGPZKIqonkiy2uwD4gT/view?usp=sharing

This error is not happening in every blend file i have, until now only in this one. I also tried removing the ‘state control’ part of hiding showing items, but still getting the same result.

So mainly question is, how can i avoid to get items are not in View Layer? If i can't avoid it, how can i force every item in the scene to be in the View Layer? Even manually solution is fine by me :)

$\endgroup$
1
  • $\begingroup$ Hello, could you share a snippet of your script ? $\endgroup$
    – Gorgious
    Jun 16, 2023 at 13:47

1 Answer 1

0
$\begingroup$

After a little investigation I found the rascal object in the Blender File display mode, and since my script is "generating" those rascal objects via join (somehow join make some letovers from the joined pieces off the view layer dunno why), I simply add a suffix to the duplicated items before join, and at end of the script delete those items, so next time I run the script, there will be no "off the tray" items.

So solution is partially, but if you don't need those files, then you can simply delete them so they will not obstruct the script to select other items.

A real solution would welcomed, at least an answer how to put those rascals back to view layer without manual selecting and adding them to a new collection.

$\endgroup$
5
  • $\begingroup$ Again, it's impossible to help you without seeing your script :) $\endgroup$
    – Gorgious
    Jun 16, 2023 at 16:26
  • $\begingroup$ Hey, i provided the blender file, since script is very "outliner dependent" (no much point without seeing the outliner meanwhile the script) And comment field is saying too much character Can You open the blend file. It shows the text editor on the right side, and left to the text editor, there is the outliner. Let me know plase if there is a way to show my script easier. Thank You! $\endgroup$ Jun 17, 2023 at 14:37
  • $\begingroup$ Nope, sorry I'm not downloading and opening random blender files with unknown custom scripts when the information can be copy / pasted in a matter of seconds for all to see :) $\endgroup$
    – Gorgious
    Jun 17, 2023 at 19:04
  • $\begingroup$ oops, sorry, You right :) If my script is not fitting in this comment section, then how (or where) can i copy paste it? Thank for the help already :) $\endgroup$ Jun 18, 2023 at 20:37
  • $\begingroup$ blender.meta.stackexchange.com/questions/2958/… $\endgroup$ Jun 18, 2023 at 21:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .