[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [33192] trunk/blender: Bugfix for [#24768] 6DoF Constraint options missing.

Thomas Dinges dingto at gmx.de
Sat Nov 20 10:48:51 CET 2010


Revision: 33192
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=33192
Author:   dingto
Date:     2010-11-20 10:48:51 +0100 (Sat, 20 Nov 2010)

Log Message:
-----------
Bugfix for [#24768] 6DoF Constraint options missing.
* Added the options in UI and RNA 

Funny Note: This was on my own to-do list (see commit 20577 in the py file from 2009-06-02 when I ported the UI from C to Python) :P

Modified Paths:
--------------
    trunk/blender/release/scripts/ui/properties_object_constraint.py
    trunk/blender/source/blender/makesrna/intern/rna_constraint.c

Modified: trunk/blender/release/scripts/ui/properties_object_constraint.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_object_constraint.py	2010-11-20 07:51:39 UTC (rev 33191)
+++ trunk/blender/release/scripts/ui/properties_object_constraint.py	2010-11-20 09:48:51 UTC (rev 33192)
@@ -550,9 +550,39 @@
         col.prop(con, "axis_x", text="X")
         col.prop(con, "axis_y", text="Y")
         col.prop(con, "axis_z", text="Z")
+        
 
-        #Missing: Limit arrays (not wrapped in RNA yet)
+        if con.pivot_type == 'CONE_TWIST':
+            layout.label(text="Limits:")
+            split = layout.split()
+        
+            col = split.column(align=True)
+            col.prop(con, "use_angular_limit_x", text="Angular X")
+            col.prop(con, "use_angular_limit_y", text="Angular Y")
+            col.prop(con, "use_angular_limit_z", text="Angular Z")
+                
+            col = split.column()
+            col.prop(con, "limit_cone_min", text="")
+            col = split.column()
+            col.prop(con, "limit_cone_max", text="")
 
+        elif con.pivot_type == 'GENERIC_6_DOF':
+            layout.label(text="Limits:")
+            split = layout.split()
+            
+            col = split.column(align=True)
+            col.prop(con, "use_limit_x", text="X")
+            col.prop(con, "use_limit_y", text="Y")
+            col.prop(con, "use_limit_z", text="Z")
+            col.prop(con, "use_angular_limit_x", text="Angular X")
+            col.prop(con, "use_angular_limit_y", text="Angular Y")
+            col.prop(con, "use_angular_limit_z", text="Angular Z")
+                
+            col = split.column()
+            col.prop(con, "limit_generic_min", text="")
+            col = split.column()
+            col.prop(con, "limit_generic_max", text="")
+      
     def CLAMP_TO(self, context, layout, con):
         self.target_template(layout, con)
 

Modified: trunk/blender/source/blender/makesrna/intern/rna_constraint.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_constraint.c	2010-11-20 07:51:39 UTC (rev 33191)
+++ trunk/blender/source/blender/makesrna/intern/rna_constraint.c	2010-11-20 09:48:51 UTC (rev 33192)
@@ -1241,26 +1241,74 @@
 	RNA_def_property_range(prop, -M_PI*2, M_PI*2);
 	RNA_def_property_ui_text(prop, "Axis Z", "Rotate pivot on Z axis in degrees");
 	RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
+
+	prop= RNA_def_property(srna, "use_linked_collision", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_DISABLE_LINKED_COLLISION);
+	RNA_def_property_ui_text(prop, "Disable Linked Collision", "Disable collision between linked bodies");
+	RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
+
+	prop= RNA_def_property(srna, "show_pivot", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_DRAW_PIVOT);
+	RNA_def_property_ui_text(prop, "Draw Pivot", "Display the pivot point and rotation in 3D view");
+	RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
 	
-	prop= RNA_def_property(srna, "limit_min", PROP_FLOAT, PROP_NONE);
+	
+	/* Limit */
+    
+    /* Limit Min/Max for genereic 6 DoF */
+	prop= RNA_def_property(srna, "limit_generic_min", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "minLimit");
 	RNA_def_property_array(prop, 6);
 	RNA_def_property_ui_text(prop, "Minimum Limit", "");
 
-	prop= RNA_def_property(srna, "limit_max", PROP_FLOAT, PROP_NONE);
+	prop= RNA_def_property(srna, "limit_generic_max", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "maxLimit");
 	RNA_def_property_array(prop, 6);
 	RNA_def_property_ui_text(prop, "Maximum Limit", "");
+    
+    /* Limit Min/Max for Cone Twist */
+	prop= RNA_def_property(srna, "limit_cone_min", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "minLimit");
+	RNA_def_property_array(prop, 3);
+	RNA_def_property_ui_text(prop, "Minimum Limit", "");
 
-	prop= RNA_def_property(srna, "use_linked_collision", PROP_BOOLEAN, PROP_NONE);
-	RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_DISABLE_LINKED_COLLISION);
-	RNA_def_property_ui_text(prop, "Disable Linked Collision", "Disable collision between linked bodies");
-	RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
+	prop= RNA_def_property(srna, "limit_cone_max", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "maxLimit");
+	RNA_def_property_array(prop, 3);
+	RNA_def_property_ui_text(prop, "Maximum Limit", "");
 
-	prop= RNA_def_property(srna, "show_pivot", PROP_BOOLEAN, PROP_NONE);
-	RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_DRAW_PIVOT);
-	RNA_def_property_ui_text(prop, "Draw Pivot", "Display the pivot point and rotation in 3D view");
+    
+    /* Limit Booleans */
+	prop= RNA_def_property(srna, "use_limit_x", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", 1);
+	RNA_def_property_ui_text(prop, "Use X Limit", "Use minimum/maximum x limit");
 	RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
+	
+	prop= RNA_def_property(srna, "use_limit_y", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", 2);
+	RNA_def_property_ui_text(prop, "Use Y Limit", "Use minimum/maximum y limit");
+	RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
+	
+	prop= RNA_def_property(srna, "use_limit_z", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", 4);
+	RNA_def_property_ui_text(prop, "Use Z Limit", "Use minimum/maximum z limit");
+	RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
+    
+	prop= RNA_def_property(srna, "use_angular_limit_x", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", 8);
+	RNA_def_property_ui_text(prop, "Use Angular X Limit", "Use minimum/maximum x angular limit");
+	RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
+	
+	prop= RNA_def_property(srna, "use_angular_limit_y", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", 16);
+	RNA_def_property_ui_text(prop, "Use Angular Y Limit", "Use minimum/maximum y angular limit");
+	RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
+	
+	prop= RNA_def_property(srna, "use_angular_limit_z", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", 32);
+	RNA_def_property_ui_text(prop, "Use Angular Z Limit", "Use minimum/maximum z angular limit");
+	RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
+    
 }
 
 static void rna_def_constraint_clamp_to(BlenderRNA *brna)





More information about the Bf-blender-cvs mailing list