I'm loading MD simulation data into Blender and want to set the color of instances to indicate an attribute value that has been calculated separately beforehand.
The current workflow looks like this:
- I'm creating a geometry object with vertices at every particle position and using a Geometry Nodes modifier to spawn mesh instances at these points.
- A bmesh layer is used to store the specific attribute value that I want to base the color upon at each vertex (shown here and here)
- Every frame the vertex positions and bmesh data are updated to mirror the particle movements and attribute value, respectively.
I'm aware of a method to color these instances (answer to this question), but struggling to apply it here, since the custom attribute I defined vor each vertex can't be referenced anymore when the instances are realized and the number of vertices changes. Is there a solution in Geometry Nodes to reference the value of the original vertex? That is, can the Group Input attribute "vert_layer" as shown in the image below, be used as input for ColorRamp somehow?
I guess one could update the dependencies graph and apply Step 2 for the resulting mesh, but it seems too resource intensive to iterate over the whole list of vertices each frame. Just as it seems wasteful to realize all the geometry of the node instances to modify color. This will probably restrict me to small data sets. Any suggestions on how to do this (in a less convoluted way) are appreciated!