3
$\begingroup$

I followed this tutorial on how to "lego-fy" model in Blender. It works out and now I want to apply the Geometry Nodes modifier. I figured that I need to use the Realize Instances node to make that possible, but when I apply it, the material is gone and I don't know how to make it both modifier apply-able, and also keep the material colors on.

I attached the Blender file for this as well: https://drive.google.com/file/d/11sMipsu1V9ty166tAebufwj0HF3pGZbx/view?usp=sharing

enter image description here

$\endgroup$

1 Answer 1

3
$\begingroup$

Since you use Sample Nearest to query the UV map of the closest point of your base mesh, but after the realization of the instances the initial position is changed to the points position, you do not get the correct value, which is ultimately responsible for the assignment and subsequently for the color.

However, you can solve this easily:

enter image description here

Here I capture before the realization in the instance domain the position of the instance, and use that as the starting point for Sample Nearest. This value is queried after the realization of the instances and assigned to the face corners of the final mesh.

Additionally, of course, you would have to change the attribute type in the shader from Instancer to Geometry.


(Blender 3.4+)

$\endgroup$
3
  • $\begingroup$ Thank you! This seems to work. However, I now have an issue with exporting the model in .glb would results in a black color material instead (Import back in Blender would show it). Do you have a solution for that? $\endgroup$
    – Toby
    Commented Jul 14, 2023 at 12:52
  • $\begingroup$ @Toby Unfortunately, both do not work in this scenario. By realizing the instances, they lose their original UV map, which would require you to create a new one. See here: blender.stackexchange.com/questions/234772 I therefore think that this would be a new question .... $\endgroup$
    – quellenform
    Commented Jul 14, 2023 at 13:04
  • $\begingroup$ I see! Thank you for the information $\endgroup$
    – Toby
    Commented Jul 14, 2023 at 15:12

You must log in to answer this question.

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