Search Unity

Gameobject losing its shader effects after deserialization: Any way to refresh?

Discussion in 'Editor & General Support' started by mattcscz, Sep 3, 2015.

  1. mattcscz

    mattcscz

    Joined:
    Mar 7, 2010
    Posts:
    411
    Hi guys,

    As the title says, I'm having an issue where after a saved gameobject is de-serialized it will lose any material/shader effect until I manually expand the material window in the editor.

    Is there anything I can call to refresh all the materials?



    Thanks!
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,297
  3. mattcscz

    mattcscz

    Joined:
    Mar 7, 2010
    Posts:
    411
    Yes, i'm working with the standard shader =)

    I've taken a look at the Materials reference you linked above but I can't see what I might call to set this, unless I were to just call any of the set methods?

    Thanks for the reply!
     
  4. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,297
    Are these material assets stored in your project or being created procedurally? If they are created by a script then you need to enable the keywords for the areas that are used, e.g if you add a normal map then you need to enable the keyword _NORMALMAP in the material. If you are unsure you could just go through the material and check if a normal map exists, if so enable keyword, etc.