Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-10-19 06:41:09 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-10-19 06:41:09 +0400
commita7734cf3c0cdc09ebc41210fef95cbb42ee92394 (patch)
tree163cbc60d71e9efaa90161a966790fb06c1f139b /source/blender/editors/space_view3d/drawanimviz.c
parent8b0179a965180c325910e1c4127bdc2c53dfbb40 (diff)
bugfix [#24314] Motion path (ghosting/onioning) numbers are displayed with offset
Diffstat (limited to 'source/blender/editors/space_view3d/drawanimviz.c')
-rw-r--r--source/blender/editors/space_view3d/drawanimviz.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/source/blender/editors/space_view3d/drawanimviz.c b/source/blender/editors/space_view3d/drawanimviz.c
index 4cce166b36b..52bb90aa8f0 100644
--- a/source/blender/editors/space_view3d/drawanimviz.c
+++ b/source/blender/editors/space_view3d/drawanimviz.c
@@ -78,7 +78,6 @@ void draw_motion_paths_init(View3D *v3d, ARegion *ar)
* - assumes that the viewport has already been initialised properly
* i.e. draw_motion_paths_init() has been called
*/
-// FIXME: the text is still drawn in the wrong space - it includes the current transforms of the object still...
void draw_motion_path_instance(Scene *scene,
Object *ob, bPoseChannel *pchan, bAnimVizSettings *avs, bMotionPath *mpath)
{
@@ -201,15 +200,20 @@ void draw_motion_path_instance(Scene *scene,
UI_ThemeColor(TH_TEXT_HI);
}
+ // XXX, this isnt up to date but probably should be kept so.
+ invert_m4_m4(ob->imat, ob->obmat);
+
/* Draw frame numbers at each framestep value */
if (avs->path_viewflag & MOTIONPATH_VIEW_FNUMS) {
for (i=0, mpv=mpv_start; i < len; i+=stepsize, mpv+=stepsize) {
char str[32];
+ float co[3];
/* only draw framenum if several consecutive highlighted points don't occur on same point */
if (i == 0) {
sprintf(str, "%d", (i+sfra));
- view3d_cached_text_draw_add(mpv->co[0], mpv->co[1], mpv->co[2], str, 0, 0);
+ mul_v3_m4v3(co, ob->imat, mpv->co);
+ view3d_cached_text_draw_add(co, str, 0, V3D_CACHE_TEXT_WORLDSPACE);
}
else if ((i > stepsize) && (i < len-stepsize)) {
bMotionPathVert *mpvP = (mpv - stepsize);
@@ -217,7 +221,8 @@ void draw_motion_path_instance(Scene *scene,
if ((equals_v3v3(mpv->co, mpvP->co)==0) || (equals_v3v3(mpv->co, mpvN->co)==0)) {
sprintf(str, "%d", (sfra+i));
- view3d_cached_text_draw_add(mpv->co[0], mpv->co[1], mpv->co[2], str, 0, 0);
+ mul_v3_m4v3(co, ob->imat, mpv->co);
+ view3d_cached_text_draw_add(co, str, 0, V3D_CACHE_TEXT_WORLDSPACE);
}
}
}
@@ -266,6 +271,7 @@ void draw_motion_path_instance(Scene *scene,
/* Draw frame numbers of keyframes */
if (avs->path_viewflag & MOTIONPATH_VIEW_KFNOS) {
+ float co[3];
for (i=0, mpv=mpv_start; i < len; i++, mpv++) {
float mframe= (float)(sfra + i);
@@ -273,7 +279,8 @@ void draw_motion_path_instance(Scene *scene,
char str[32];
sprintf(str, "%d", (sfra+i));
- view3d_cached_text_draw_add(mpv->co[0], mpv->co[1], mpv->co[2], str, 0, 0);
+ mul_v3_m4v3(co, ob->imat, mpv->co);
+ view3d_cached_text_draw_add(co, str, 0, V3D_CACHE_TEXT_WORLDSPACE);
}
}
}