== NLA Visibility Tweak ==
authorJoshua Leung <aligorith@gmail.com>
Wed, 17 Jan 2007 03:24:21 +0000 (03:24 +0000)
committerJoshua Leung <aligorith@gmail.com>
Wed, 17 Jan 2007 03:24:21 +0000 (03:24 +0000)
In a few cases, it may be helpful to turn off the 'only show objects that are
in visible scene layers in the nla' trick. By default though, this is still on. Find
the switch in the View menu of NLA editor.

source/blender/makesdna/DNA_space_types.h
source/blender/src/drawnla.c
source/blender/src/header_nla.c

index 1f5391d59b1bff7aa31ea76df820a2f62aa11aae..53a64fa574fa83d525cb2c97c154f5e2be7fe176 100644 (file)
@@ -251,7 +251,7 @@ typedef struct SpaceNla{
        short blockhandler[8];
 
        short menunr, lock;
        short blockhandler[8];
 
        short menunr, lock;
-       int pad;
+       int flag;
        
        View2D v2d;     
 } SpaceNla;
        
        View2D v2d;     
 } SpaceNla;
@@ -581,6 +581,10 @@ typedef struct SpaceImaSel {
 #define IMS_INFILE                     3
 #define IMS_INFILESLI          4
 
 #define IMS_INFILE                     3
 #define IMS_INFILESLI          4
 
+/* nla->flag */
+#define SNLA_ALLKEYED          1
+#define SNLA_ACTIVELAYERS      2
+
 /* time->flag */
 #define TIME_DRAWFRAMES                1
 #define TIME_CFRA_NUM          2
 /* time->flag */
 #define TIME_DRAWFRAMES                1
 #define TIME_CFRA_NUM          2
index 9c6870a9483d7883c3af4ae7341b8ba0c5d5b7f3..e9710ff52ba475e7f8ac76493239049fd37b9e6b 100644 (file)
@@ -761,7 +761,7 @@ int nla_filter (Base *base)
 {
        Object *ob = base->object;
        
 {
        Object *ob = base->object;
        
-       if(base->lay & G.scene->lay) {
+       if ((G.snla->flag & SNLA_ALLKEYED) || (base->lay & G.scene->lay)) {
                if(ob->action || ob->nlastrips.first) 
                        return 1;
 
                if(ob->action || ob->nlastrips.first) 
                        return 1;
 
index 2d33ee098de6a45f3203af45162b2f03bcbac190..918383478e5b41bf32d9794493e5d0f0f0aab37b 100644 (file)
@@ -114,11 +114,14 @@ static void do_nla_viewmenu(void *arg, int event)
        case 4: /* Maximize Window */
                /* using event B_FULL */
                break;
        case 4: /* Maximize Window */
                /* using event B_FULL */
                break;
-       case 5:
+       case 5: /* Update automatically */
                G.v2d->flag ^= V2D_VIEWLOCK;
                if(G.v2d->flag & V2D_VIEWLOCK)
                        view2d_do_locks(curarea, 0);
                G.v2d->flag ^= V2D_VIEWLOCK;
                if(G.v2d->flag & V2D_VIEWLOCK)
                        view2d_do_locks(curarea, 0);
-               break;                  
+               break;  
+       case 6: /* Show all objects that have keyframes? */
+               G.snla->flag ^= SNLA_ALLKEYED;
+               break;
        }
 }
 
        }
 }
 
@@ -131,6 +134,11 @@ static uiBlock *nla_viewmenu(void *arg_unused)
        block= uiNewBlock(&curarea->uiblocks, "nla_viewmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
        uiBlockSetButmFunc(block, do_nla_viewmenu, NULL);
                
        block= uiNewBlock(&curarea->uiblocks, "nla_viewmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
        uiBlockSetButmFunc(block, do_nla_viewmenu, NULL);
                
+       uiDefIconTextBut(block, BUTM, 1, (G.snla->flag & SNLA_ALLKEYED)?ICON_CHECKBOX_DEHLT:ICON_CHECKBOX_HLT, 
+                                        "Only Objects On Visible Layers|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
+               
+       uiDefBut(block, SEPR, 0, "",                                    0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
+               
        if(BTST(G.snla->lock, 0)) {
                uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Update Automatically|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
        } else {
        if(BTST(G.snla->lock, 0)) {
                uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Update Automatically|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
        } else {