4
$\begingroup$

After changing the geometry in a simulation zone, my whole material is "gone". Does anybody know how to get it "back"?

$\endgroup$
2
  • 2
    $\begingroup$ This is a limitation of 4.0... I think 4.1 will keep material IDs. Jacques Lucke explains it here projects.blender.org/blender/blender/issues/108410 $\endgroup$
    – lemon
    Commented Feb 17 at 9:40
  • $\begingroup$ But you've material index that can be captured (never tested it) $\endgroup$
    – lemon
    Commented Feb 17 at 9:41

1 Answer 1

7
$\begingroup$

You could use the fact the material index is preserved and reapply the materials this way:

A complete example:

I don't know if a visualization is needed here:

$\endgroup$
8
  • $\begingroup$ Do you know why reassigning the index is needed? Because material index is still there it seems after "join geometry". $\endgroup$
    – lemon
    Commented Feb 17 at 16:56
  • $\begingroup$ @lemon for the same reason capturing it is needed - it changes upon joining geometry. Since the original geometry is first, I used the reassignment to set the materials of the old geometry. $\endgroup$ Commented Feb 17 at 16:57
  • $\begingroup$ ok, got it, for the same reason you could sample (after joining) instead of capturing at the condition the original is first when joined. Thanks $\endgroup$
    – lemon
    Commented Feb 17 at 17:03
  • 1
    $\begingroup$ @lemon the materials are discarded in the simulation zones due to problem with retaining references. So simple "primitive" values are kept, like the material index, but references to other datablocks like materials, aren't. "Join geometry" node works similarly (see here ) to manual joining in the viewport: it adds faces to the first object from other objects, reads materials of those faces, and if a material didn't exist on the first object... $\endgroup$ Commented Feb 19 at 17:24
  • 1
    $\begingroup$ ... , it adds it and assigns the next available material index. If the material did exist, it uses its mat index. Either way material indices are recalculated. This is why you need to capture it. $\endgroup$ Commented Feb 19 at 17:24

You must log in to answer this question.

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