Skip to content

Commit

Permalink
[c][cpp] Port: Fixed mixing out inherit timelines to the setup pose. …
Browse files Browse the repository at this point in the history
…See #2590
  • Loading branch information
badlogic committed Aug 19, 2024
1 parent 85a4f71 commit e0796bf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions spine-c/spine-c/src/spine/Animation.c
Original file line number Diff line number Diff line change
Expand Up @@ -2163,6 +2163,11 @@ void _spInheritTimeline_apply(spTimeline *timeline, spSkeleton *skeleton, float
float *frames = self->super.frames->items;
if (!bone->active) return;

if (direction == SP_MIX_DIRECTION_OUT) {
if (blend == SP_MIX_BLEND_SETUP) bone->inherit = bone->data->inherit;
return;
}

if (time < frames[0]) {
if (blend == SP_MIX_BLEND_SETUP || blend == SP_MIX_BLEND_FIRST) bone->inherit = bone->data->inherit;
return;
Expand Down
5 changes: 5 additions & 0 deletions spine-cpp/spine-cpp/src/spine/InheritTimeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ void InheritTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vect
Bone *bone = skeleton.getBones()[_boneIndex];
if (!bone->isActive()) return;

if (direction == MixDirection_Out) {
if (blend == MixBlend_Setup) bone->setInherit(bone->_data.getInherit());
return;
}

if (time < _frames[0]) {
if (blend == MixBlend_Setup || blend == MixBlend_First) bone->_inherit = bone->_data.getInherit();
return;
Expand Down

0 comments on commit e0796bf

Please sign in to comment.