Allow to access named custom instance attributes generated with Geometry Node in Python
Problem
Currently named custom instance attributes generated with Geometry Nodes (see the screenshot) is not accessible in Python
I iterated through evaluated instance objects but couldn't find the custom attributes anywhere.
Instance domain attributes doesn't seem to be accessible.
Feature request
Allow to access named custom instance attributes generated with Geometry Node in Python
Use case
I'm working on Blender glTF EXT_mesh_gpu_instancing extension addon that allows to export GPU instancing asset.
github.com/takahirox/glTF-Blender-IO-EXT-mesh-gpu-instancing
I want it to export custom instance attributes, for example instance color. But due to the problem, currently it can't.
If the instance attributes are accessible, the addon will be able to easily export custom instance attributes.
3 Comments
If you created instances from points, you can store the attribute
Coloron both the points and the instances, and use aJoin Geometry.Like this, the
Colorattribute is accessible from the evaluated objectobj_eval.data.attributes["Color"].Another example is getting a shader with image sequence it's 'offset' via a driver script, since it lacks an input the "Attribute" node which has the Instance data can not be connected as explained where the data is via script is nearly impossibly to determine after days of probing.
Do you now if it is possible to get name of the instance via script?