Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/intern/draw_anim_viz.c
| Show First 20 Lines • Show All 261 Lines • ▼ Show 20 Lines | if ((avs->path_viewflag & (MOTIONPATH_VIEW_FNUMS)) || (show_kf_no && show_keyframes)) { | ||||
| UI_GetThemeColor3ubv(TH_TEXT_HI, col); | UI_GetThemeColor3ubv(TH_TEXT_HI, col); | ||||
| UI_GetThemeColor3ubv(TH_VERTEX_SELECT, col_kf); | UI_GetThemeColor3ubv(TH_VERTEX_SELECT, col_kf); | ||||
| col[3] = col_kf[3] = 255; | col[3] = col_kf[3] = 255; | ||||
| for (i = 0, mpv = mpv_start; i < len; i += stepsize, mpv += stepsize) { | for (i = 0, mpv = mpv_start; i < len; i += stepsize, mpv += stepsize) { | ||||
| int frame = sfra + i; | int frame = sfra + i; | ||||
| char numstr[32]; | char numstr[32]; | ||||
| size_t numstr_len; | size_t numstr_len; | ||||
| float co[3]; | |||||
| bool is_keyframe = (mpv->flag & MOTIONPATH_VERT_KEY) != 0; | bool is_keyframe = (mpv->flag & MOTIONPATH_VERT_KEY) != 0; | ||||
| if ((show_keyframes && show_kf_no && is_keyframe) || | if ((show_keyframes && show_kf_no && is_keyframe) || | ||||
| ((avs->path_viewflag & MOTIONPATH_VIEW_FNUMS) && (i == 0))) | ((avs->path_viewflag & MOTIONPATH_VIEW_FNUMS) && (i == 0))) | ||||
| { | { | ||||
| numstr_len = sprintf(numstr, " %d", frame); | numstr_len = sprintf(numstr, " %d", frame); | ||||
| mul_v3_m4v3(co, ob->imat, mpv->co); | DRW_text_cache_add(dt, mpv->co, numstr, numstr_len, 0, 0, txt_flag, (is_keyframe) ? col_kf : col); | ||||
| DRW_text_cache_add(dt, co, numstr, numstr_len, 0, 0, txt_flag, (is_keyframe) ? col_kf : col); | |||||
| } | } | ||||
| else if (avs->path_viewflag & MOTIONPATH_VIEW_FNUMS) { | else if (avs->path_viewflag & MOTIONPATH_VIEW_FNUMS) { | ||||
| bMotionPathVert *mpvP = (mpv - stepsize); | bMotionPathVert *mpvP = (mpv - stepsize); | ||||
| bMotionPathVert *mpvN = (mpv + stepsize); | bMotionPathVert *mpvN = (mpv + stepsize); | ||||
| /* only draw framenum if several consecutive highlighted points don't occur on same point */ | /* 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)) { | if ((equals_v3v3(mpv->co, mpvP->co) == 0) || (equals_v3v3(mpv->co, mpvN->co) == 0)) { | ||||
| numstr_len = sprintf(numstr, " %d", frame); | numstr_len = sprintf(numstr, " %d", frame); | ||||
| mul_v3_m4v3(co, ob->imat, mpv->co); | DRW_text_cache_add(dt, mpv->co, numstr, numstr_len, 0, 0, txt_flag, col); | ||||
| DRW_text_cache_add(dt, co, numstr, numstr_len, 0, 0, txt_flag, col); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* Add geometry to shading groups. Execute for each objects */ | /* Add geometry to shading groups. Execute for each objects */ | ||||
| static void MPATH_cache_populate(void *vedata, Object *ob) | static void MPATH_cache_populate(void *vedata, Object *ob) | ||||
| ▲ Show 20 Lines • Show All 64 Lines • Show Last 20 Lines | |||||