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:
authorJoshua Leung <aligorith@gmail.com>2014-05-04 19:32:23 +0400
committerJoshua Leung <aligorith@gmail.com>2014-05-05 06:16:38 +0400
commitda6b1ca27dff4e9b85506417a557cded85ef39ed (patch)
tree0b0caa4c109b0e89adf9c9fdcfecb6f24d28da34 /source/blender/editors/space_nla
parentb2784d33ce6a6ae20344afa469b1425bdde9f90e (diff)
NLA Editor: Second part of porting NLA Action channel to standard drawing system
This now works (barring one or two minor glitches and the operator on the pushdown button being a bit of a hack). The old drawing code is still in place though, and will be kept around for a little while yet while the last kinks are ironed out.
Diffstat (limited to 'source/blender/editors/space_nla')
-rw-r--r--source/blender/editors/space_nla/nla_draw.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c
index 6a943f45ac2..a6f5cf1f5c5 100644
--- a/source/blender/editors/space_nla/nla_draw.c
+++ b/source/blender/editors/space_nla/nla_draw.c
@@ -646,6 +646,7 @@ static void draw_nla_channel_list_gl(bAnimContext *ac, ListBase *anim_data, View
/* determine what needs to be drawn */
switch (ale->type) {
+#if 0
case ANIMTYPE_NLAACTION: /* NLA Action-Line */
{
bAction *act = (bAction *)ale->data;
@@ -664,6 +665,7 @@ static void draw_nla_channel_list_gl(bAnimContext *ac, ListBase *anim_data, View
do_draw = true;
break;
}
+#endif
default: /* handled by standard channel-drawing API */
/* (draw backdrops only...) */
ANIM_channel_draw(ac, ale, yminc, ymaxc);
@@ -841,10 +843,24 @@ void draw_nla_channel_list(bContext *C, bAnimContext *ac, ARegion *ar)
UI_view2d_sync(NULL, ac->sa, v2d, V2D_LOCK_COPY);
/* draw channels */
- { /* first pass: backdrops + oldstyle drawing */
+ { /* first pass: just the standard GL-drawing for backdrop + text */
y = (float)(-NLACHANNEL_HEIGHT(snla));
- draw_nla_channel_list_gl(ac, &anim_data, v2d, y);
+ for (ale = anim_data.first; ale; ale = ale->next) {
+ float yminc = (float)(y - NLACHANNEL_HEIGHT_HALF(snla));
+ float ymaxc = (float)(y + NLACHANNEL_HEIGHT_HALF(snla));
+
+ /* check if visible */
+ if (IN_RANGE(yminc, v2d->cur.ymin, v2d->cur.ymax) ||
+ IN_RANGE(ymaxc, v2d->cur.ymin, v2d->cur.ymax) )
+ {
+ /* draw all channels using standard channel-drawing API */
+ ANIM_channel_draw(ac, ale, yminc, ymaxc);
+ }
+
+ /* adjust y-position for next one */
+ y -= NLACHANNEL_STEP(snla);
+ }
}
{ /* second pass: UI widgets */
uiBlock *block = uiBeginBlock(C, ar, __func__, UI_EMBOSS);