I have a question. How can I access named custom instance attributes generated with Geometry Nodes in Python?
What I did:
- I set up named custom instance attribute with Geometry Nodes, named "Color"
- I confirmed that it's set expectedly in the Spread sheet
- I tried to access the "Color" instance attribute in python but I couldn't find the attribute
I iterated through evaluated instance objects, but I couldn't find.
depsgraph = bpy.context.evaluated_depsgraph_get()
for object_instance in depsgraph.object_instances:
if object_instance.is_instance:
for attr in dir(object_instance):
print(str(attr), getattr(object_instance, attr))
for attr in dir(object_instance.instance_object):
print(str(attr), getattr(object_instance.instance_object, attr))
for attr in dir(object_instance.object):
print(str(attr), getattr(object_instance.object, attr))
for attr in dir(object_instance.object.data):
print(str(attr), getattr(object_instance.object.data, attr))
I thought it could be in object_instance.object.data.attributes, but it isn't in.
print(object_instance.object.data.attributes.keys())
["material_index", "uv_map"]
I'm happy if someone tells me how to access them.
Blender version: 3.3.1 OS: Windows 10
