Alyria even though it's identical to the setup pose so I don't see how that's preferable to SetToSetupPose()
setToSetupPose
resets everything to the setup pose. This can be a lot more than is necessary, as it's rare (and discouraged) to key everything.
Alyria setting the mixblend back to setup seems to do literally nothing
It needs to be set to add
to get additive blending. You won't get additive blending when you set it to setup
.
setToSetupPose
doesn't use TrackEntry at all. AnimationState uses TrackEntry to keep track of which animations are playing on a track, the times, etc. Changing MixBlend around a call to setToSetupPose
will not affect setToSetupPose
.
should I also be using emptyAnimation tracks
Empty animations are used to mix "in" from the setup pose to an animation, or "out" from an animation to the setup pose. It has nothing to do with additive animations.
Should I have a blanket reset code happening in Process/PhysicsProcess outside the if statement in case the if statement is ignoring the reset to setup?
I'm not sure what "blanket reset code" would be, but setToSetupPose
is not being ignored (and in general it doesn't make sense to think that code will be ignored). I'll explain below.
idk why that would matter since the code is only being executed in a single frame
There's lots of other code getting executed every frame. When the mouse button is pressed you set some animations. Your code for that looks fine (in the first image). Don't set MixBlend to setup
and remove setToSetupPose
. Next your app continues to run. Every frame AnimationState is applied to pose your skeleton with the animations, then Skeleton updateWorldTransform
calculates world bone transforms, then the skeleton's region and mesh attachments are rendered. When the animations are applied, since you have set MixBlend add
, the animation values are added to the skeleton's pose values instead of overwriting the current values. That causes the values to increase every frame.
To fix it, you can call setToSetupPose
, but you need to do this every frame, not just when the mouse button is pressed. Also, you need to do it before animations are applied, otherwise you will lose the pose from the animations.
Alternatively, add your "reset" animation on eg track 3 (assuming you use tracks 0, 1 and 2 for other, non-additive animations), then put your additive animations on higher tracks, like tracks 4 and 5.