Skip to content

Commit

Permalink
Fix tangents being 0 if a mesh with no tangents gets merged with one …
Browse files Browse the repository at this point in the history
…that has tangents.
  • Loading branch information
d4rkc0d3r committed Jul 17, 2023
1 parent dfee883 commit 27ae0bf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion Editor/d4rkAvatarOptimizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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++)
{
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {},
Expand Down

0 comments on commit 27ae0bf

Please sign in to comment.