Skip to content

Commit

Permalink
Always enable SkinnedMeshRenderer component that gets other meshes me…
Browse files Browse the repository at this point in the history
…rged into it. #15
  • Loading branch information
d4rkc0d3r committed Nov 10, 2022
1 parent 37d4983 commit 882eb1d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Bug Fixes
* Fix parents of animated transforms getting deleted. [(more)](https://github.com/d4rkc0d3r/d4rkAvatarOptimizer/issues/14)
* Always enable SkinnedMeshRenderer component that gets other meshes merged into it. [(more)](https://github.com/d4rkc0d3r/d4rkAvatarOptimizer/issues/15)

## v1.7
### Bug Fixes
Expand Down
14 changes: 9 additions & 5 deletions src/d4rkAvatarOptimizerEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1258,7 +1258,6 @@ private static void SaveOptimizedMaterials()
}
}
Profiler.EndSection();
CreateUniqueAsset(mat, mat.name + ".mat");
}

var skinnedMeshRenderers = root.GetComponentsInChildren<SkinnedMeshRenderer>(true);
Expand Down Expand Up @@ -1317,10 +1316,11 @@ private static void SaveOptimizedMaterials()
}
}
}
}

Profiler.StartSection("AssetDatabase.SaveAssets()");
AssetDatabase.SaveAssets();
Profiler.EndSection();
foreach (var mat in optimizedMaterials)
{
CreateUniqueAsset(mat, mat.name + ".mat");
}
}

Expand Down Expand Up @@ -2124,7 +2124,11 @@ private static void CombineSkinnedMeshes()
}
}

meshRenderer.gameObject.SetActive(true);
if (combinableSkinnedMeshes.Count > 1)
{
meshRenderer.gameObject.SetActive(true);
meshRenderer.enabled = true;
}

Profiler.StartSection("AssetDatabase.SaveAssets()");
AssetDatabase.SaveAssets();
Expand Down

0 comments on commit 882eb1d

Please sign in to comment.