diff --git a/Framework/Editor/V0/AacFlStates.cs b/Framework/Editor/V0/AacFlStates.cs index 68a2703..ac0303a 100644 --- a/Framework/Editor/V0/AacFlStates.cs +++ b/Framework/Editor/V0/AacFlStates.cs @@ -508,6 +508,26 @@ namespace AnimatorAsCode.V0 return this; } + public AacFlState PlayableEnables(VRC_PlayableLayerControl.BlendableLayer blendable, float blendDurationSeconds = 0f) + { + return PlayableSets(blendable, blendDurationSeconds, 1.0f); + } + + public AacFlState PlayableDisables(VRC_PlayableLayerControl.BlendableLayer blendable, float blendDurationSeconds = 0f) + { + return PlayableSets(blendable, blendDurationSeconds, 0.0f); + } + + public AacFlState PlayableSets(VRC_PlayableLayerControl.BlendableLayer blendable, float blendDurationSeconds, float weight) + { + var playable = State.AddStateMachineBehaviour(); + playable.layer = blendable; + playable.goalWeight = weight; + playable.blendDuration = blendDurationSeconds; + + return this; + } + public AacFlState MotionTime(AacFlFloatParameter floatParam) { State.timeParameterActive = true; diff --git a/README.md b/README.md index 2d51552..c58da27 100644 --- a/README.md +++ b/README.md @@ -701,6 +701,11 @@ foreach (var cancelWhenNotAllowed in new[] {auto, reverse, manual, custom, done} - `AacFlState TrackingSets(TrackingElement element, VRC_AnimatorTrackingControl.TrackingType trackingType)` /// Use an Animator Tracking Control to set the element to be the value of `trackingType`. Create an Animator Tracking Control state behaviour if it does not exist. - `AacFlState LocomotionEnabled()` /// Enable locomotion. Create an Animator Locomotion Control if it does not exist. - `AacFlState LocomotionDisabled()` /// Disable locomotion. Create an Animator Locomotion Control if it does not exist. +- `public AacFlState PlayableEnables(VRC_PlayableLayerControl.BlendableLayer blendable)` /// Use a Playable Layer Control to set the playable layer weight to 1, enabling it immediately. Create an Playable Layer Control no matter what. +- `public AacFlState PlayableDisables(VRC_PlayableLayerControl.BlendableLayer blendable)` /// Use a Playable Layer Control to set the playable layer weight to 0, disabling it immediately. Create an Playable Layer Control no matter what. +- `public AacFlState PlayableEnables(VRC_PlayableLayerControl.BlendableLayer blendable, float blendDurationSeconds)` /// Use a Playable Layer Control to set the playable layer weight to 1, blending it over a duration, enabling it. Create an Playable Layer Control no matter what. +- `public AacFlState PlayableDisables(VRC_PlayableLayerControl.BlendableLayer blendable, float blendDurationSeconds)` /// Use a Playable Layer Control to set the playable layer weight to 0, blending it over a duration, disabling it. Create an Playable Layer Control no matter what. +- `public AacFlState PlayableSets(VRC_PlayableLayerControl.BlendableLayer blendable, float blendDurationSeconds, float weight)` /// Use a Playable Layer Control to set the playable layer weight to a specified value, blending it over a duration. Create an Playable Layer Control no matter what. # Clip (AacFlClip)