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>2009-06-11 09:02:46 +0400
committerJoshua Leung <aligorith@gmail.com>2009-06-11 09:02:46 +0400
commit0bef8012bc71b1a1d3fae4f5ef82055045ef4752 (patch)
tree9e6b9be66a206d7812524b89f758768e51ee49e3 /source/blender/editors/space_nla/nla_draw.c
parentf0f9034966be8692250686aee74048294960aad3 (diff)
NLA SoC: Channel ordering change
In response to user-feedback, I've changed the order in which channels appear. Now, the channel ordering is: - Object/AnimData block -- Active Action -- Last NLA Track .. .. -- First NLA Track It is important to note several things still: 1) Active action is applied AFTER the NLA Tracks have been evaluated, not before 2) In this new order, the tracks+active action are shown in the evaluation-stack order, i.e. first thing applied is at the bottom, last is at the top. As a result, I've switched the view-orientation back so that it works the same way as for DopeSheet/Graph editors (i.e. expands downwards not upwards). This may cause problems loading files saved with older builds of this branch. There are still some lingering problems due to this change which I'll fix in due course.
Diffstat (limited to 'source/blender/editors/space_nla/nla_draw.c')
-rw-r--r--source/blender/editors/space_nla/nla_draw.c46
1 files changed, 21 insertions, 25 deletions
diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c
index 4fa27f4bc11..8d417a150aa 100644
--- a/source/blender/editors/space_nla/nla_draw.c
+++ b/source/blender/editors/space_nla/nla_draw.c
@@ -250,15 +250,13 @@ void draw_nla_main_data (bAnimContext *ac, SpaceNla *snla, ARegion *ar)
* start of list offset, and the second is as a correction for the scrollers.
*/
height= ((items*NLACHANNEL_STEP) + (NLACHANNEL_HEIGHT*2));
- if (height > (v2d->mask.ymax - v2d->mask.ymin)) {
- /* don't use totrect set, as the width stays the same
- * (NOTE: this is ok here, the configuration is pretty straightforward)
- */
- v2d->tot.ymax= (float)(height);
- }
+ /* don't use totrect set, as the width stays the same
+ * (NOTE: this is ok here, the configuration is pretty straightforward)
+ */
+ v2d->tot.ymin= (float)(-height);
/* loop through channels, and set up drawing depending on their type */
- y= (float)(-NLACHANNEL_FIRST);
+ y= (float)(-NLACHANNEL_HEIGHT);
for (ale= anim_data.first; ale; ale= ale->next) {
const float yminc= (float)(y - NLACHANNEL_HEIGHT_HALF);
@@ -330,7 +328,7 @@ void draw_nla_main_data (bAnimContext *ac, SpaceNla *snla, ARegion *ar)
}
/* adjust y-position for next one */
- y += NLACHANNEL_STEP;
+ y -= NLACHANNEL_STEP;
}
/* free tempolary channels */
@@ -361,15 +359,13 @@ void draw_nla_channel_list (bAnimContext *ac, SpaceNla *snla, ARegion *ar)
* start of list offset, and the second is as a correction for the scrollers.
*/
height= ((items*NLACHANNEL_STEP) + (NLACHANNEL_HEIGHT*2));
- if (height > (v2d->mask.ymax - v2d->mask.ymin)) {
- /* don't use totrect set, as the width stays the same
- * (NOTE: this is ok here, the configuration is pretty straightforward)
- */
- v2d->tot.ymax= (float)(height);
- }
+ /* don't use totrect set, as the width stays the same
+ * (NOTE: this is ok here, the configuration is pretty straightforward)
+ */
+ v2d->tot.ymin= (float)(-height);
/* loop through channels, and set up drawing depending on their type */
- y= (float)(-NLACHANNEL_FIRST);
+ y= (float)(-NLACHANNEL_HEIGHT);
for (ale= anim_data.first; ale; ale= ale->next) {
const float yminc= (float)(y - NLACHANNEL_HEIGHT_HALF);
@@ -397,7 +393,7 @@ void draw_nla_channel_list (bAnimContext *ac, SpaceNla *snla, ARegion *ar)
/* only show expand if there are any channels */
if (EXPANDED_SCEC(sce))
- expand= ICON_TRIA_UP;
+ expand= ICON_TRIA_DOWN;
else
expand= ICON_TRIA_RIGHT;
@@ -421,7 +417,7 @@ void draw_nla_channel_list (bAnimContext *ac, SpaceNla *snla, ARegion *ar)
/* only show expand if there are any channels */
if (EXPANDED_OBJC(ob))
- expand= ICON_TRIA_UP;
+ expand= ICON_TRIA_DOWN;
else
expand= ICON_TRIA_RIGHT;
@@ -438,7 +434,7 @@ void draw_nla_channel_list (bAnimContext *ac, SpaceNla *snla, ARegion *ar)
special = ICON_MATERIAL_DATA;
if (FILTER_MAT_OBJC(ob))
- expand = ICON_TRIA_UP;
+ expand = ICON_TRIA_DOWN;
else
expand = ICON_TRIA_RIGHT;
@@ -457,7 +453,7 @@ void draw_nla_channel_list (bAnimContext *ac, SpaceNla *snla, ARegion *ar)
offset = 21;
if (FILTER_MAT_OBJD(ma))
- expand = ICON_TRIA_UP;
+ expand = ICON_TRIA_DOWN;
else
expand = ICON_TRIA_RIGHT;
@@ -473,7 +469,7 @@ void draw_nla_channel_list (bAnimContext *ac, SpaceNla *snla, ARegion *ar)
special = ICON_LAMP_DATA;
if (FILTER_LAM_OBJD(la))
- expand = ICON_TRIA_UP;
+ expand = ICON_TRIA_DOWN;
else
expand = ICON_TRIA_RIGHT;
@@ -489,7 +485,7 @@ void draw_nla_channel_list (bAnimContext *ac, SpaceNla *snla, ARegion *ar)
special = ICON_CAMERA_DATA;
if (FILTER_CAM_OBJD(ca))
- expand = ICON_TRIA_UP;
+ expand = ICON_TRIA_DOWN;
else
expand = ICON_TRIA_RIGHT;
@@ -505,7 +501,7 @@ void draw_nla_channel_list (bAnimContext *ac, SpaceNla *snla, ARegion *ar)
special = ICON_CURVE_DATA;
if (FILTER_CUR_OBJD(cu))
- expand = ICON_TRIA_UP;
+ expand = ICON_TRIA_DOWN;
else
expand = ICON_TRIA_RIGHT;
@@ -521,7 +517,7 @@ void draw_nla_channel_list (bAnimContext *ac, SpaceNla *snla, ARegion *ar)
special = ICON_SHAPEKEY_DATA; // XXX
if (FILTER_SKE_OBJD(key))
- expand = ICON_TRIA_UP;
+ expand = ICON_TRIA_DOWN;
else
expand = ICON_TRIA_RIGHT;
@@ -629,7 +625,7 @@ void draw_nla_channel_list (bAnimContext *ac, SpaceNla *snla, ARegion *ar)
if (ELEM(ale->type, ANIMTYPE_SCENE, ANIMTYPE_OBJECT)) {
/* object channel - darker */
UI_ThemeColor(TH_DOPESHEET_CHANNELOB);
- uiSetRoundBox((expand == ICON_TRIA_UP)? (8):(1|8));
+ uiSetRoundBox((expand == ICON_TRIA_DOWN)? (8):(1|8));
gl_round_box(GL_POLYGON, x+offset, yminc, (float)NLACHANNEL_NAMEWIDTH, ymaxc, 10);
}
else {
@@ -763,7 +759,7 @@ void draw_nla_channel_list (bAnimContext *ac, SpaceNla *snla, ARegion *ar)
}
/* adjust y-position for next one */
- y += NLACHANNEL_STEP;
+ y -= NLACHANNEL_STEP;
}
/* free tempolary channels */