Closed Electrocutor closed 7 years ago
Thanks for the report; will be putting this one on the 'priority fix' list as it interferes with stock code in some fashion.
No idea how it could be interfering, but I'll dig into it and find out.
Edit:
If that is the case, you can use the builtin textures for white and black instead of generating them each time: Texture2D.whiteTexture Texture2D.blackTexture
I also see that Texture2D is where the texture tiling modes are set.
Have a preliminary fix in place that assigns textures to any empty texture slot on any model/mesh that is adjusted through the 'default shader assignments' method.
It has removed the errors from the log when loading stock parts with replaced textures, and am investigating to make sure it hasn't introduced any other problems.
Still had to dynamically create a default Normal Map texture (64x64, flat normals), as Unity doesn't offer a default value for those. Used Texture2D.blackTexture for the placeholder for both DIFF and GLOW slots.
Example: USI's ORE_DRILL MODEL { model = Squad/Parts/Resources/RadialDrill/TriBitDrill texture = TriBitDrill, UmbraSpaceIndustries/KarbonitePlus/Assets/TriBitDrill_GY scale = 2,2,2 }
The place the exception is being thrown is the KSP API: PartLoader.ReplaceTextures.
Suspect TU cfg: model = Squad/Parts/Resources/RadialDrill/TriBitDrill TEXTURE { shader = SSTU/PBR/Metallic