diff --git a/CHANGELOG.md b/CHANGELOG.md index 3aec524..eadf90e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/Editor/d4rkAvatarOptimizer.cs b/Editor/d4rkAvatarOptimizer.cs index 1f9a24c..de6fccd 100644 --- a/Editor/d4rkAvatarOptimizer.cs +++ b/Editor/d4rkAvatarOptimizer.cs @@ -2885,6 +2885,14 @@ private HashSet FindAllMovingTransforms() transforms.Add(constraint.transform); } + var finalIKScripts = GetComponentsInChildren(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)) {