[c][cpp] Port: Fixed mixing out inherit timelines to the setup pose. See #2590

This commit is contained in:
Mario Zechner 2024-08-19 11:14:37 +02:00
parent 85a4f71162
commit e0796bf543
2 changed files with 10 additions and 0 deletions

View File

@ -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;

View File

@ -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;