Search Unity

Bug LayerdLit inspector broken after upgrading HDRP from 8 to 10

Discussion in 'High Definition Render Pipeline' started by iamarugin, Feb 17, 2021.

  1. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    883
    Inspector look like this:
    upload_2021-2-17_15-52-28.png

    And there is infinite loop of errors in the console:
    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. UnityEditor.Rendering.HighDefinition.LayeredLitGUI.InitializeMaterialLayers (UnityEditor.AssetImporter materialImporter, UnityEngine.Material[]& layers, System.Boolean[]& withUV) (at Library/PackageCache/com.unity.render-pipelines.high-definition@10.3.1/Editor/Material/LayeredLit/LayeredLitGUI.cs:351)
    3. UnityEditor.Rendering.HighDefinition.LayerListUIBlock.LoadMaterialProperties () (at Library/PackageCache/com.unity.render-pipelines.high-definition@10.3.1/Editor/Material/UIBlocks/LayerListUIBlock.cs:78)
    4. UnityEditor.Rendering.HighDefinition.MaterialUIBlock.UpdateMaterialProperties (UnityEditor.MaterialProperty[] properties) (at Library/PackageCache/com.unity.render-pipelines.high-definition@10.3.1/Editor/Material/UIBlocks/MaterialUIBlock.cs:75)
    5. UnityEditor.Rendering.HighDefinition.MaterialUIBlockList.OnGUI (UnityEditor.MaterialEditor materialEditor, UnityEditor.MaterialProperty[] properties) (at Library/PackageCache/com.unity.render-pipelines.high-definition@10.3.1/Editor/Material/UIBlocks/MaterialUIBlockList.cs:59)
    6. UnityEditor.Rendering.HighDefinition.LayeredLitGUI.OnMaterialGUI (UnityEditor.MaterialEditor materialEditor, UnityEditor.MaterialProperty[] props) (at Library/PackageCache/com.unity.render-pipelines.high-definition@10.3.1/Editor/Material/LayeredLit/LayeredLitGUI.cs:43)
    7. UnityEditor.Rendering.HighDefinition.HDShaderGUI.OnGUI (UnityEditor.MaterialEditor materialEditor, UnityEditor.MaterialProperty[] props) (at Library/PackageCache/com.unity.render-pipelines.high-definition@10.3.1/Editor/Material/UIBlocks/HDShaderGUI.cs:79)
    8. UnityEditor.MaterialEditor.PropertiesGUI () (at <a936841cea2147a2a55ea27843fa46ae>:0)
    9. UnityEditor.MaterialEditor.OnInspectorGUI () (at <a936841cea2147a2a55ea27843fa46ae>:0)
    10. Substance.Editor.InspectorMaterial.DrawUnityInspectorPages () (at <441a06e023434232bcc934d0783b3238>:0)
    11. Substance.Editor.InspectorMaterial.OnInspectorGUI () (at <441a06e023434232bcc934d0783b3238>:0)
    12. UnityEditor.UIElements.InspectorElement+<>c__DisplayClass58_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <b45c30541531431286ef0e6e52b4f09c>:0)
    13. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
    14.  
    Update HDRP materials from the previous version doesn't help. Any advice would be appreciated.
     
  2. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    883
    It looks like because meta-file is missing "withUV" array and looks like this:

    Code (CSharp):
    1. fileFormatVersion: 2
    2. guid: 2cfadf83c893b65469a1b5ed4174daf6
    3. NativeFormatImporter:
    4.   externalObjects: {}
    5.   mainObjectFileID: 0
    6.   userData: '{"GUIDArray":["52ff36574be094e429e55f54ddbf54df","d9e8db1892b0fba4aa7f03ca87676e11","b5f799d5b28567e43a8122716bcb3c4b",""]}'
    7.   assetBundleName:
    8.   assetBundleVariant:
    9.  
     
  3. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    883
    Also metallic remapping for layered materials was not properly updated.
     
  4. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    883
    I can open a case if someone from Unity will confirm, that it is not known issue.
     
  5. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    883
  6. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    270
    Sorry about the inconvenience, it has already been fixed in package version 10.4.

    If you don't want to upgrade, you can workaround it by manually adding the withUV array in the meta file. That would look like that:
    Code (CSharp):
    1.   userData: '{"GUIDArray":["52ff36574be094e429e55f54ddbf54df","d9e8db1892b0fba4aa7f03ca87676e11","b5f799d5b28567e43a8122716bcb3c4b",""],"withUV":[true,true,true,true]}'
     
    chap-unity likes this.
  7. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    883
    Thank you very much!