Hi.
I found what may or may not be a bug in the way Python accesses instances in a Geometry Nodes setup. I am not sure where I should ask whether this is a bug or not. If someone could point me to a forum where I could ask about this behavior and determine whether this is a bug or not, that would be helpful. Thanks!
(In case anyone cares, here is a short summary of the issue. I know that this isn’t the appropriate place to post this, but I am just including it here in case it helps determine where I would make the actual post. I would include more details in the actual post of course.)
Specifically, if I use list comprehension to get a list of instances it returns:
The specific line of code is:
instances = [inst for inst in depsgraph.object_instances if inst.is_instance and inst.parent is eval_obj]
and the output is:
<bpy_struct, DepsgraphObjectInstance invalid>
But if I convert that to a generator, I get the correct results.
Here is that code snippet:
instances = (inst for inst in depsgraph.object_instances if inst.is_instance and inst.parent is eval_obj)
And its output:
<bpy_struct, DepsgraphObjectInstance at 0x294813240>
Most of the examples I see on stack exchange seem to use the list comprehension method so I was wondering whether that is a regression, new design, or that I am completely misunderstanding the examples.