== NLA Editor ==
authorJoshua Leung <aligorith@gmail.com>
Fri, 1 Jun 2007 10:38:17 +0000 (10:38 +0000)
committerJoshua Leung <aligorith@gmail.com>
Fri, 1 Jun 2007 10:38:17 +0000 (10:38 +0000)
When adding a new Action Strip to an Object which didn't have any Action Strips previously, NLA-override mode is turned on by default for that object (the Action/NLA-icon beside the expand/collapse triangle).

source/blender/blenkernel/intern/nla.c
source/blender/src/editnla.c

index a348aef03996ddb9501fa8d5445334f4fa8db600..961ea21d08848d1b37e79559f5aa27486bdc56c6 100644 (file)
@@ -141,7 +141,10 @@ bActionStrip *convert_action_to_strip (Object *ob)
        //set_active_strip(ob, nstrip); /* is in editnla as does UI calls */
                        
        nstrip->repeat = 1.0;
-                                                       
+
+       if(ob->nlastrips.first == NULL)
+               ob->nlaflag |= OB_NLA_OVERRIDE;
+       
        BLI_addtail(&ob->nlastrips, nstrip);
        return nstrip; /* is created, malloced etc. here so is safe to just return the pointer?
                          this is needed for setting this active in UI, and probably useful for API too */
index d204fa2b7038a0a8744c2323b22dec4669c09399..73eea2b5aa40c73eca888e1b58ab40d862a0eb9b 100644 (file)
@@ -526,6 +526,9 @@ static void add_nla_block(short event)
        if(strip->object)
                id_lib_extern(&strip->object->id);      /* checks lib data, sets correct flag for saving then */
 
+       if(ob->nlastrips.first == NULL)
+               ob->nlaflag |= OB_NLA_OVERRIDE;
+       
        BLI_addtail(&ob->nlastrips, strip);
 
        BIF_undo_push("Add NLA strip");
@@ -580,6 +583,9 @@ static void add_nla_block_by_name(char name[32], Object *ob, short hold, short a
        
        act->id.us++;
        
+       if(ob->nlastrips.first == NULL)
+               ob->nlaflag |= OB_NLA_OVERRIDE;
+               
        BLI_addtail(&ob->nlastrips, strip);
 }