Merged changes in the trunk up to revision 46045.
[blender-staging.git] / source / blender / editors / space_nla / nla_buttons.c
index 5e1f27455594d26138f952a478407968e0765ad2..17be87052c4c696484f50d9741c96cbb5d2957a3 100644 (file)
@@ -42,7 +42,6 @@
 
 #include "BLI_math.h"
 #include "BLI_blenlib.h"
-#include "BLI_editVert.h"
 #include "BLI_rand.h"
 
 #include "BLF_translation.h"
@@ -77,7 +76,7 @@ static void do_nla_region_buttons(bContext *C, void *UNUSED(arg), int event)
 {
        //Scene *scene= CTX_data_scene(C);
        
-       switch(event) {
+       switch (event) {
 
        }
        
@@ -146,6 +145,7 @@ static int nla_panel_context(const bContext *C, PointerRNA *adt_ptr, PointerRNA
                        case ANIMTYPE_DSPART:
                        case ANIMTYPE_DSMBALL:
                        case ANIMTYPE_DSARM:
+                       case ANIMTYPE_DSLINESTYLE:
                        case ANIMTYPE_DSSPK:
                        {
                                /* for these channels, we only do AnimData */
@@ -294,7 +294,7 @@ static void nla_panel_properties(const bContext *C, Panel *pa)
 {
        PointerRNA strip_ptr;
        uiLayout *layout= pa->layout;
-       uiLayout *column, *row, *subcol;
+       uiLayout *column, *row, *sub;
        uiBlock *block;
        short showEvalProps = 1;
        
@@ -339,10 +339,10 @@ static void nla_panel_properties(const bContext *C, Panel *pa)
                        uiLayoutSetActive(column, RNA_boolean_get(&strip_ptr, "use_animated_influence")==0); 
                        uiItemR(column, &strip_ptr, "use_auto_blend", 0, NULL, ICON_NONE); // XXX as toggle?
                        
-                       subcol= uiLayoutColumn(column, 1);
-                               uiLayoutSetActive(subcol, RNA_boolean_get(&strip_ptr, "use_auto_blend")==0); 
-                               uiItemR(subcol, &strip_ptr, "blend_in", 0, NULL, ICON_NONE);
-                               uiItemR(subcol, &strip_ptr, "blend_out", 0, NULL, ICON_NONE);
+                       sub= uiLayoutColumn(column, 1);
+                               uiLayoutSetActive(sub, RNA_boolean_get(&strip_ptr, "use_auto_blend")==0); 
+                               uiItemR(sub, &strip_ptr, "blend_in", 0, NULL, ICON_NONE);
+                               uiItemR(sub, &strip_ptr, "blend_out", 0, NULL, ICON_NONE);
                        
                /* settings */
                column= uiLayoutColumn(layout, 1);
@@ -395,7 +395,7 @@ static void nla_panel_evaluation(const bContext *C, Panel *pa)
 {
        PointerRNA strip_ptr;
        uiLayout *layout= pa->layout;
-       uiLayout *column, *subcolumn, *subrow;
+       uiLayout *col, *sub;
        uiBlock *block;
 
        /* check context and also validity of pointer */
@@ -405,23 +405,21 @@ static void nla_panel_evaluation(const bContext *C, Panel *pa)
        block= uiLayoutGetBlock(layout);
        uiBlockSetHandleFunc(block, do_nla_region_buttons, NULL);
                
-       column= uiLayoutColumn(layout, 1);
-               uiItemR(column, &strip_ptr, "use_animated_influence", 0, NULL, ICON_NONE);
-               
-               subcolumn= uiLayoutColumn(column, 1);
-               uiLayoutSetEnabled(subcolumn, RNA_boolean_get(&strip_ptr, "use_animated_influence"));   
-                       uiItemR(subcolumn, &strip_ptr, "influence", 0, NULL, ICON_NONE);
-               
+       col= uiLayoutColumn(layout, 1);
+       uiItemR(col, &strip_ptr, "use_animated_influence", 0, NULL, ICON_NONE);
        
-       column= uiLayoutColumn(layout, 1);
-               subrow= uiLayoutRow(column, 0);
-               uiItemR(subrow, &strip_ptr, "use_animated_time", 0, NULL, ICON_NONE);
-               uiItemR(subrow, &strip_ptr, "use_animated_time_cyclic", 0, NULL, ICON_NONE);
-
-               subcolumn= uiLayoutColumn(column, 1);
-               subrow= uiLayoutRow(subcolumn, 0);
-               uiLayoutSetEnabled(subrow, RNA_boolean_get(&strip_ptr, "use_animated_time"));
-                       uiItemR(subcolumn, &strip_ptr, "strip_time", 0, NULL, ICON_NONE);
+       sub= uiLayoutColumn(col, 1);
+       uiLayoutSetEnabled(sub, RNA_boolean_get(&strip_ptr, "use_animated_influence")); 
+       uiItemR(sub, &strip_ptr, "influence", 0, NULL, ICON_NONE);
+
+       col= uiLayoutColumn(layout, 1);
+       sub= uiLayoutRow(col, 0);
+       uiItemR(sub, &strip_ptr, "use_animated_time", 0, NULL, ICON_NONE);
+       uiItemR(sub, &strip_ptr, "use_animated_time_cyclic", 0, NULL, ICON_NONE);
+
+       sub= uiLayoutRow(col, 0);
+       uiLayoutSetEnabled(sub, RNA_boolean_get(&strip_ptr, "use_animated_time"));
+       uiItemR(sub, &strip_ptr, "strip_time", 0, NULL, ICON_NONE);
 }
 
 /* F-Modifiers for active NLA-Strip */
@@ -448,8 +446,8 @@ static void nla_panel_modifiers(const bContext *C, Panel *pa)
                
                // XXX for now, this will be a operator button which calls a temporary 'add modifier' operator
                // FIXME: we need to set the only-active property so that this will only add modifiers for the active strip (not all selected)
-               uiDefButO(block, BUT, "NLA_OT_fmodifier_add", WM_OP_INVOKE_REGION_WIN, UI_translate_do_iface(N_("Add Modifier")), 10, 0, 150, 20,
-                               UI_translate_do_tooltip(N_("Adds a new F-Modifier for the active NLA Strip")));
+               uiDefButO(block, BUT, "NLA_OT_fmodifier_add", WM_OP_INVOKE_REGION_WIN, IFACE_("Add Modifier"), 10, 0, 150, 20,
+                               TIP_("Adds a new F-Modifier for the active NLA Strip"));
                
                /* copy/paste (as sub-row)*/
                row= uiLayoutRow(row, 1);
@@ -521,7 +519,7 @@ static int nla_properties(bContext *C, wmOperator *UNUSED(op))
        ScrArea *sa= CTX_wm_area(C);
        ARegion *ar= nla_has_buttons_region(sa);
        
-       if(ar)
+       if (ar)
                ED_region_toggle_hidden(C, ar);
 
        return OPERATOR_FINISHED;
@@ -529,13 +527,13 @@ static int nla_properties(bContext *C, wmOperator *UNUSED(op))
 
 void NLA_OT_properties(wmOperatorType *ot)
 {
-       ot->name= "Properties";
-       ot->idname= "NLA_OT_properties";
-       ot->description= "Toggle display properties panel";
+       ot->name = "Properties";
+       ot->idname = "NLA_OT_properties";
+       ot->description = "Toggle display properties panel";
        
-       ot->exec= nla_properties;
-       ot->poll= ED_operator_nla_active;
+       ot->exec = nla_properties;
+       ot->poll = ED_operator_nla_active;
 
        /* flags */
-       ot->flag= 0;
+       ot->flag = 0;
 }