reallusion / Auto-Setup-for-Unity

iClone / Character Creator / ActorCore Auto Setup for Unity Script
GNU General Public License v2.0
78 stars 28 forks source link

Decimal values from Json equals 0 #2

Open kandohar opened 2 years ago

kandohar commented 2 years ago

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 commented 2 years ago

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