Skip to content

Commit

Permalink
Add support for FinalIK components with the `Delete Unused GameObject…
Browse files Browse the repository at this point in the history
…s` option. #115
  • Loading branch information
d4rkc0d3r committed Aug 15, 2024
1 parent 3efde88 commit 0c3e205
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## v3.8.0
### Features
* Add support for VRChat constraints.
* Add support for FinalIK components with the `Delete Unused GameObjects` option.

## v3.7.4
### Bug Fixes
Expand Down
8 changes: 8 additions & 0 deletions Editor/d4rkAvatarOptimizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2885,6 +2885,14 @@ private HashSet<Transform> FindAllMovingTransforms()
transforms.Add(constraint.transform);
}

var finalIKScripts = GetComponentsInChildren<Behaviour>(true)
.Where(b => !alwaysDisabledComponents.Contains(b))
.Where(b => b.GetType().FullName.StartsWithSimple("RootMotion.FinalIK")).ToList();
foreach (var finalIKScript in finalIKScripts)
{
transforms.UnionWith(FindReferencedTransforms(finalIKScript));
}

var headChopType = Type.GetType("VRC.SDK3.Avatars.Components.VRCHeadChop, VRCSDK3A");
if (headChopType != null) {
foreach (var headChop in GetComponentsInChildren(headChopType, true)) {
Expand Down

0 comments on commit 0c3e205

Please sign in to comment.