Quick Tip: Attribute Transfers Using Blender Geometry Nodes (Patreon)
Content
When working on 3D scenes it's common to need to transfer attributes from one object to another. For example, you might have a “skin” mesh with an attribute that you want to copy to attached hair curves. Houdini users will be familiar with its Attribute Transfer node, but can we do the same using Blender’s Geometry Nodes? Yes! Let’s quickly learn how:
Setup
Here I have a brow mesh that some eyebrow hairs are attached to. I painted a vertex attribute called testAttr.
This is showing up as expected in the Geometry Nodes spreadsheet.
If we want to drive a parameter on the hair curves using this attribute, we’ll need to transfer it from the mesh to the curves. I made the curves visible again and added an empty Geometry Nodes modifier.
Click New in the Geometry Node Editor to create a node network.
Connect these nodes as follows:
Group Input (curves) – Store Named Attribute – Group OutputObject Info (mesh) – Sample Nearest/Sample Index – Store Named AttributeNamed Attribute – Sample Index
Make sure the Object Info node is pointing to the mesh and all the other relevant parameters are set to our testAttr attribute. Note that the mesh attribute is stored on points and we want to move it to splines, so set those parameters accordingly.
Have a look at the spreadsheet and testAttr is now on the curves!
However, the values don’t seem to be grouped in an understandable way. Some splines are all 0 (black) and some are all 1 (white), which is probably right, but how do we confirm that the splines have the correct values relative to the underlying mesh?
Attach a Viewer node, connect the curves to the Geometry input and the Named Attribute (testAttr) to the Value input, then click the Viewer toggle icon.
Perfect! The curves are white where the mesh is white and black where it’s black. Attribute transfer successful!
Conclusion
The addition of Geometry Nodes to Blender was a huge step forward. It lets us perform low level tasks on geometry in a very similar way to Houdini. They’re always adding new nodes and functionality, so it will be exciting to see it gradually get closer to parity with some of Houdini’s features.