Auto-Setup-for-Unity icon indicating copy to clipboard operation
Auto-Setup-for-Unity copied to clipboard

Decimal values from Json equals 0

Open kandohar opened this issue 4 years ago • 1 comments

I'm using this project in my HDRP Unity project instead of the DLL to import CC models.

By default, after an import, all the materials are black and almost no values are set.

For example, adding the line: Debug.Log(kMaterialJson.ToJson()); at line 1090 in RLEditor.cs will log: {"Material Type":"Pbr","MultiUV Index":0,"Two Side":true,"Diffuse Color":[0,0,0],"Ambient Color":[0,0,0],"Specular Color":[0,0,0],"Opacity":0,"Self Illumination":0,"Textures":{"Metallic":{"Texture Path":"","Strength":0,"Offset":[0,0],"Tiling":[0,0]},"Base Color":{"Texture Path":"./OldBG.fbm/Ga_Skin_Body_Pbr_Diffuse.tga","Strength":0,"Offset":[0,0],"Tiling":[0,0]},"Roughness":{"Texture Path":"","Strength":0,"Offset":[0,0],"Tiling":[0,0]},"Opacity":{"Texture Path":"./OldBG.fbm/Ga_Skin_Body_Pbr_Diffuse.tga","Strength":0,"Offset":[0,0],"Tiling":[0,0]},"Blend":{"Texture Path":"./textures/OldBG/OldBG/CC_Base_Tongue/Ga_Skin_Body_Pbr/Ga_Skin_Body_Pbr_blend_multiply.tga","Strength":0,"Offset":[0,0],"Tiling":[0,0],"Blend Mode":"Multiply"},"Normal":{"Texture Path":"./OldBG.fbm/Ga_Skin_Body_Pbr_Normal.tga","Strength":0,"Offset":[0,0],"Tiling":[0,0]},"Reflection":{"Texture Path":"","Strength":0,"Offset":[0,0],"Tiling":[0,0]},"AO":{"Texture Path":"./textures/OldBG/OldBG/CC_Base_Tongue/Ga_Skin_Body_Pbr/Ga_Skin_Body_Pbr_ao.tga","Strength":0,"Offset":[0,0],"Tiling":[0,0]},"MetallicAlpha":{"Texture Path":"./textures/OldBG/OldBG/CC_Base_Tongue/Ga_Skin_Body_Pbr/Ga_Skin_Body_Pbr_MetallicAlpha.tga"},"HDRP":{"Texture Path":"./textures/OldBG/OldBG/CC_Base_Tongue/Ga_Skin_Body_Pbr/Ga_Skin_Body_Pbr_HDRP.tga"}}}

As you can see, the Json parser is not able to read the decimal values, but the string are correct (e.g. Path). Is it a LitJson library problem or am I doing something wrong?


Unity 2020.1.8f1 HDRP 8.2.0

kandohar avatar Sep 13 '21 13:09 kandohar

Ok, I updated the LitJson.dll to the latest found on their Github: v0.17.0 and it solves my issue.

kandohar avatar Sep 15 '21 11:09 kandohar