Example #1
0
 public LayerForBooleansToVirtualActivity(AnimatorGenerator animatorGenerator, AvatarMask logicalAvatarMask, bool writeDefaults, List <GestureComboStageMapper> comboLayers)
 {
     _animatorGenerator             = animatorGenerator;
     _logicalAvatarMask             = logicalAvatarMask;
     _writeDefaultsForLogicalStates = writeDefaults;
     _comboLayers = comboLayers;
 }
Example #2
0
 public Just1Int7TogglesCompilerInternal(RuntimeAnimatorController animatorController,
                                         AnimationClip customEmptyClip, TogglesManifest manifest)
 {
     _emptyClipProvider = new StatefulEmptyClipProvider(new ClipGenerator(customEmptyClip, EmptyClipPath, PluginFolderName));
     _animatorGenerator = new AnimatorGenerator((AnimatorController)animatorController, _emptyClipProvider);
     _viewCreator       = new ViewCreator(_animatorGenerator, manifest);
 }
 public LayerForAnalogFistSmoothing(AnimatorGenerator animatorGenerator, AvatarMask weightCorrectionAvatarMask, bool writeDefaults, AnimatorController animatorController)
 {
     _animatorGenerator          = animatorGenerator;
     _weightCorrectionAvatarMask = weightCorrectionAvatarMask;
     _animatorController         = animatorController;
     _writeDefaultsForAnimatedAnimatorParameterStates = writeDefaults;
 }
Example #4
0
        public Animation(YAML.Animation deserialized, string base_dir)
        {
            _DeserializedYAMLDoc = deserialized;

            _Generator  = new AnimatorGenerator(base_dir, _DeserializedYAMLDoc);
            _Collection = _Generator.Collection;
            _Clips      = _Generator.ConstructClips(_Collection.CollectionData);
        }
Example #5
0
 public LayerForBlinkingOverrideView(string activityStageName, List <GestureComboStageMapper> comboLayers, float analogBlinkingUpperThreshold, AvatarMask logicalAvatarMask, AnimatorGenerator animatorGenerator, AnimationClip emptyClip, List <ManifestBinding> manifestBindings, bool writeDefaults)
 {
     _activityStageName            = activityStageName;
     _comboLayers                  = comboLayers;
     _analogBlinkingUpperThreshold = analogBlinkingUpperThreshold;
     _logicalAvatarMask            = logicalAvatarMask;
     _animatorGenerator            = animatorGenerator;
     _emptyClip        = emptyClip;
     _manifestBindings = manifestBindings;
     _writeDefaultsForLogicalStates = writeDefaults;
 }
Example #6
0
        public Animation(ModLoader.ModInfo info, YAML.Animation deserialized, string base_dir = null)
        {
            _ModInfo             = info;
            _DeserializedYAMLDoc = deserialized;
            if (base_dir == null)
            {
                base_dir = info.Resources.BaseDir;
            }

            _Generator  = new AnimatorGenerator(_ModInfo, base_dir, _DeserializedYAMLDoc);
            _Collection = _Generator.Collection;
            _Clips      = _Generator.ConstructClips(_Collection.CollectionData);
        }
Example #7
0
        public void IntegrateWeightCorrection()
        {
            _animatorGenerator = new AnimatorGenerator(_animatorController, new StatefulEmptyClipProvider(new ClipGenerator(_customEmptyClip, EmptyClipPath, "ComboGesture")));

            var avatarMaskPath = AssetDatabase.LoadAssetAtPath <AvatarMask>(GesturePlayableLayerAvatarMaskPath);

            CreateOrReplaceWeightCorrection(
                avatarMaskPath,
                _animatorGenerator,
                _animatorController,
                _conflictPrevention
                );
            CreateOrReplaceSmoothing(avatarMaskPath, _animatorGenerator, _animatorController, _conflictPrevention);

            ReapAnimator(_animatorController);

            AssetDatabase.Refresh();
            EditorUtility.ClearProgressBar();
        }
 public LayerForLipsyncOverrideView(float analogBlinkingUpperThreshold,
                                    AvatarMask logicalAvatarMask,
                                    AnimatorGenerator animatorGenerator,
                                    VRCAvatarDescriptor avatarDescriptor,
                                    ComboGestureLimitedLipsync limitedLipsync,
                                    AssetContainer assetContainer,
                                    AnimationClip emptyClip,
                                    List <ManifestBinding> manifestBindings,
                                    bool writeDefaults)
 {
     _analogBlinkingUpperThreshold = analogBlinkingUpperThreshold;
     _logicalAvatarMask            = logicalAvatarMask;
     _animatorGenerator            = animatorGenerator;
     _avatarDescriptor             = avatarDescriptor;
     _limitedLipsync   = limitedLipsync;
     _assetContainer   = assetContainer;
     _emptyClip        = emptyClip;
     _manifestBindings = manifestBindings;
     _writeDefaultsForLipsyncBlendshapes = writeDefaults;
 }
Example #9
0
        public void DoOverwriteAnimatorGesturePlayableLayer()
        {
            _animatorGenerator = new AnimatorGenerator(_gesturePlayableLayerController, new StatefulEmptyClipProvider(new ClipGenerator(_customEmptyClip, EmptyClipPath, "ComboGesture")));
            var emptyClip = GetOrCreateEmptyClip();

            if (_activityStageName != null)
            {
                SharedLayerUtils.CreateParamIfNotExists(_gesturePlayableLayerController, _activityStageName, AnimatorControllerParameterType.Int);
            }

            if (!Feature(FeatureToggles.DoNotGenerateWeightCorrectionLayer))
            {
                if (_useGestureWeightCorrection)
                {
                    CreateOrReplaceWeightCorrection(_gesturePlayableLayerTechnicalAvatarMask, _animatorGenerator, _gesturePlayableLayerController, _conflictPreventionTempGestureLayer);
                    if (_useSmoothing)
                    {
                        CreateOrReplaceSmoothing(_weightCorrectionAvatarMask, _animatorGenerator, _gesturePlayableLayerController, _conflictPreventionTempGestureLayer);
                    }
                    else
                    {
                        DeleteSmoothing();
                    }
                }
                else
                {
                    DeleteWeightCorrection();
                    DeleteSmoothing();
                }
            }

            var manifestBindings = CreateManifestBindings(emptyClip);

            CreateOrReplaceGesturePlayableLayerExpressionsView(emptyClip, manifestBindings);

            ReapAnimator(_gesturePlayableLayerController);

            AssetDatabase.Refresh();
            EditorUtility.ClearProgressBar();
        }
 public LayerForExpressionsView(FeatureToggles featuresToggles,
                                AnimatorGenerator animatorGenerator,
                                AvatarMask expressionsAvatarMask,
                                AnimationClip emptyClip,
                                string activityStageName,
                                ConflictPrevention conflictPrevention,
                                AssetContainer assetContainer,
                                ConflictFxLayerMode compilerConflictFxLayerMode,
                                AnimationClip compilerIgnoreParamList,
                                AnimationClip compilerFallbackParamList,
                                List <CurveKey> blinkBlendshapes,
                                AnimatorController animatorController,
                                List <GestureComboStageMapper> comboLayers,
                                bool useGestureWeightCorrection,
                                bool useSmoothing,
                                List <ManifestBinding> manifestBindings,
                                string animInfix)
 {
     _featuresToggles             = featuresToggles;
     _animatorGenerator           = animatorGenerator;
     _expressionsAvatarMask       = expressionsAvatarMask;
     _emptyClip                   = emptyClip;
     _activityStageName           = activityStageName;
     _conflictPrevention          = conflictPrevention;
     _assetContainer              = assetContainer;
     _compilerConflictFxLayerMode = compilerConflictFxLayerMode;
     _compilerIgnoreParamList     = compilerIgnoreParamList;
     _compilerFallbackParamList   = compilerFallbackParamList;
     _blinkBlendshapes            = blinkBlendshapes;
     _animatorController          = animatorController;
     _comboLayers                 = comboLayers;
     _useGestureWeightCorrection  = useGestureWeightCorrection;
     _useSmoothing                = useSmoothing;
     _manifestBindings            = manifestBindings;
     _animInfix                   = animInfix;
 }
Example #11
0
 private static void CreateOrReplaceSmoothing(AvatarMask weightCorrectionAvatarMask, AnimatorGenerator animatorGenerator, AnimatorController animatorController, ConflictPrevention conflictPrevention)
 {
     SharedLayerUtils.CreateParamIfNotExists(animatorController, SharedLayerUtils.HaiGestureComboLeftWeightSmoothing, AnimatorControllerParameterType.Float);
     SharedLayerUtils.CreateParamIfNotExists(animatorController, SharedLayerUtils.HaiGestureComboRightWeightSmoothing, AnimatorControllerParameterType.Float);
     SharedLayerUtils.CreateParamIfNotExists(animatorController, SharedLayerUtils.HaiGestureComboSmoothingFactor, AnimatorControllerParameterType.Float);
     new LayerForAnalogFistSmoothing(animatorGenerator, weightCorrectionAvatarMask, conflictPrevention.ShouldWriteDefaults, animatorController).Create();
 }
Example #12
0
        public void DoOverwriteAnimatorFxLayer()
        {
            _animatorGenerator = new AnimatorGenerator(_animatorController, new StatefulEmptyClipProvider(new ClipGenerator(_customEmptyClip, EmptyClipPath, "ComboGesture")));
            var emptyClip = GetOrCreateEmptyClip();

            if (_activityStageName != null)
            {
                SharedLayerUtils.CreateParamIfNotExists(_animatorController, _activityStageName, AnimatorControllerParameterType.Int);
            }

            DeleteDeprecatedControllerLayer();

            if (_parameterGeneration == ParameterGeneration.VirtualActivity)
            {
                CreateOrReplaceBooleansToVirtualActivityMenu();
            }
            else
            {
                DeleteBooleansToVirtualActivityMenu();
            }

            if (!Feature(FeatureToggles.DoNotGenerateWeightCorrectionLayer))
            {
                if (_useGestureWeightCorrection)
                {
                    CreateOrReplaceWeightCorrection(_weightCorrectionAvatarMask, _animatorGenerator, _animatorController, _conflictPrevention);
                    if (_useSmoothing)
                    {
                        CreateOrReplaceSmoothing(_weightCorrectionAvatarMask, _animatorGenerator, _animatorController, _conflictPrevention);
                    }
                    else
                    {
                        DeleteSmoothing();
                    }
                }
                else
                {
                    DeleteWeightCorrection();
                    DeleteSmoothing();
                }
            }

            var manifestBindings = CreateManifestBindings(emptyClip);

            CreateOrReplaceExpressionsView(emptyClip, manifestBindings);

            if (!Feature(FeatureToggles.DoNotGenerateBlinkingOverrideLayer))
            {
                CreateOrReplaceBlinkingOverrideView(emptyClip, manifestBindings);
            }

            if (!Feature(FeatureToggles.DoNotGenerateLipsyncOverrideLayer))
            {
                if (_integrateLimitedLipsync && _avatarDescriptor != null && _avatarDescriptor.VisemeSkinnedMesh != null)
                {
                    CreateOrReplaceLipsyncOverrideView(emptyClip, manifestBindings);
                }
                else
                {
                    DeleteLipsyncOverrideView();
                }
            }

            ReapAnimator(_animatorController);

            AssetDatabase.Refresh();
            EditorUtility.ClearProgressBar();
        }
Example #13
0
 public static void Delete(AnimatorGenerator animatorGenerator)
 {
     animatorGenerator.RemoveLayerIfExists(ControllerLayerName);
 }
Example #14
0
 public static void Delete(AnimatorGenerator animatorGenerator)
 {
     animatorGenerator.RemoveLayerIfExists(VirtualActivityLayerName);
 }
Example #15
0
 public static void Delete(AnimatorGenerator animatorGenerator)
 {
     animatorGenerator.RemoveLayerIfExists(WeightCorrectionLeftLayerName);
     animatorGenerator.RemoveLayerIfExists(WeightCorrectionRightLayerName);
 }
 public static void Delete(AnimatorGenerator animatorGenerator)
 {
     animatorGenerator.RemoveLayerIfExists(SmoothingLeftLayerName);
     animatorGenerator.RemoveLayerIfExists(SmoothingRightLayerName);
 }
Example #17
0
 private static void CreateOrReplaceWeightCorrection(AvatarMask weightCorrectionAvatarMask, AnimatorGenerator animatorGenerator, AnimatorController animatorController, ConflictPrevention conflictPrevention)
 {
     SharedLayerUtils.CreateParamIfNotExists(animatorController, "GestureLeft", AnimatorControllerParameterType.Int);
     SharedLayerUtils.CreateParamIfNotExists(animatorController, "GestureRight", AnimatorControllerParameterType.Int);
     SharedLayerUtils.CreateParamIfNotExists(animatorController, "GestureLeftWeight", AnimatorControllerParameterType.Float);
     SharedLayerUtils.CreateParamIfNotExists(animatorController, "GestureRightWeight", AnimatorControllerParameterType.Float);
     SharedLayerUtils.CreateParamIfNotExists(animatorController, SharedLayerUtils.HaiGestureComboLeftWeightProxy, AnimatorControllerParameterType.Float);
     SharedLayerUtils.CreateParamIfNotExists(animatorController, SharedLayerUtils.HaiGestureComboRightWeightProxy, AnimatorControllerParameterType.Float);
     new LayerForWeightCorrection(animatorGenerator, weightCorrectionAvatarMask, conflictPrevention.ShouldWriteDefaults).Create();
 }
 public static void Delete(AnimatorGenerator animatorGenerator)
 {
     animatorGenerator.RemoveLayerIfExists(LipsyncLayerName);
 }
Example #19
0
 public LayerForWeightCorrection(AnimatorGenerator animatorGenerator, AvatarMask weightCorrectionAvatarMask, bool writeDefaults)
 {
     _animatorGenerator          = animatorGenerator;
     _weightCorrectionAvatarMask = weightCorrectionAvatarMask;
     _writeDefaultsForAnimatedAnimatorParameterStates = writeDefaults;
 }
Example #20
0
 internal ViewCreator(AnimatorGenerator animatorGenerator, TogglesManifest manifest)
 {
     _animatorGenerator = animatorGenerator;
     _manifest          = manifest;
 }