next part of bone setters #3312
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SetAnimationLayerAnimation - works just like SetAnimation, except it takes a layer and returns a layer (the layer that's passed in is what animation it should be interpolating from when setting the animation, it is allowed to be null), does not change the layer that's passed in
SetAnimationLayerFrameRate - returns a layer with the framerate modidified, does not change the layer that's passed in
CalculateAnimation - turns the animation data into a fully interpolated list of bone positions/translations/scaling, does not change the layer that's passed in
BlendAnimationFrames - interpolates between two frames, does not change the frames passed in
OffsetAnimationFrame - adds a frame as an offset to another frame, does not change the frames passed in
SetBones - does SetBoneRotation/Translation/Scaling for a whole frame
SetBonesRange - does it for a range of bones in a frame, SetBonesMask does it based on the passed in mask - if the index in the mask is true, the bone is set, if it's false, it is skipped
OverwriteBones - overwrites the set bones entirely, used for fully procedural per-frame animations
AnimateBones - is called every frame for models with decoupled anims enabled, you can set up per-frame animations here
CalculateAnimationFrame - lets you calculate an InterpolatedFrame into a PrecalculatedAnimationFrame
FindAnimationFrame/FindAnimationFrameUI/FindAnimationFrameAt - gets the state of an animation at the current (FindAnimationFrame/FindAnimationFrameUI) or at any arbitrary tic (FindAnimationFrameAt)
returns AnimationFrame frame1, InterpolatedFrame frame2, double inter
frame1 is the frame to interpolate from, it may be either a PrecalculatedAnimationFrame or a InterpolatedFrame, if inter is -1, frame1 will be null, and frame2 should be used in full instead
frame2 is the frame to interpolate to, always an InterpolatedFrame
inter is the ratio between frame1 and frame2, if the animation isn't interpolating, it will be 1 and frame 1 will be null
frame1/2 will both be null if an invalid tic or layer are passed
NOTE: for FindAnimationFrameAt, tic should be Level.totaltime + fractic (in the playsim, fractic should be 1, not 0)
NOTE: while interpolating, an animation may need to perform up to 4-way blending if both frame1 and frame2 are InterpolatedFrame