diff options
author | Joshua Leung <aligorith@gmail.com> | 2010-05-20 16:31:55 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2010-05-20 16:31:55 +0400 |
commit | 89b7d4a5d6431d797d85d2ff75912a929797d255 (patch) | |
tree | e6fd00bbc08559163bcfa6914f062e65dc854231 /source/blender/editors/space_view3d/drawanimviz.c | |
parent | 66ef82f31384ca537aacc0f1302e7a16bfed1a66 (diff) |
Motion Path Tweaks:
- #22155: keyframe dots not shown on path for bone keyframes that aren't in a group with a matching name. Since this situation is going to become more common in 2.5, I've added an option which will alternatively just search the entire action to find all F-Curves associated with bones. The old option is still the default though for the general cases.
- When keyframe drawing is enabled, the current frame will also be indicated on the path now as a (bigger) green dot, as requested by William. This makes it easier to see the position on the path on the current frame.
Diffstat (limited to 'source/blender/editors/space_view3d/drawanimviz.c')
-rw-r--r-- | source/blender/editors/space_view3d/drawanimviz.c | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/source/blender/editors/space_view3d/drawanimviz.c b/source/blender/editors/space_view3d/drawanimviz.c index 0a8f19493fa..1bc51de4471 100644 --- a/source/blender/editors/space_view3d/drawanimviz.c +++ b/source/blender/editors/space_view3d/drawanimviz.c @@ -199,6 +199,21 @@ void draw_motion_path_instance(Scene *scene, View3D *v3d, ARegion *ar, glVertex3fv(mpv->co); glEnd(); + /* Draw big green dot where the current frame is */ + // NOTE: only do this when drawing keyframes for now... + if (avs->path_viewflag & MOTIONPATH_VIEW_KFRAS) { + UI_ThemeColor(TH_CFRAME); + glPointSize(6.0f); + + glBegin(GL_POINTS); + mpv = mpv_start + (CFRA - sfra); + glVertex3fv(mpv->co); + glEnd(); + + glPointSize(1.0f); + UI_ThemeColor(TH_TEXT_HI); + } + /* 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) { @@ -220,9 +235,9 @@ void draw_motion_path_instance(Scene *scene, View3D *v3d, ARegion *ar, } } } - + /* Keyframes - dots and numbers */ - if (avs->path_viewflag & MOTIONPATH_VIEW_KFNOS) { + if (avs->path_viewflag & MOTIONPATH_VIEW_KFRAS) { AnimData *adt= BKE_animdata_from_id(&ob->id); DLRBT_Tree keys; @@ -230,8 +245,10 @@ void draw_motion_path_instance(Scene *scene, View3D *v3d, ARegion *ar, BLI_dlrbTree_init(&keys); if (adt) { - /* for now, it is assumed that keyframes for bones are all grouped in a single group */ - if (pchan) { + /* it is assumed that keyframes for bones are all grouped in a single group + * unless an option is set to always use the whole action + */ + if ((pchan) && (avs->path_viewflag & MOTIONPATH_VIEW_KFACT)==0) { bActionGroup *agrp= action_groups_find_named(adt->action, pchan->name); if (agrp) { @@ -261,7 +278,7 @@ void draw_motion_path_instance(Scene *scene, View3D *v3d, ARegion *ar, glPointSize(1.0f); /* Draw frame numbers of keyframes */ - if (avs->path_viewflag & MOTIONPATH_VIEW_FNUMS) { + if (avs->path_viewflag & MOTIONPATH_VIEW_KFNOS) { for (i=0, mpv=mpv_start; i < len; i++, mpv++) { float mframe= (float)(sfra + i); |