3
$\begingroup$

I have made a python script using this amazing addon Node2Python from the geometry nodes setup I made when I asked about this question. Shoutout to lemon thank you so much for your help! The geometry nodes to voxelize worked perfectly. At first when I generated the python script equivalent of the node setup and then executed it, you will see that the setup is exactly the same with the previous setup I have (The blend file is also available in the previous thread)

enter image description here

But when I apply this python generated setup, the colors output don't match anymore. I compared both the original GN version and the python generated GN version and I don't see any difference yet the output is not right. What's going on? I'm not sure if I reproduced a bug, can anyone confirm?

UPDATE: It looks like a bug as confirmed by lemon here

When you apply the modifier notice that there is an empty material added. This new empty material is added at the end in the original setup, hence not interfering with the setup. The python-generated node setup however inserts this empty material at index zero and thus disrupting the node setup by shifting all the material indices. So this is definitely a bug because of the inconsistent behavior despite identical GN setups.

enter image description here

Now the question is, does anyone know of a workaround to this?

$\endgroup$
13
  • $\begingroup$ I don't know the reason, but I ran the script again and... it works! $\endgroup$
    – lemon
    Commented Mar 9 at 10:24
  • $\begingroup$ not totally. I've studied your files, tried with other models etc. And at the end, I've just regenerated the node tree using the script (and this time, it was ok). $\endgroup$
    – lemon
    Commented Mar 9 at 14:52
  • $\begingroup$ Yes I've seen that also. Do you confirm that regenerating the node tree does the job (and repeatedly)? $\endgroup$
    – lemon
    Commented Mar 9 at 17:35
  • 1
    $\begingroup$ FYI, projects.blender.org/blender/blender/issues/119258 $\endgroup$
    – lemon
    Commented Mar 9 at 19:03
  • 1
    $\begingroup$ We can conclude that the addon somehow inverts the "join geometry" inputs, so that, if volume is first, we have the empty slot first. right? If having at least one mat slot is the way gn is for volume, your workaround works, but the bug is in the addon, I think. $\endgroup$
    – lemon
    Commented Mar 10 at 6:25

1 Answer 1

3
$\begingroup$

One possible workaround is to add +1 to the material index since blender consistently adds a hidden empty material to index 0. The development team claims it to be expected behavior in TICKET-119258 to add a hidden/secret Empty material.

Iliya Katushenock commented:

Volume have no material. Every time when new mesh is created from scratch (not from other mesh) (but from volume without material), its matrials list are empty. We can not have empty materials list on mesh in geometry nodes, so empty material slot are added. This is expected behavior

So I guess this is the "proper" solution?

enter image description here

UPDATE:

The right solution is to swap the noodles going into the Join Geometry node so that the hidden empty material gets added to the end of the materials list, thus not interfering with the node setup.

enter image description here

$\endgroup$
1

You must log in to answer this question.

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