diff --git a/Editor/Animation/AnimationServicesContext.cs b/Editor/Animation/AnimationServicesContext.cs index 95d68ec3..bc63cec9 100644 --- a/Editor/Animation/AnimationServicesContext.cs +++ b/Editor/Animation/AnimationServicesContext.cs @@ -7,7 +7,9 @@ using nadena.dev.ndmf; using UnityEditor; using UnityEditor.Animations; using UnityEngine; +#if MA_VRCSDK3_AVATARS using VRC.SDK3.Avatars.Components; +#endif #endregion @@ -89,12 +91,14 @@ namespace nadena.dev.modular_avatar.animation // HACK: This is a temporary crutch until we rework the entire animator services system public void AddPropertyDefinition(AnimatorControllerParameter paramDef) { +#if MA_VRCSDK3_AVATARS var fx = (AnimatorController) _context.AvatarDescriptor.baseAnimationLayers .First(l => l.type == VRCAvatarDescriptor.AnimLayerType.FX) .animatorController; fx.parameters = fx.parameters.Concat(new[] { paramDef }).ToArray(); +#endif } public string GetActiveSelfProxy(GameObject obj) diff --git a/Editor/Animation/GameObjectDisableDelayPass.cs b/Editor/Animation/GameObjectDisableDelayPass.cs index 0eed02d2..87692657 100644 --- a/Editor/Animation/GameObjectDisableDelayPass.cs +++ b/Editor/Animation/GameObjectDisableDelayPass.cs @@ -1,4 +1,5 @@ -using System.Linq; +#if MA_VRCSDK3_AVATARS +using System.Linq; using nadena.dev.modular_avatar.core.editor; using nadena.dev.ndmf; using UnityEditor; @@ -124,4 +125,5 @@ namespace nadena.dev.modular_avatar.animation }; } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/Editor/Animation/PathMappings.cs b/Editor/Animation/PathMappings.cs index 9546a063..8ea314bc 100644 --- a/Editor/Animation/PathMappings.cs +++ b/Editor/Animation/PathMappings.cs @@ -368,6 +368,7 @@ namespace nadena.dev.modular_avatar.animation } Profiler.EndSample(); +#if MA_VRCSDK3_AVATARS var layers = context.AvatarDescriptor.baseAnimationLayers .Concat(context.AvatarDescriptor.specialAnimationLayers); @@ -383,6 +384,7 @@ namespace nadena.dev.modular_avatar.animation ApplyMappingsToAvatarMask(acLayer.avatarMask); } Profiler.EndSample(); +#endif Profiler.EndSample(); } diff --git a/Editor/ApplyAnimatorDefaultValuesPass.cs b/Editor/ApplyAnimatorDefaultValuesPass.cs index 7b3c91ed..0f9cb15e 100644 --- a/Editor/ApplyAnimatorDefaultValuesPass.cs +++ b/Editor/ApplyAnimatorDefaultValuesPass.cs @@ -1,4 +1,5 @@ -#region +#if MA_VRCSDK3_AVATARS +#region using System; using System.Collections.Immutable; @@ -57,4 +58,5 @@ namespace nadena.dev.modular_avatar.core.editor } } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/Editor/Inspector/FirstPersonVisibleEditor.cs b/Editor/Inspector/FirstPersonVisibleEditor.cs index b9646ddb..8f7cedb9 100644 --- a/Editor/Inspector/FirstPersonVisibleEditor.cs +++ b/Editor/Inspector/FirstPersonVisibleEditor.cs @@ -1,4 +1,5 @@ -using UnityEditor; +#if MA_VRCSDK3_AVATARS +using UnityEditor; namespace nadena.dev.modular_avatar.core.editor { @@ -45,3 +46,5 @@ namespace nadena.dev.modular_avatar.core.editor } } } + +#endif \ No newline at end of file diff --git a/Editor/Inspector/Menu/ToggleCreatorShortcut.cs b/Editor/Inspector/Menu/ToggleCreatorShortcut.cs index e549d319..d1027b95 100644 --- a/Editor/Inspector/Menu/ToggleCreatorShortcut.cs +++ b/Editor/Inspector/Menu/ToggleCreatorShortcut.cs @@ -1,4 +1,5 @@ -using nadena.dev.modular_avatar.ui; +#if MA_VRCSDK3_AVATARS +using nadena.dev.modular_avatar.ui; using UnityEditor; using UnityEngine; using VRC.SDK3.Avatars.ScriptableObjects; @@ -62,4 +63,5 @@ namespace nadena.dev.modular_avatar.core.editor Undo.RegisterCreatedObjectUndo(toggle, "Create Toggle"); } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/Editor/PluginDefinition/PluginDefinition.cs b/Editor/PluginDefinition/PluginDefinition.cs index 2d258b23..4a31f17a 100644 --- a/Editor/PluginDefinition/PluginDefinition.cs +++ b/Editor/PluginDefinition/PluginDefinition.cs @@ -57,26 +57,29 @@ namespace nadena.dev.modular_avatar.core.editor.plugin #endif seq.WithRequiredExtension(typeof(AnimationServicesContext), _s2 => { +#if MA_VRCSDK3_AVATARS seq.Run("Shape Changer", ctx => new ReactiveObjectPass(ctx).Execute()) .PreviewingWith(new ShapeChangerPreview(), new ObjectSwitcherPreview(), new MaterialSetterPreview()); -#if MA_VRCSDK3_AVATARS + // TODO: We currently run this above MergeArmaturePlugin, because Merge Armature might destroy // game objects which contain Menu Installers. It'd probably be better however to teach Merge Armature // to retain those objects? maybe? seq.Run(MenuInstallPluginPass.Instance); #endif - + seq.Run(MergeArmaturePluginPass.Instance); seq.Run(BoneProxyPluginPass.Instance); +#if MA_VRCSDK3_AVATARS seq.Run(VisibleHeadAccessoryPluginPass.Instance); +#endif seq.Run("World Fixed Object", ctx => new WorldFixedObjectProcessor().Process(ctx) ); seq.Run(ReplaceObjectPluginPass.Instance); #if MA_VRCSDK3_AVATARS seq.Run(BlendshapeSyncAnimationPluginPass.Instance); -#endif seq.Run(GameObjectDelayDisablePass.Instance); +#endif seq.Run(ConstraintConverterPass.Instance); }); #if MA_VRCSDK3_AVATARS @@ -213,6 +216,7 @@ namespace nadena.dev.modular_avatar.core.editor.plugin } } +#if MA_VRCSDK3_AVATARS class VisibleHeadAccessoryPluginPass : MAPass { protected override void Execute(ndmf.BuildContext context) @@ -220,6 +224,7 @@ namespace nadena.dev.modular_avatar.core.editor.plugin new VisibleHeadAccessoryProcessor(MAContext(context)).Process(); } } +#endif class ReplaceObjectPluginPass : MAPass { diff --git a/Editor/ReactiveObjects/AnimationGeneration/ReactiveObjectAnalyzer.LocateReactions.cs b/Editor/ReactiveObjects/AnimationGeneration/ReactiveObjectAnalyzer.LocateReactions.cs index 179e4ce4..7cc2e403 100644 --- a/Editor/ReactiveObjects/AnimationGeneration/ReactiveObjectAnalyzer.LocateReactions.cs +++ b/Editor/ReactiveObjects/AnimationGeneration/ReactiveObjectAnalyzer.LocateReactions.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +#if MA_VRCSDK3_AVATARS +using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; using nadena.dev.ndmf.preview; @@ -346,4 +347,5 @@ namespace nadena.dev.modular_avatar.core.editor } } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/Editor/ReactiveObjects/AnimationGeneration/ReactiveObjectAnalyzer.cs b/Editor/ReactiveObjects/AnimationGeneration/ReactiveObjectAnalyzer.cs index 9b64dde8..228f215c 100644 --- a/Editor/ReactiveObjects/AnimationGeneration/ReactiveObjectAnalyzer.cs +++ b/Editor/ReactiveObjects/AnimationGeneration/ReactiveObjectAnalyzer.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +#if MA_VRCSDK3_AVATARS +using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; using nadena.dev.modular_avatar.animation; @@ -304,4 +305,5 @@ namespace nadena.dev.modular_avatar.core.editor } } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/Editor/ReactiveObjects/AnimationGeneration/ReactiveObjectPass.cs b/Editor/ReactiveObjects/AnimationGeneration/ReactiveObjectPass.cs index 882f96bf..ae77c80f 100644 --- a/Editor/ReactiveObjects/AnimationGeneration/ReactiveObjectPass.cs +++ b/Editor/ReactiveObjects/AnimationGeneration/ReactiveObjectPass.cs @@ -1,4 +1,5 @@ -#region +#if MA_VRCSDK3_AVATARS +#region using System; using System.Collections.Generic; @@ -613,3 +614,5 @@ namespace nadena.dev.modular_avatar.core.editor } } } + +#endif \ No newline at end of file diff --git a/Editor/ReactiveObjects/AnimationGeneration/ReactiveObjectPrepass.cs b/Editor/ReactiveObjects/AnimationGeneration/ReactiveObjectPrepass.cs index 82c5faa8..cec2bf17 100644 --- a/Editor/ReactiveObjects/AnimationGeneration/ReactiveObjectPrepass.cs +++ b/Editor/ReactiveObjects/AnimationGeneration/ReactiveObjectPrepass.cs @@ -1,4 +1,5 @@ -using nadena.dev.ndmf; +#if MA_VRCSDK3_AVATARS +using nadena.dev.ndmf; using UnityEditor.Animations; using UnityEngine; @@ -53,4 +54,5 @@ namespace nadena.dev.modular_avatar.core.editor } } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/Editor/ReactiveObjects/MaterialSetterPreview.cs b/Editor/ReactiveObjects/MaterialSetterPreview.cs index a181429d..9b1a8e59 100644 --- a/Editor/ReactiveObjects/MaterialSetterPreview.cs +++ b/Editor/ReactiveObjects/MaterialSetterPreview.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +#if MA_VRCSDK3_AVATARS +using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; using System.Threading.Tasks; @@ -144,4 +145,5 @@ namespace nadena.dev.modular_avatar.core.editor } } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/Editor/ReactiveObjects/MenuItemPreviewCondition.cs b/Editor/ReactiveObjects/MenuItemPreviewCondition.cs index 1d8f8629..04ce486a 100644 --- a/Editor/ReactiveObjects/MenuItemPreviewCondition.cs +++ b/Editor/ReactiveObjects/MenuItemPreviewCondition.cs @@ -1,4 +1,5 @@ -using System; +#if MA_VRCSDK3_AVATARS +using System; using System.Collections.Generic; using nadena.dev.ndmf; using nadena.dev.ndmf.preview; @@ -70,4 +71,5 @@ namespace nadena.dev.modular_avatar.core.editor return _context.Observe(mami, _ => mami.isDefault); } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/Editor/ReactiveObjects/ObjectTogglePreview.cs b/Editor/ReactiveObjects/ObjectTogglePreview.cs index 45b4e9fa..3d138ed0 100644 --- a/Editor/ReactiveObjects/ObjectTogglePreview.cs +++ b/Editor/ReactiveObjects/ObjectTogglePreview.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +#if MA_VRCSDK3_AVATARS +using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; using System.Threading.Tasks; @@ -104,4 +105,5 @@ namespace nadena.dev.modular_avatar.core.editor } } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/Editor/ReactiveObjects/ParameterAssignerPass.cs b/Editor/ReactiveObjects/ParameterAssignerPass.cs index 9b891f84..b7afd0bf 100644 --- a/Editor/ReactiveObjects/ParameterAssignerPass.cs +++ b/Editor/ReactiveObjects/ParameterAssignerPass.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +#if MA_VRCSDK3_AVATARS +using System.Collections.Generic; using System.Linq; using nadena.dev.ndmf; using UnityEngine; @@ -236,4 +237,5 @@ namespace nadena.dev.modular_avatar.core.editor }; } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/Editor/ReactiveObjects/ShapeChangerPreview.cs b/Editor/ReactiveObjects/ShapeChangerPreview.cs index 58c09131..d3cde839 100644 --- a/Editor/ReactiveObjects/ShapeChangerPreview.cs +++ b/Editor/ReactiveObjects/ShapeChangerPreview.cs @@ -1,4 +1,5 @@ -#region +#if MA_VRCSDK3_AVATARS +#region using System; using System.Collections.Generic; @@ -294,4 +295,5 @@ namespace nadena.dev.modular_avatar.core.editor } } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/Editor/ReactiveObjects/Simulator/ROSimulator.cs b/Editor/ReactiveObjects/Simulator/ROSimulator.cs index 40b9be8c..4d192515 100644 --- a/Editor/ReactiveObjects/Simulator/ROSimulator.cs +++ b/Editor/ReactiveObjects/Simulator/ROSimulator.cs @@ -1,4 +1,5 @@ -using System; +#if MA_VRCSDK3_AVATARS +using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; @@ -637,4 +638,5 @@ namespace nadena.dev.modular_avatar.core.editor.Simulator ve_inactive.style.display = activeState ? DisplayStyle.None : DisplayStyle.Flex; } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/Editor/ReactiveObjects/Simulator/ROSimulatorButton.cs b/Editor/ReactiveObjects/Simulator/ROSimulatorButton.cs index 285f4c6b..0d1eced6 100644 --- a/Editor/ReactiveObjects/Simulator/ROSimulatorButton.cs +++ b/Editor/ReactiveObjects/Simulator/ROSimulatorButton.cs @@ -1,5 +1,7 @@ using nadena.dev.modular_avatar.core.editor; +#if MA_VRCSDK3_AVATARS using nadena.dev.modular_avatar.core.editor.Simulator; +#endif using UnityEditor; using UnityEngine; using UnityEngine.UIElements; @@ -42,11 +44,13 @@ namespace nadena.dev.modular_avatar.core.editor private void OpenDebugger() { +#if MA_VRCSDK3_AVATARS GameObject target = Selection.activeGameObject; if (ReferenceObject is Component c) target = c.gameObject; else if (ReferenceObject is GameObject go) target = go; ROSimulator.OpenDebugger(target); +#endif } } } \ No newline at end of file diff --git a/Editor/ReactiveObjects/Simulator/StateOverrideController.cs b/Editor/ReactiveObjects/Simulator/StateOverrideController.cs index 74d9c45e..4392f953 100644 --- a/Editor/ReactiveObjects/Simulator/StateOverrideController.cs +++ b/Editor/ReactiveObjects/Simulator/StateOverrideController.cs @@ -1,4 +1,6 @@ -using nadena.dev.modular_avatar.core.editor.Simulator; +#if MA_VRCSDK3_AVATARS +using System; +using nadena.dev.modular_avatar.core.editor.Simulator; using UnityEditor; using UnityEngine.UIElements; @@ -74,4 +76,5 @@ namespace nadena.dev.modular_avatar.core.editor } } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/Editor/VisibleHeadAccessoryProcessor.cs b/Editor/VisibleHeadAccessoryProcessor.cs index b5014d2d..54bbcb1a 100644 --- a/Editor/VisibleHeadAccessoryProcessor.cs +++ b/Editor/VisibleHeadAccessoryProcessor.cs @@ -1,4 +1,5 @@ -#region +#if MA_VRCSDK3_AVATARS +#region using System; using System.Collections.Generic; @@ -251,3 +252,5 @@ namespace nadena.dev.modular_avatar.core.editor } } } + +#endif \ No newline at end of file diff --git a/Runtime/Activator.cs b/Runtime/Activator.cs index 9d45d930..6825177e 100644 --- a/Runtime/Activator.cs +++ b/Runtime/Activator.cs @@ -19,7 +19,7 @@ namespace nadena.dev.modular_avatar.core /// initially inactive in the scene (which can have high overhead if the user has a lot of inactive avatars in the /// scene). /// - [AddComponentMenu("")] + [AddComponentMenu("/")] [ExecuteInEditMode] [DefaultExecutionOrder(-9998)] public class Activator : MonoBehaviour, IEditorOnly @@ -30,7 +30,7 @@ namespace nadena.dev.modular_avatar.core } } - [AddComponentMenu("")] + [AddComponentMenu("/")] [ExecuteInEditMode] [DefaultExecutionOrder(-9997)] public class AvatarActivator : MonoBehaviour, IEditorOnly diff --git a/Runtime/ModularAvatarConvertConstraints.cs b/Runtime/ModularAvatarConvertConstraints.cs index 1440fa25..f4f5ebdd 100644 --- a/Runtime/ModularAvatarConvertConstraints.cs +++ b/Runtime/ModularAvatarConvertConstraints.cs @@ -6,7 +6,7 @@ namespace nadena.dev.modular_avatar.core #if MA_VRCSDK3_AVATARS [AddComponentMenu("Modular Avatar/MA Convert Constraints")] #else - [AddComponentMenu("")] + [AddComponentMenu("/")] #endif [HelpURL("https://modular-avatar.nadena.dev/docs/reference/convert-constraints?lang=auto")] public class ModularAvatarConvertConstraints : AvatarTagComponent