diff --git a/CHANGELOG.md b/CHANGELOG.md index 6053c71..eaa0ba1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## v2.3.1 +### Bug Fixes +* Fix tangents being 0 if a mesh with no tangents gets merged with one that has tangents. + ## v2.3.0 ### Features * Added tooltips to all toggles and foldouts. They are identical to the descriptions in the readme. diff --git a/Editor/d4rkAvatarOptimizer.cs b/Editor/d4rkAvatarOptimizer.cs index 417a94c..ba8c39c 100644 --- a/Editor/d4rkAvatarOptimizer.cs +++ b/Editor/d4rkAvatarOptimizer.cs @@ -2422,7 +2422,7 @@ private void CombineAndOptimizeMaterials() newMesh.bounds = mesh.bounds; newMesh.SetNormals(targetNormals); if (targetTangents.Any(t => t != Vector4.zero)) - newMesh.SetTangents(targetTangents); + newMesh.SetTangents(targetTangents.Select(t => t == Vector4.zero ? new Vector4(1, 0, 0, 1) : t).ToArray()); newMesh.subMeshCount = matchedSlots.Count; for (int i = 0; i < matchedSlots.Count; i++) { diff --git a/package.json b/package.json index 7ee95ed..84ca085 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "d4rkpl4y3r.d4rkavataroptimizer", "displayName": "d4rkAvatarOptimizer", - "version": "2.3.0", + "version": "2.3.1", "unity": "2019.4", "description": "An optimizer aiming to reduce mesh & material count and more of VRChat 3.0 avatars.", "dependencies": {},