Browse Source

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

Mario Zechner 1 year ago
parent
commit
e0796bf543

+ 5 - 0
spine-c/spine-c/src/spine/Animation.c

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

+ 5 - 0
spine-cpp/spine-cpp/src/spine/InheritTimeline.cpp

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