← All ideas
  • Published 28 Nov 2022

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

FiT4oqYUYAA9SUs.jpg

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.

100%

Development Status: Open

Upvote 15 Downvote 0
takahiro
28 Nov 2022

3 Comments

Jonathan-Plasse

If you created instances from points, you can store the attribute Color on both the points and the instances, and use a Join Geometry .

Like this, the Color attribute is accessible from the evaluated object obj_eval.data.attributes["Color"] .

MasterJames

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.

lily1

Do you now if it is possible to get name of the instance via script?