When using geometry nodes I can see my object has instances
How can I access position
, rotation
etc of all of them through python?
from bpy import context as C
dg = C.evaluated_depsgraph_get()
ev = C.object.evaluated_get(dg)
instances = (i for i in dg.object_instances if i.instance_object == ev)
for i in instances:
location, rotation_quat, scale = i.matrix_world.decompose()
rotation_euler = rotation_quat.to_euler()
print(f"{location=}\n{rotation_quat=}\n{rotation_euler=}\n{scale=}\n\n")
This should list those properties of instances of the active object.