diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-07-20 16:42:31 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-07-20 16:42:31 +0400 |
commit | cc69f1301387ea920a225b6eb49283e3c03e1b06 (patch) | |
tree | c37efd91a68d9ff93b8339690340ee11d013066d /source/blender/editors/animation | |
parent | 8bf9a8cb1e18dc784835db5fd869ad14469053a5 (diff) |
2.5 - Constraints Editing + Keyframe Drawing Tweaks
Constraints:
* Adding constraints with targets should now work.
-- (When no target is provided, the code to create a new target is not yet in place again yet)
* Constraints can be added in Object and PoseModes again using the Ctrl-Shift-C hotkey.
* All constraints can now be cleared from the active Object or selected Bones using the Ctrl-Alt-C hotkey.
* Added warnings when adding constraints invalid for the current context, and removed the old add_constraint() function.
* Buttons window updates correctly after adding keyframes now
Keyframes Drawing:
* Removed un-necessary extra function-call for RB-Tree implementation, by inlining a special one-off case.
* Keyframe diamonds which are not within the viewable area are now not drawn (but filtering will still need to find them).
Diffstat (limited to 'source/blender/editors/animation')
-rw-r--r-- | source/blender/editors/animation/keyframes_draw.c | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/source/blender/editors/animation/keyframes_draw.c b/source/blender/editors/animation/keyframes_draw.c index 78ceb4a0149..2107e6e4252 100644 --- a/source/blender/editors/animation/keyframes_draw.c +++ b/source/blender/editors/animation/keyframes_draw.c @@ -445,28 +445,16 @@ static void draw_keylist(View2D *v2d, DLRBT_Tree *keys, DLRBT_Tree *blocks, floa /* draw keys */ if (keys) { for (ak= keys->first; ak; ak= ak->next) { + /* optimisation: if keyframe doesn't appear within 5 units (screenspace) in visible area, don't draw + * - this might give some improvements, since we current have to flip between view/region matrices + */ + if (IN_RANGE_INCL(ak->cfra, v2d->cur.xmin, v2d->cur.xmax) == 0) + continue; + /* draw using OpenGL - uglier but faster */ - // NOTE: a previous version of this didn't work nice for some intel cards + // NOTE1: a previous version of this didn't work nice for some intel cards + // NOTE2: if we wanted to go back to icons, these are icon = (ak->sel & SELECT) ? ICON_SPACE2 : ICON_SPACE3; draw_keyframe_shape(ak->cfra, ypos, xscale, 5.0f, (ak->sel & SELECT), KEYFRAME_SHAPE_BOTH); - -#if 0 // OLD CODE - //int sc_x, sc_y; - - /* get co-ordinate to draw at */ - //gla2DDrawTranslatePt(di, ak->cfra, ypos, &sc_x, &sc_y); - - /* draw using icons - old way which is slower but more proven */ - //if (ak->sel & SELECT) UI_icon_draw_aspect((float)sc_x-7, (float)sc_y-6, ICON_SPACE2, 1.0f); - //else UI_icon_draw_aspect((float)sc_x-7, (float)sc_y-6, ICON_SPACE3, 1.0f); -#endif // OLD CODE -#if 0 // NEW NON-WORKING CODE - /* draw icon */ - // FIXME: this draws slightly wrong, as we need to apply some offset for icon, but that depends on scaling - // so for now disabled - //int icon = (ak->sel & SELECT) ? ICON_SPACE2 : ICON_SPACE3; - //UI_icon_draw_aspect(ak->cfra, ypos-6, icon, 1.0f); -#endif // NEW NON-WORKING CODE - } } |