Fix T71356: Motion Paths no longer update

This commit is contained in:
Sergey Sharybin 2019-11-05 14:31:24 +01:00
parent 63b9f8394f
commit 8dfe2801ac
Notes: blender-bot 2023-09-08 04:55:43 +02:00
Referenced by issue #71356, Motion Paths no longer update.
1 changed files with 11 additions and 9 deletions

View File

@ -236,10 +236,8 @@ static void motionpath_get_global_framerange(ListBase *targets, int *r_sfra, int
static int motionpath_get_prev_keyframe(MPathTarget *mpt, DLRBT_Tree *fcu_keys, int current_frame)
{
/* If the current frame is outside of the configured motion path range we ignore update of this
* motion path by using invalid frame range where start frame is above the end frame. */
if (current_frame <= mpt->mpath->start_frame) {
return INT_MAX;
return mpt->mpath->start_frame;
}
float current_frame_float = current_frame;
@ -262,10 +260,8 @@ static int motionpath_get_prev_prev_keyframe(MPathTarget *mpt,
static int motionpath_get_next_keyframe(MPathTarget *mpt, DLRBT_Tree *fcu_keys, int current_frame)
{
/* If the current frame is outside of the configured motion path range we ignore update of this
* motion path by using invalid frame range where start frame is above the end frame. */
if (current_frame >= mpt->mpath->end_frame) {
return INT_MIN;
return mpt->mpath->end_frame;
}
float current_frame_float = current_frame;
@ -305,6 +301,15 @@ static void motionpath_calculate_update_range(MPathTarget *mpt,
int *r_sfra,
int *r_efra)
{
*r_sfra = INT_MAX;
*r_efra = INT_MIN;
/* If the current frame is outside of the configured motion path range we ignore update of this
* motion path by using invalid frame range where start frame is above the end frame. */
if (current_frame < mpt->mpath->start_frame || current_frame > mpt->mpath->end_frame) {
return;
}
/* Similar to the case when there is only a single keyframe: need to update en entire range to
* a constant value. */
if (!motionpath_check_can_use_keyframe_range(mpt, adt, fcurve_list)) {
@ -313,9 +318,6 @@ static void motionpath_calculate_update_range(MPathTarget *mpt,
return;
}
*r_sfra = INT_MAX;
*r_efra = INT_MIN;
/* NOTE: Iterate over individual f-curves, and check their keyframes individually and pick a
* widest range from them. This is because it's possible to have more narrow keyframe on a
* channel which wasn't edited.