From 8414d203e51490ffe54bcfa749fdab5d56c0b6e9 Mon Sep 17 00:00:00 2001 From: tliks Date: Thu, 30 Jan 2025 23:50:46 +0900 Subject: [PATCH] chore: ignore inactive root in GetTargetGroups --- Editor/MiscPreview/RemoveVertexColorPreview.cs | 3 ++- Editor/ScaleAdjuster/ScaleAdjusterPreview.cs | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Editor/MiscPreview/RemoveVertexColorPreview.cs b/Editor/MiscPreview/RemoveVertexColorPreview.cs index e1e8a4e0..e4eba0a5 100644 --- a/Editor/MiscPreview/RemoveVertexColorPreview.cs +++ b/Editor/MiscPreview/RemoveVertexColorPreview.cs @@ -18,7 +18,8 @@ namespace nadena.dev.modular_avatar.core.editor public ImmutableList GetTargetGroups(ComputeContext context) { - var roots = context.GetAvatarRoots(); + var roots = context.GetAvatarRoots() + .Where(r => context.ActiveInHierarchy(r) is true); var removers = roots .SelectMany(r => context.GetComponentsInChildren(r, true)) .Select(rvc => (ToPathString(context, rvc.transform), diff --git a/Editor/ScaleAdjuster/ScaleAdjusterPreview.cs b/Editor/ScaleAdjuster/ScaleAdjusterPreview.cs index 3b34cec1..a311e726 100644 --- a/Editor/ScaleAdjuster/ScaleAdjusterPreview.cs +++ b/Editor/ScaleAdjuster/ScaleAdjusterPreview.cs @@ -1,4 +1,4 @@ -#region +#region using System.Collections.Generic; using System.Collections.Immutable; @@ -63,6 +63,11 @@ namespace nadena.dev.modular_avatar.core.editor foreach (var root in ctx.GetAvatarRoots()) { + if (ctx.ActiveInHierarchy(root) is false) + { + continue; + } + if (ctx.GetComponentsInChildren(root, true).Length == 0) { continue;