Skip to content

Commit

Permalink
Fixed an issue which prevented obfuscation when game objects has same…
Browse files Browse the repository at this point in the history
… names as game objects of the armature hierarchy
  • Loading branch information
Esska committed Aug 1, 2023
1 parent 5341b8f commit 03527d7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions Editor/Obfuscator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,25 @@ Avatar ObfuscateAvatar(Animator animator) {
upperLegTwist = animator.avatar.humanDescription.upperLegTwist
};

Transform[] children = animator.transform.GetComponentsInChildren<Transform>(true);

for (int i = 0; i < children.Length; i++) {

if (children[i] == animator.transform.GetChild(0) || children[i].parent != animator.transform)
continue;

children[i].parent = null;
}

obfuscatedAvatar = AvatarBuilder.BuildHumanAvatar(animator.gameObject, description);

for (int i = 0; i < children.Length; i++) {

if (children[i].parent != null)
continue;

children[i].parent = animator.transform;
}
}
else {
obfuscatedAvatar = AvatarBuilder.BuildGenericAvatar(animator.gameObject, "");
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": "com.esska.av3obfuscator",
"displayName": "Esska AV3 Obfuscator",
"version": "2.1.0",
"version": "2.1.1",
"unity": "2019.4",
"description": "Esska AV3Obfuscator allows you to obfuscate your VRChat avatar.",
"author": {
Expand Down

0 comments on commit 03527d7

Please sign in to comment.