Fix T59675: Motion path frame numbers at wrong positions
Reviewed By: brecht Differential Revision: https://developer.blender.org/D4113
This commit is contained in:
parent
7c438e5366
commit
07569a333b
Notes:
blender-bot
2023-02-14 08:39:23 +01:00
Referenced by issue #59675, Motion path incorrectly displays the number of frames and key frames.
|
@ -267,15 +267,13 @@ static void MPATH_cache_motion_path(MPATH_PassList *psl,
|
|||
int frame = sfra + i;
|
||||
char numstr[32];
|
||||
size_t numstr_len;
|
||||
float co[3];
|
||||
bool is_keyframe = (mpv->flag & MOTIONPATH_VERT_KEY) != 0;
|
||||
|
||||
if ((show_keyframes && show_kf_no && is_keyframe) ||
|
||||
((avs->path_viewflag & MOTIONPATH_VIEW_FNUMS) && (i == 0)))
|
||||
{
|
||||
numstr_len = sprintf(numstr, " %d", frame);
|
||||
mul_v3_m4v3(co, ob->imat, mpv->co);
|
||||
DRW_text_cache_add(dt, co, numstr, numstr_len, 0, 0, txt_flag, (is_keyframe) ? col_kf : col);
|
||||
DRW_text_cache_add(dt, mpv->co, numstr, numstr_len, 0, 0, txt_flag, (is_keyframe) ? col_kf : col);
|
||||
}
|
||||
else if (avs->path_viewflag & MOTIONPATH_VIEW_FNUMS) {
|
||||
bMotionPathVert *mpvP = (mpv - stepsize);
|
||||
|
@ -283,8 +281,7 @@ static void MPATH_cache_motion_path(MPATH_PassList *psl,
|
|||
/* only draw framenum if several consecutive highlighted points don't occur on same point */
|
||||
if ((equals_v3v3(mpv->co, mpvP->co) == 0) || (equals_v3v3(mpv->co, mpvN->co) == 0)) {
|
||||
numstr_len = sprintf(numstr, " %d", frame);
|
||||
mul_v3_m4v3(co, ob->imat, mpv->co);
|
||||
DRW_text_cache_add(dt, co, numstr, numstr_len, 0, 0, txt_flag, col);
|
||||
DRW_text_cache_add(dt, mpv->co, numstr, numstr_len, 0, 0, txt_flag, col);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue