diff --git a/README.md b/README.md index 3651725..df4e636 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ Changelog ========= ### 2.1.7 -- Normal maps imported separately from batch substance import as it does not correctly assign to Normal channel under certain circumstances. +- Normal map fix for imported characters. - Sync lights includes scene IBL from visual settings. ### 2.1.6 diff --git a/btp/cc.py b/btp/cc.py index 126e766..f92c247 100644 --- a/btp/cc.py +++ b/btp/cc.py @@ -74,8 +74,8 @@ class SkinBoneType(IntEnum): "Refraction": [EMaterialTextureChannel_Refraction, False, ""], "Cube": [EMaterialTextureChannel_Cube, False, ""], "AO": [EMaterialTextureChannel_AmbientOcclusion, True, "ao"], - "Bump": [EMaterialTextureChannel_Bump, False, "bump"], - "Normal": [EMaterialTextureChannel_Normal, False, "normal"], + "Bump": [EMaterialTextureChannel_Bump, True, "bump"], + "Normal": [EMaterialTextureChannel_Normal, True, "normal"], } diff --git a/btp/importer.py b/btp/importer.py index fcaad36..5d02faf 100644 --- a/btp/importer.py +++ b/btp/importer.py @@ -470,6 +470,17 @@ def import_substance_textures(self, mesh_materials): if not M.has_json(): continue + # The FbxKey will attempt to restore old textures, + # but it wrongly restores the Normals into the Bump channel, + # and the LoadSubstancePainterTextures() does not overrule this. + # This causes major problems with texture channel loading later on, + # so we need to remove all the existing normals and bump maps now: + if True: + if M.channel_has_image(RLPy.EMaterialTextureChannel_Bump): + M.remove_channel_image(RLPy.EMaterialTextureChannel_Bump) + if M.channel_has_image(RLPy.EMaterialTextureChannel_Normal): + M.remove_channel_image(RLPy.EMaterialTextureChannel_Normal) + if not F or F.mesh_name != M.mesh_name or M.mesh_name != "CC_Base_Body": F = M