Add AacFlState.PoseSpaceEntered(...), PoseSpaceExited, PoseSpaceEnteredPercent, and PoseSpaceExitedPercent:
- Add AadFlState.PoseSpaceEntered(...) with 0-duration default overload. - Add AadFlState.PoseSpaceExited(...) with 0-duration default overload. - Add AadFlState.PoseSpaceEnteredPercent(...) - Add AadFlState.PoseSpaceExitedPercent(...)
This commit is contained in:
@@ -214,6 +214,7 @@ namespace AnimatorAsCode.V0
|
|||||||
private VRCAvatarParameterDriver _driver;
|
private VRCAvatarParameterDriver _driver;
|
||||||
private VRCAnimatorTrackingControl _tracking;
|
private VRCAnimatorTrackingControl _tracking;
|
||||||
private VRCAnimatorLocomotionControl _locomotionControl;
|
private VRCAnimatorLocomotionControl _locomotionControl;
|
||||||
|
private VRCAnimatorTemporaryPoseSpace _temporaryPoseSpace;
|
||||||
|
|
||||||
public AacFlState(AnimatorState state, AnimatorStateMachine machine, IAacDefaultsProvider defaultsProvider)
|
public AacFlState(AnimatorState state, AnimatorStateMachine machine, IAacDefaultsProvider defaultsProvider)
|
||||||
{
|
{
|
||||||
@@ -528,6 +529,46 @@ namespace AnimatorAsCode.V0
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public AacFlState PoseSpaceEntered(float delaySeconds = 0f)
|
||||||
|
{
|
||||||
|
CreateTemporaryPoseSpaceBehaviorIfNotExists();
|
||||||
|
_temporaryPoseSpace.enterPoseSpace = true;
|
||||||
|
_temporaryPoseSpace.fixedDelay = true;
|
||||||
|
_temporaryPoseSpace.delayTime = delaySeconds;
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AacFlState PoseSpaceExited(float delaySeconds = 0f)
|
||||||
|
{
|
||||||
|
CreateTemporaryPoseSpaceBehaviorIfNotExists();
|
||||||
|
_temporaryPoseSpace.enterPoseSpace = false;
|
||||||
|
_temporaryPoseSpace.fixedDelay = true;
|
||||||
|
_temporaryPoseSpace.delayTime = delaySeconds;
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AacFlState PoseSpaceEnteredPercent(float delayNormalized)
|
||||||
|
{
|
||||||
|
CreateTemporaryPoseSpaceBehaviorIfNotExists();
|
||||||
|
_temporaryPoseSpace.enterPoseSpace = true;
|
||||||
|
_temporaryPoseSpace.fixedDelay = false;
|
||||||
|
_temporaryPoseSpace.delayTime = delayNormalized;
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AacFlState PoseSpaceExitedPercent(float delayNormalized)
|
||||||
|
{
|
||||||
|
CreateTemporaryPoseSpaceBehaviorIfNotExists();
|
||||||
|
_temporaryPoseSpace.enterPoseSpace = false;
|
||||||
|
_temporaryPoseSpace.fixedDelay = false;
|
||||||
|
_temporaryPoseSpace.delayTime = delayNormalized;
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public AacFlState MotionTime(AacFlFloatParameter floatParam)
|
public AacFlState MotionTime(AacFlFloatParameter floatParam)
|
||||||
{
|
{
|
||||||
State.timeParameterActive = true;
|
State.timeParameterActive = true;
|
||||||
@@ -597,13 +638,18 @@ namespace AnimatorAsCode.V0
|
|||||||
_tracking = State.AddStateMachineBehaviour<VRCAnimatorTrackingControl>();
|
_tracking = State.AddStateMachineBehaviour<VRCAnimatorTrackingControl>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void CreateLocomotionBehaviorIfNotExists()
|
private void CreateLocomotionBehaviorIfNotExists()
|
||||||
{
|
{
|
||||||
if (_locomotionControl != null) return;
|
if (_locomotionControl != null) return;
|
||||||
_locomotionControl = State.AddStateMachineBehaviour<VRCAnimatorLocomotionControl>();
|
_locomotionControl = State.AddStateMachineBehaviour<VRCAnimatorLocomotionControl>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void CreateTemporaryPoseSpaceBehaviorIfNotExists()
|
||||||
|
{
|
||||||
|
if (_temporaryPoseSpace != null) return;
|
||||||
|
_temporaryPoseSpace = State.AddStateMachineBehaviour<VRCAnimatorTemporaryPoseSpace>();
|
||||||
|
}
|
||||||
|
|
||||||
public enum TrackingElement
|
public enum TrackingElement
|
||||||
{
|
{
|
||||||
Head,
|
Head,
|
||||||
|
|||||||
@@ -704,11 +704,17 @@ 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 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 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.
|
- `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.
|
- `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.
|
- `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.
|
- `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.
|
- `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.
|
- `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.
|
||||||
|
- `AacFlState PoseSpaceEntered()` /// Use a Temporary Pose Space to change the viewpoint immediately. Create a Temporary Pose Space if it does not exist.
|
||||||
|
- `AacFlState PoseSpaceExited()` /// Use a Temporary Pose Space to reset the viewpoint immediately. Create a Temporary Pose Space if it does not exist.
|
||||||
|
- `AacFlState PoseSpaceEntered(float delaySeconds)` /// Use a Temporary Pose Space to change the viewpoint after a delay. Create a Temporary Pose Space if it does not exist.
|
||||||
|
- `AacFlState PoseSpaceExited(float delaySeconds)` /// Use a Temporary Pose Space to reset the viewpoint after a delay. Create a Temporary Pose Space if it does not exist.
|
||||||
|
- `AacFlState PoseSpaceEnteredPercent(float delayNormalized)` /// Use a Temporary Pose Space to change the viewpoint after a normalized amount of the current state. Create a Temporary Pose Space if it does not exist.
|
||||||
|
- `AacFlState PoseSpaceExitedPercent(float delayNormalized)` /// Use a Temporary Pose Space to reset the viewpoint after a normalized amount of the current state. Create a Temporary Pose Space if it does not exist.
|
||||||
|
|
||||||
# Clip (AacFlClip)
|
# Clip (AacFlClip)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user