1
$\begingroup$

I have a node layout that I plan on using for a keyboard animation, where all the keys fly away from the board based on distance to a object. Currently, I'm getting the central position of each mesh island, capturing it in a attribute then splitting the mesh into instances based on their island info. I now need to use this central position, and in this screenshot I'm just offsetting each instance by it so I know it works. However, even though it seems right to me it just doesn't want to work. What's wrong? I'm fairly new to geonodes so it's tricky for me to understand.enter image description here

$\endgroup$
0

1 Answer 1

0
$\begingroup$

(Using Blender 4.2.0)

The issue is that there is no Instance in the input geometry to capture the attribute. It has to be captured in the Point domain, then transferred to the Instance domain, as proposed thereafter.

GN Graph

Dark red nodes: Capture of the center
1. The original Capture Attribute node is replaced by a Store Named Attribute node set in Point domain.

Dark blue nodes: Construction of a lookup table collecting the center per mesh island
2. The mesh is duplicated as a Point Cloud with a Mesh to Points node, set such that vertex coordinates are replaced by the Island Index to which these vertices belong. Consequently, vertices of the same mesh island are moved to the same position. It is to notice that the named attribute "center" is transferred by this node.
3. The point cloud is collapsed into a single point per mesh island using a Merge by Distance node. The result is a point cloud such that the point of index $i$ is carrying the center of mesh island $i$ as a named attribute.

Dark pink nodes: Transfer from points to instances
4. To query the lookup table, the Index of the instance provided by the Translate Instances node is input in a Sample Index node.


Resources:


(Blender 4.2.0+)

$\endgroup$

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.