Child content not instanced with instanced parent content

If we create two materials, each with a child texture:

image

And then create a double-sided material that references them:

image

We can see that though the materials are properly instanced, their child textures are instead duplicated, largely defeating the usefulness of instancing the materials. I assume this to be buggy, and to be the source of various other misbehaviors described below.

Editing the textures, the originals appear to be connected to their materials, but for the duplicates it depends if we are looking at a rendered viewport, or a render (see the attached video).

Upon removing the textures from the referenced materials, the duplicates are no longer seen in a rendered viewport, nor in a render, nor in the textures panel, nor in the content browser, but they still appear in the material tree:

image

However if we now save & re-open the model, then the material tree also shows that the duplicated textures have been removed:

image

These behaviors are not specific to the double-sided material, which is only used here to reproduce the issue in a clear & simple way, without the involvement of any plugins (all non-rhino plugins have been load protected) – they also occur when using custom RenderContent-derived classes in a plugin, where the issue may be more problematic, since the content types being used may be fundamental to material structure, and not just textures that are being inconveniently duplicated.

(tested on win10 7.8.21196.5001, 2021-07-15)

child-content-not-instanced.3dm (255.1 KB)

Hi @jdhill,

Thanks for the extensive analysis. I’ll look into this ASAP.

https://mcneel.myjetbrains.com/youtrack/issue/RH-65040

John

1 Like

In case it helps, here’s a different behavior (still win10 7.8.21196.5001, 2021-07-15, non-rhino plugins load-protected) I ran across that seems related:

Preconditions: textures panel is docked, horizontal layout, tree view

    1. open rhino, file > new > no template
    2. create a 2d checker
    3. assign a new grid texture to color 1
    4. create another 2d checker

The second 2d checker gets a phantom "(unnamed)" child

Hi @jdhill,

I have fixed the original problem. The fix should appear in 7.10. I will look into the phantom child problem ASAP.

John

1 Like

Thanks!

@jdhill,

Thanks for reporting the phantom child. That is now also fixed (in 7.10).

John

1 Like

Awesome, thanks again Sir!