1
$\begingroup$

I have a curves object made up of multiple disconnected curves. I have two material slots and assigned one of the two materials to each of these curves.

I generate a mesh from the curves via geometry nodes. It's hair. I want to give different color to some strands.

The generated mesh doesn't have any material. It comes out as white. How could I fix that? How could I use the material assigned to each curve for the material of the generated mesh?

The geometry nodes:

geometry nodes for hair

$\endgroup$
2
  • $\begingroup$ I feel like the solution is something like "Capture attribute" for the curve but capture the material somehow, then "Set Material" that on the generated mesh? $\endgroup$ Aug 28, 2022 at 16:48
  • 1
    $\begingroup$ Short answer: You cannot read the material currently assigned to a curve in Geometry Nodes. The only way is to explicitly specify a material that you can apply to the mesh. $\endgroup$
    – quellenform
    Oct 2, 2022 at 15:27

1 Answer 1

1
$\begingroup$

If you generate each curve in its own object, you can just use Set Material or Set Material Index on the Curve to Mesh result directly.

If you are generating multiple meshes based on 1 curve in the same geometry node, I've gotten the following to work with Blender 3.4.1

TL;DR: assign a dummy Capture Attribute boolean node ticked to true and use it as the selection input to Set Material on the Curve to Mesh result

Nodes:

Nodes

Result:

Result

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .