Revision: 23387
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23387
Author:   broken
Date:     2009-09-21 09:25:48 +0200 (Mon, 21 Sep 2009)

Log Message:
-----------
* Added Armature data filter buttons in Dopesheet/Graph editor headers

* Fixed an RNA typo to fix ranges in action constraint

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_action/action_header.c
    trunk/blender/source/blender/editors/space_graph/graph_header.c
    trunk/blender/source/blender/makesrna/intern/rna_constraint.c

Modified: trunk/blender/source/blender/editors/space_action/action_header.c
===================================================================
--- trunk/blender/source/blender/editors/space_action/action_header.c   
2009-09-21 06:43:20 UTC (rev 23386)
+++ trunk/blender/source/blender/editors/space_action/action_header.c   
2009-09-21 07:25:48 UTC (rev 23387)
@@ -349,6 +349,7 @@
                                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;

Modified: trunk/blender/source/blender/editors/space_graph/graph_header.c
===================================================================
--- trunk/blender/source/blender/editors/space_graph/graph_header.c     
2009-09-21 06:43:20 UTC (rev 23386)
+++ trunk/blender/source/blender/editors/space_graph/graph_header.c     
2009-09-21 07:25:48 UTC (rev 23387)
@@ -313,6 +313,7 @@
                        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;

Modified: trunk/blender/source/blender/makesrna/intern/rna_constraint.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_constraint.c       
2009-09-21 06:43:20 UTC (rev 23386)
+++ trunk/blender/source/blender/makesrna/intern/rna_constraint.c       
2009-09-21 07:25:48 UTC (rev 23387)
@@ -253,6 +253,22 @@
        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 @@
 
        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)


_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to