← All ideas
  • Published 20 Feb 2024

Access material slots with Geometry Nodes

Right now there is no way for Geometry nodes to access the materials that are assigned to an object (in the materials tab).

Example: add a curve object and give it a red material. Go into the curve tab and increase the Bevel depth to "solidify" the curve. That red material is assigned to the resulting geometry.

There is no way to do this in Geo Nodes. When you "solidify" a curve with Curve to Mesh, you can't say "hey, use the material from your material slot #2". You can only assign a specific, named material. There is no "get material index" node.

100%

Development Status: Open

Upvote 9 Downvote 0
tolkfan
20 Feb 2024

4 Comments

effire

As far as I know, this only works with objects of the Mash type. You cannot transfer material from the original curve to the procedural mesh.

mwoehlke

At best , this is terribly ineficient. The only way to preserve materials without this feature is to use Join Geometry to combine the original geometry and the new geometry. If you don't want the old geometry, this is very annoying to set up. If the old geometry is a different type (as in the example here of converting a curve to a mesh), it's impossible. This is because anything that creates new geometry creates it with no materials assigned. The only way to assign materials to new geometry is to join it with geometry that already has materials (problematic as explained), or use the Set Material node. But there is no way to get the material that should be fed to Set Material except to "hardcode" it, or take it as an input to the geometry nodes.

There is, in fact, no way to get a Material from a Geometry, which is a gaping oversight IMO. We really should have a Material Info node that takes a Geometry and a Material Index and spits out a Material.