3
$\begingroup$

When using geometry nodes I can see my object has instances

enter image description here

How can I access position, rotation etc of all of them through python?

$\endgroup$

1 Answer 1

7
$\begingroup$
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.

$\endgroup$

You must log in to answer this question.

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