2
$\begingroup$

I made a succulent generator and I want to be able to change the colors (and some other values that a material has) through the small menu of the geometry nodes modifier. I already have some inputs there, as you can see, but those are just properties of the geometry node object, not its material.

Menu of geometry nodes modifier

The problem is, I don't know, how to "unpack" the group input in the material in the geometry nodes setup so that I could connect it to the "group input" node there. The material has a "data type" of material and I can't find a way to set its values. I've tried connecting it to the "group input" node in the geometry nodes editor, but that only allows me to assign a different, already existing material, not to change the values of the material. Here is the node setup in the geometry nodes.

Geometry nodes

And this is my material. You can see i added the "group input" node here, too, but I can't find a way of setting those values.

Material nodes

How could I "add" the input variables to the geometry nodes modifier menu?

EDIT: I've tried Crantisz's solution. However, it works only on an object that has only one instance, not on my geometry nodes object, that is composed of many instances of the object. Is there any way to make it work? Here is a picture of how the node setup works on many instances (it unfortunately doesn't change the color), and another one showing the node setup:

Many instances result Many instances nodes

And here it is when I apply it only on one instance of an object:

One instance result One instance nodes

$\endgroup$
0

2 Answers 2

2
$\begingroup$

Set up what you want looks like this:

enter image description here

  1. Connect (somehow) color input to color output.

if you scatter instances, they should be realized:

enter image description here

  1. Set color output to attribute (write custom name in the field)

  2. Use this attribute in the attribute node.

The group Input that you use in material is useless. Until you not group some nodes into a node group.

$\endgroup$
4
  • $\begingroup$ Thank you. Unfortunately it only works when I have one instance of an object. I've updated my question and added the pictures of how it works on one object (that's working correctly) and how it doesn't work when I have more instances of the same object. Do you have an idea how to fix that? $\endgroup$
    – Barevnej
    Apr 26, 2022 at 19:16
  • $\begingroup$ I've pointed this in my answer: if you scatter instances, they should be realized $\endgroup$
    – Crantisz
    Apr 26, 2022 at 19:18
  • $\begingroup$ Well that kinda works but it applies the material to whole object (all of the instances together) and not to to each one of them individually. Is there any way to do it separately? $\endgroup$
    – Barevnej
    Apr 26, 2022 at 20:44
  • $\begingroup$ Yes, of course. But I don't know what you want to do. You can use vertex color and weight as input, so values will be different in each type of the mesh $\endgroup$
    – Crantisz
    Apr 26, 2022 at 20:54
0
$\begingroup$

Try to use attributes that are linked to values (integers or float) in GeoNodes. Then transfer the attributes to the shader nodes and connect them.

$\endgroup$
0

You must log in to answer this question.

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