2

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?

alagris
  • 197
  • 4

1 Answers1

4
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.

Markus von Broady
  • 36,563
  • 3
  • 30
  • 99