From 53ffa5d3157d42b3c058ce9184854447fa3d1b75 Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Fri, 15 Sep 2023 16:15:16 +0900 Subject: [PATCH 1/2] chore: automatically merge unnecessary activeness animated GameObject --- .../TraceAndOptimize/FindUnusedObjectsProcessor.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Editor/Processors/TraceAndOptimize/FindUnusedObjectsProcessor.cs b/Editor/Processors/TraceAndOptimize/FindUnusedObjectsProcessor.cs index fa3835d1a..12c2bc3db 100644 --- a/Editor/Processors/TraceAndOptimize/FindUnusedObjectsProcessor.cs +++ b/Editor/Processors/TraceAndOptimize/FindUnusedObjectsProcessor.cs @@ -314,10 +314,12 @@ bool ConfigureRecursive(Transform transform, ImmutableModificationsContainer mod // The bone cannot be used generally if ((_marked[transform] & ~AllowedUsages) != 0) return false; // must not be animated - if (Animated(transform, modifications)) return false; + if (TransformAnimated(transform, modifications)) return false; if (!mergedChildren) { + if (GameObjectAnimated(transform, modifications)) return false; + var localScale = transform.localScale; var identityTransform = localScale == Vector3.one && transform.localPosition == Vector3.zero && transform.localRotation == Quaternion.identity; @@ -365,9 +367,6 @@ bool GameObjectAnimated(Transform transform, ImmutableModificationsContainer mod return false; } - - bool Animated(Transform transform, ImmutableModificationsContainer modifications) => - TransformAnimated(transform, modifications) || GameObjectAnimated(transform, modifications); } private static readonly string[] TransformProperties = From 996bc53baa0895dd83a117f5b3ab01431d9c0154 Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Fri, 15 Sep 2023 16:17:00 +0900 Subject: [PATCH 2/2] docs(changelog): Automatically merge unnecessary activeness animated GameObject --- CHANGELOG-PRERELEASE.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG-PRERELEASE.md b/CHANGELOG-PRERELEASE.md index a41a2dac4..4d277fc50 100644 --- a/CHANGELOG-PRERELEASE.md +++ b/CHANGELOG-PRERELEASE.md @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog]. ## [Unreleased] ### Added +- Automatically merge unnecessary activeness animated GameObject `#476` ### Changed