Author Topic: [BUG] Substance plugin overriding duplicated material inspector  (Read 522 times)

Unity 2020.1.1f1 latest
Substance in Unity 2.5.2
HDRP 9.0.0-preview 33

Hi,

In a newly created empty project with the latest version of Unity and HDRP, if you duplicate a material with the following code, the duplicated material's inspector will display properly.

Code: [Select]
public Material originalMaterial;    // assigned a material from the project. Can use any shader.

public Material clonedMaterial;     // not assigned anything. Should be null in the inspector.


void Awake()
{
    clonedMaterial = new Material(originalMaterial);   // This duplicates the original material at runtime.
}

Once I import Substance 2.5.2, and run the above scenario, if you double click on the clonedMaterial in the inspector, it says "No Shader Selected", and there are no properties visible in the inspector.

Tests show that the material is cloned properly, but the duplicated material's inspector is broken. This makes it impossible to tweak the duplicated material's properties via the inspector because nothing is visible.

The Substance Plugin is breaking the material inspector for runtime duplicated materials.

Unity 2020.1.1f1 latest
Substance in Unity 2.5.2
HDRP 9.0.0-preview 33

Hi,

In a newly created empty project with the latest version of Unity and HDRP, if you duplicate a material with the following code, the duplicated material's inspector will display properly.

Code: [Select]
public Material originalMaterial;    // assigned a material from the project. Can use any shader.

public Material clonedMaterial;     // not assigned anything. Should be null in the inspector.


void Awake()
{
    clonedMaterial = new Material(originalMaterial);   // This duplicates the original material at runtime.
}

Once I import Substance 2.5.2, and run the above scenario, if you double click on the clonedMaterial in the inspector, it says "No Shader Selected", and there are no properties visible in the inspector.

Tests show that the material is cloned properly, but the duplicated material's inspector is broken. This makes it impossible to tweak the duplicated material's properties via the inspector because nothing is visible.

The Substance Plugin is breaking the material inspector for runtime duplicated materials.

Hey @korindian77 ,

Thank you for the repro steps. I was able to reproduce the issue and I will put a ticket in.

Hi, thanks for acknowledging the issue. Is there any rough timeline for a fix for this? It's getting pretty hard to do shader development when I can't see the shader's inspector for duplicated materials. Thanks.

Hi, thanks for acknowledging the issue. Is there any rough timeline for a fix for this? It's getting pretty hard to do shader development when I can't see the shader's inspector for duplicated materials. Thanks.

Hey @korindian77 ,

At the moment other issues are taking priority, but I brought it up again today to the team and I was told it would be looked into soon. Not sure on a timeline at this point. Apologies for the inconvenience in the meantime. :(

We'd also like to bump this issue if possible. We have massive numbers of submeshes with many different (dynamically instanced) materials on some gameObjects. It is a real pain when you can't see what each one is in the inspector without deleting the substance plugin!

Any update on if/when this is likely to be fixed? Currently, we're abandoning the substance plugin and baking textures external to Unity because whilst our programmers can hack around having a broken material inspector, our art team can't.

Any update on if/when this is likely to be fixed? Currently, we're abandoning the substance plugin and baking textures external to Unity because whilst our programmers can hack around having a broken material inspector, our art team can't.

@ferretnt ,

Apologies for the delay, and for the annoyances this bug has caused your team. We have a fix for it now in QA along with some other bug fixes. We hope to post the 2.5.3 plugin to our discord beta group this week/early next week, then later to the asset store.

If you wanted to join the discord beta group to get the plugin before we post to the asset store let me know your discord name+numbers and I can add you.