3
$\begingroup$
  • I use geometry nodes (blender 2.93) to distribute cylinders on the cube (Point distribute, Point instance nodes are used) enter image description here
  • I define materials if Materials Properties for cube (red color) and cylinder (blue color). On this stage everything is OK: red cube is covered with blue cylinders. enter image description here
  • After it I create a sphere (green color) and define particle system for the sphere (render as object, object - Cube). I expect, that green sphere is covered with red cubes, which are covered with blue cylinders. But in reality green sphere is covered with red cubes. No cylinders. enter image description here

The reasonable solution seems to me to apply geometry nodes modifier for cube. After it I see green sphere is covered with red cubes, red cubes are covered with red (not blue) cylinders. enter image description here

So point instances lose their material after applying modifier.

  • Is this situation is expected?
  • How to keep material of point instances when using the object (cube) as particle?

I would be grateful for the answer :)

$\endgroup$

1 Answer 1

4
$\begingroup$

Applying the modifier loses information for two reasons :

  • Your cube doesn't have cylinder_mat (or whatever the blue material is called) in its material slots.
  • You cylinder object's material slots aren't setup in the right order.

Explanation :

When making the GN "real", it's all converted to one mesh. Every face has a material_index attribute which tells the object and renderer how to display it. If your cylinder object only has 1 material, all its faces will have a material index of 0 (first element). It will then naturally point to the first material slot in the cube object, which is cube_mat (red).

In order to keep the materials, you have to :

  1. Add an empty slot in the cylinder material, and add the actual material as the 2nd slot. Make sure to apply the correct material to all faces.

enter image description here

  1. Add this material to the 2nd slot of the cube.

enter image description here

Applying the modifier keeps the correct materials :

enter image description here

You should do this for every subsequent object / material you are adding. As long as the material slot(s) in the base object are the same as in the instancer object, the materials will be the same.

However on my build I didn't have trouble instancing the (Cube + Cylinders) object on another object, without applying the GN modifier. Make sure you are using the latest stable version, the behaviour might have changed recently.

enter image description here

Note :

  • This setup will destroy UVs. It's only good for materials that don't rely on them.
  • If you are to use a modifier or somehow modify the geometry after instancing, all links to materials will be lost. In that case the end of this answer might help : https://blender.stackexchange.com/a/231024/86891
$\endgroup$
1
  • $\begingroup$ It works. Thank you very much :) $\endgroup$ Jul 20, 2021 at 20:04

You must log in to answer this question.

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