• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Unity - Corrupt textures on Shadergraph.Duplicate();

New Here ,
Nov 18, 2021 Nov 18, 2021

Copy link to clipboard

Copied

Heya! I've been doing some googling to fix a personal project but to summarize briefly. In Unity version 2020.2.1f1 & substance version 2.6.0a we have several cars on screen and want users to be able to customize the looks of each car that is on screen, so we're trying to creates instances of the same substance so that we can set the values of each of them individually, without it affecting the other one.

 

We'd assumed the way to do something like that would be via initiating or duplicating the substances and our attempt was with something like this:

        SubstanceGraph _mainBody;
        SubstanceGraph _mainBodyClone = _mainBody.Duplicate();
        Renderer[] _renderers = GetComponentsInChildren<Renderer>(true);
        for (int i = 0; i < _renderers.Length; i++)
        {
            Renderer current = _renderers[i];
            Material[] currentMaterials = current.materials;
            //The cars are subdivided into multiple meshes, for customization - some of them also have multiple materials, so we try to only replace the original car body
            for (int m = 0; m < current.materials.Length; m++)
            {
                if (current.materials[m].name.Contains("car_body"))
                {
                    currentMaterials[m] = _paintBodyClone.material;
                }
            }
            _renderers[i].materials = currentMaterials;
        }

However, although this does clone the substance and give us a new instance of the substance to edit - it also creates these really weird lines on the texture that weren't there before. A bit of googling led me to the following (old) thread with someone with the exact same issue:
https://forum.substance3d.com/index.php?topic=31441.0

 

The response there was that it would be fixed in 2.4.2, it's obviously a while past that so are we going about this wrong and is there anything we can do to fix it for us, or are we just going to have to put this feature on hold for a while?

TOPICS
Bugs & Crashes , Unity

Views

147

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation
Resources
Documentation
Download Latest Versions