* Added Armature data filter buttons in Dopesheet/Graph editor headers
authorMatt Ebb <matt@mke3.net>
Mon, 21 Sep 2009 07:25:48 +0000 (07:25 +0000)
committerMatt Ebb <matt@mke3.net>
Mon, 21 Sep 2009 07:25:48 +0000 (07:25 +0000)
* Fixed an RNA typo to fix ranges in action constraint

source/blender/editors/space_action/action_header.c
source/blender/editors/space_graph/graph_header.c
source/blender/makesrna/intern/rna_constraint.c

index 4cb02f3f233f06ba318c6351c1b53089ec6ca928..dd02302af9c45c70d7ba1f290c2e1106a54b5b59 100644 (file)
@@ -349,6 +349,7 @@ void action_header_buttons(const bContext *C, ARegion *ar)
                                uiDefIconButBitI(block, TOGN, ADS_FILTER_NOCAM, B_REDR, ICON_CAMERA_DATA,       (short)(xco+=XIC),yco,XIC,YIC, &(saction->ads.filterflag), 0, 0, 0, 0, "Display Cameras");
                                uiDefIconButBitI(block, TOGN, ADS_FILTER_NOCUR, B_REDR, ICON_CURVE_DATA,        (short)(xco+=XIC),yco,XIC,YIC, &(saction->ads.filterflag), 0, 0, 0, 0, "Display Curves");
                                uiDefIconButBitI(block, TOGN, ADS_FILTER_NOMBA, B_REDR, ICON_META_DATA, (short)(xco+=XIC),yco,XIC,YIC, &(saction->ads.filterflag), 0, 0, 0, 0, "Display MetaBalls");
+                               uiDefIconButBitI(block, TOGN, ADS_FILTER_NOARM, B_REDR, ICON_ARMATURE_DATA,     (short)(xco+=XIC),yco,XIC,YIC, &(saction->ads.filterflag), 0, 0, 0, 0, "Display Armature/Bone");
                                uiDefIconButBitI(block, TOGN, ADS_FILTER_NOPART, B_REDR, ICON_PARTICLE_DATA,    (short)(xco+=XIC),yco,XIC,YIC, &(saction->ads.filterflag), 0, 0, 0, 0, "Display Particles");
                        uiBlockEndAlign(block);
                        xco += 30;
index dd304cd8cf3d79761f9b48812bc0bc280e15cb69..79d38d9c2523c1de54e5fe412afb6cdc1fcc7852 100644 (file)
@@ -313,6 +313,7 @@ void graph_header_buttons(const bContext *C, ARegion *ar)
                        uiDefIconButBitI(block, TOGN, ADS_FILTER_NOCAM, B_REDR, ICON_CAMERA_DATA,       (short)(xco+=XIC),yco,XIC,YIC, &(sipo->ads->filterflag), 0, 0, 0, 0, "Display Cameras");
                        uiDefIconButBitI(block, TOGN, ADS_FILTER_NOCUR, B_REDR, ICON_CURVE_DATA,        (short)(xco+=XIC),yco,XIC,YIC, &(sipo->ads->filterflag), 0, 0, 0, 0, "Display Curves");
                        uiDefIconButBitI(block, TOGN, ADS_FILTER_NOMBA, B_REDR, ICON_META_DATA, (short)(xco+=XIC),yco,XIC,YIC, &(sipo->ads->filterflag), 0, 0, 0, 0, "Display MetaBalls");
+                       uiDefIconButBitI(block, TOGN, ADS_FILTER_NOARM, B_REDR, ICON_ARMATURE_DATA,     (short)(xco+=XIC),yco,XIC,YIC, &(sipo->ads->filterflag), 0, 0, 0, 0, "Display Armature/Bone data");
                        uiDefIconButBitI(block, TOGN, ADS_FILTER_NOPART, B_REDR, ICON_PARTICLE_DATA,    (short)(xco+=XIC),yco,XIC,YIC, &(sipo->ads->filterflag), 0, 0, 0, 0, "Display Particles");
                uiBlockEndAlign(block);
                xco += 30;
index 04d56eb666e15d7f6f6758e748bd1be18f086233..1bbac8da02f1caea7bb2e377b585fd12b4981e56 100644 (file)
@@ -253,6 +253,22 @@ static EnumPropertyItem *rna_Constraint_target_space_itemf(bContext *C, PointerR
        return space_object_items;
 }
 
+static void rna_ActionConstraint_minmax_range(PointerRNA *ptr, float *min, float *max)
+{
+       bConstraint *con= (bConstraint*)ptr->data;
+       bActionConstraint *acon = (bActionConstraint *)con->data;
+
+       /* 0, 1, 2 = magic numbers for rotX, rotY, rotZ */
+       if (ELEM3(acon->type, 0, 1, 2)) {
+               *min= -90.f;
+               *max= 90.f;
+       } else {
+               *min= -1000.f;
+               *max= 1000.f;
+       }
+}
+
+
 #else
 
 static void rna_def_constrainttarget(BlenderRNA *brna)
@@ -781,15 +797,17 @@ static void rna_def_constraint_action(BlenderRNA *brna)
 
        prop= RNA_def_property(srna, "maximum", PROP_FLOAT, PROP_NONE);
        RNA_def_property_float_sdna(prop, NULL, "max");
-       RNA_def_property_range(prop, 0.0, 1000.f);
+       RNA_def_property_range(prop, -1000.f, 1000.f);
        RNA_def_property_ui_text(prop, "Maximum", "Maximum value for target channel range.");
        RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
+       RNA_def_property_float_funcs(prop, NULL, NULL, "rna_ActionConstraint_minmax_range");
 
        prop= RNA_def_property(srna, "minimum", PROP_FLOAT, PROP_NONE);
        RNA_def_property_float_sdna(prop, NULL, "min");
-       RNA_def_property_range(prop, 0.0, 1000.f);
+       RNA_def_property_range(prop, -1000.f, 1000.f);
        RNA_def_property_ui_text(prop, "Minimum", "Minimum value for target channel range.");
        RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
+       RNA_def_property_float_funcs(prop, NULL, NULL, "rna_ActionConstraint_minmax_range");
 }
 
 static void rna_def_constraint_locked_track(BlenderRNA *brna)