diff --git a/Editor/ReactiveObjects/AnimationGeneration/ReactiveObjectPass.cs b/Editor/ReactiveObjects/AnimationGeneration/ReactiveObjectPass.cs index 72f37d93..e1489320 100644 --- a/Editor/ReactiveObjects/AnimationGeneration/ReactiveObjectPass.cs +++ b/Editor/ReactiveObjects/AnimationGeneration/ReactiveObjectPass.cs @@ -468,10 +468,10 @@ namespace nadena.dev.modular_avatar.core.editor path = RuntimeUtil.RelativePath(context.AvatarRootObject, go); componentType = typeof(GameObject); } - else if (key.TargetObject is SkinnedMeshRenderer smr) + else if (key.TargetObject is Renderer r) { - path = RuntimeUtil.RelativePath(context.AvatarRootObject, smr.gameObject); - componentType = typeof(SkinnedMeshRenderer); + path = RuntimeUtil.RelativePath(context.AvatarRootObject, r.gameObject); + componentType = r.GetType(); } else { diff --git a/Editor/ReactiveObjects/MaterialSetterPreview.cs b/Editor/ReactiveObjects/MaterialSetterPreview.cs index 8ff7b2c8..fef718e9 100644 --- a/Editor/ReactiveObjects/MaterialSetterPreview.cs +++ b/Editor/ReactiveObjects/MaterialSetterPreview.cs @@ -49,6 +49,7 @@ namespace nadena.dev.modular_avatar.core.editor { var renderer = context.GetComponent(target); if (renderer == null) continue; + if (renderer is not MeshRenderer and not SkinnedMeshRenderer) continue; var matCount = context.Observe(renderer, r => r.sharedMaterials.Length); @@ -94,6 +95,7 @@ namespace nadena.dev.modular_avatar.core.editor var (original, proxy) = proxyPairs.First(); if (original == null || proxy == null) return null; + if (original is not MeshRenderer and not SkinnedMeshRenderer || proxy is not MeshRenderer and not SkinnedMeshRenderer) return null; var mats = new Material[proxy.sharedMaterials.Length]; @@ -131,6 +133,7 @@ namespace nadena.dev.modular_avatar.core.editor public void OnFrame(Renderer original, Renderer proxy) { if (original == null || proxy == null) return; + if (original is not MeshRenderer and not SkinnedMeshRenderer || proxy is not MeshRenderer and not SkinnedMeshRenderer) return; var mats = proxy.sharedMaterials;