[Bf-blender-cvs] [b5a46211f42] modifier-panels-ui: First pass of layout updates for remaining constraints

Hans Goudey noreply at git.blender.org
Mon Apr 20 01:47:17 CEST 2020


Commit: b5a46211f424fbb89588e219995bd2f17e5b2ede
Author: Hans Goudey
Date:   Sun Apr 19 18:47:06 2020 -0500
Branches: modifier-panels-ui
https://developer.blender.org/rBb5a46211f424fbb89588e219995bd2f17e5b2ede

First pass of layout updates for remaining constraints

===================================================================

M	release/scripts/startup/bl_ui/properties_constraint.py

===================================================================

diff --git a/release/scripts/startup/bl_ui/properties_constraint.py b/release/scripts/startup/bl_ui/properties_constraint.py
index 91b817792f4..0e4af454376 100644
--- a/release/scripts/startup/bl_ui/properties_constraint.py
+++ b/release/scripts/startup/bl_ui/properties_constraint.py
@@ -192,22 +192,20 @@ class OBJECT_PT_bTrackToConstraint(ConstraintButtonsPanel):
     def draw(self, context):
         layout = self.layout
         con = self.get_constraint(context)
+        layout.use_property_split = True
+        layout.use_property_decorate = True
 
         self.target_template(layout, con)
 
-        row = layout.row()
-        row.label(text="To:")
-        row.prop(con, "track_axis", expand=True)
-
-        row = layout.row()
-        row.prop(con, "up_axis", text="Up")
-        row.prop(con, "use_target_z")
+        layout.prop(con, "track_axis", expand=True)
+        layout.prop(con, "up_axis", text="Up", expand=True)
+        layout.prop(con, "use_target_z")
 
         self.space_template(layout, con)
 
         self.draw_influence(layout, con)
 
-
+# No option to add this in the UI ?
 class OBJECT_PT_bKinematicConstraint(ConstraintButtonsPanel):
 
     def draw(self, context):
@@ -327,30 +325,23 @@ class OBJECT_PT_bFollowPathConstraint(ConstraintButtonsPanel):
     def draw(self, context):
         layout = self.layout
         con = self.get_constraint(context)
+        layout.use_property_split = True
+        layout.use_property_decorate = True
 
-        self.target_template(layout, con)
-        layout.operator("constraint.followpath_path_animate", text="Animate Path", icon='ANIM_DATA')
-
-        split = layout.split()
-
-        col = split.column()
-        col.prop(con, "use_curve_follow")
-        col.prop(con, "use_curve_radius")
+        layout.prop(con, "use_curve_follow")
+        layout.prop(con, "use_curve_radius")
 
-        col = split.column()
-        col.prop(con, "use_fixed_location")
+        layout.prop(con, "use_fixed_location")
         if con.use_fixed_location:
-            col.prop(con, "offset_factor", text="Offset")
+            layout.prop(con, "offset_factor", text="Offset")
         else:
-            col.prop(con, "offset")
+            layout.prop(con, "offset")
 
-        row = layout.row()
-        row.label(text="Forward:")
-        row.prop(con, "forward_axis", expand=True)
+        layout.prop(con, "forward_axis", expand=True)
+        layout.prop(con, "up_axis", text="Up")
 
-        row = layout.row()
-        row.prop(con, "up_axis", text="Up")
-        row.label()
+        self.target_template(layout, con)
+        layout.operator("constraint.followpath_path_animate", text="Animate Path", icon='ANIM_DATA')
 
         self.draw_influence(layout, con)
 
@@ -363,7 +354,6 @@ class OBJECT_PT_bRotLimitConstraint(ConstraintButtonsPanel):
         layout.use_property_split = True
         layout.use_property_decorate = True
 
-
         row = layout.row(heading="Limit X", align=True)
         row.prop(con, "use_limit_x", text="")
         sub = row.column(align=True)
@@ -621,30 +611,26 @@ class OBJECT_PT_bActionConstraint(ConstraintButtonsPanel):
     def draw(self, context):
         layout = self.layout
         con = self.get_constraint(context)
-
+        layout.use_property_split = True
+        layout.use_property_decorate = True
+        
         self.target_template(layout, con)
 
-        split = layout.split()
-
-        col = split.column()
-        col.label(text="From Target:")
-        col.prop(con, "transform_channel", text="")
-        col.prop(con, "target_space", text="")
-
-        col = split.column()
-        col.label(text="To Action:")
-        col.prop(con, "action", text="")
-        col.prop(con, "use_bone_object_action")
-
-        split = layout.split()
+        layout.label(text="From Target:")
+        layout.prop(con, "transform_channel", text="")
+        layout.prop(con, "target_space", text="")
 
-        col = split.column(align=True)
+        col = layout.column(align=True)
         col.label(text="Target Range:")
         col.prop(con, "min", text="Min")
         col.prop(con, "max", text="Max")
 
-        col = split.column(align=True)
+        layout.label(text="To Action:")
+        layout.prop(con, "action", text="")
+        layout.prop(con, "use_bone_object_action")
+
         col.label(text="Action Range:")
+        col = layout.column(align=True)
         col.prop(con, "frame_start", text="Start")
         col.prop(con, "frame_end", text="End")
 
@@ -658,16 +644,13 @@ class OBJECT_PT_bLockTrackConstraint(ConstraintButtonsPanel):
     def draw(self, context):
         layout = self.layout
         con = self.get_constraint(context)
+        layout.use_property_split = True
+        layout.use_property_decorate = True
 
         self.target_template(layout, con)
 
-        row = layout.row()
-        row.label(text="To:")
-        row.prop(con, "track_axis", expand=True)
-
-        row = layout.row()
-        row.label(text="Lock:")
-        row.prop(con, "lock_axis", expand=True)
+        layout.prop(con, "track_axis", expand=True)
+        layout.prop(con, "lock_axis", expand=True)
 
         self.draw_influence(layout, con)
 
@@ -700,38 +683,35 @@ class OBJECT_PT_bStretchToConstraint(ConstraintButtonsPanel):
     def draw(self, context):
         layout = self.layout
         con = self.get_constraint(context)
+        layout.use_property_split = True
+        layout.use_property_decorate = True
 
         self.target_template(layout, con)
 
-        row = layout.row()
-        row.prop(con, "rest_length", text="Rest Length")
-        row.operator("constraint.stretchto_reset", text="Reset")
+        col = layout.column(heading="Rest Length", align=True)
+        col.prop(con, "rest_length")
+        col.operator("constraint.stretchto_reset", text="Reset")
 
         layout.prop(con, "bulge", text="Volume Variation")
-        split = layout.split()
-        col = split.column(align=True)
-        col.prop(con, "use_bulge_min", text="Volume Min")
-        sub = col.column()
+
+        row = layout.row(heading="Volume Min", align=True)
+        row.prop(con, "use_bulge_min", text="")
+        sub = row.row(align=True)
         sub.active = con.use_bulge_min
         sub.prop(con, "bulge_min", text="")
-        col = split.column(align=True)
-        col.prop(con, "use_bulge_max", text="Volume Max")
-        sub = col.column()
+
+        row = layout.row(heading="Max", align=True)
+        row.prop(con, "use_bulge_max", text="")
+        sub = row.row(align=True)
         sub.active = con.use_bulge_max
         sub.prop(con, "bulge_max", text="")
-        col = layout.column()
-        col.active = con.use_bulge_min or con.use_bulge_max
-        col.prop(con, "bulge_smooth", text="Smooth")
+        
+        row = layout.row()
+        row.active = con.use_bulge_min or con.use_bulge_max
+        row.prop(con, "bulge_smooth", text="Smooth")
 
-        split = layout.split(factor=0.3)
-        split.label(text="Volume:")
-        row = split.row()
-        row.prop(con, "volume", expand=True)
-
-        split = layout.split(factor=0.3)
-        split.label(text="Rotation:")
-        row = split.row()
-        row.prop(con, "keep_axis", expand=True)
+        layout.prop(con, "volume", expand=True)
+        layout.prop(con, "keep_axis", text="Rotation", expand=True)
 
         self.draw_influence(layout, con)
 
@@ -741,22 +721,20 @@ class OBJECT_PT_bMinMaxConstraint(ConstraintButtonsPanel):
     def draw(self, context):
         layout = self.layout
         con = self.get_constraint(context)
+        layout.use_property_split = True
+        layout.use_property_decorate = True
 
         self.target_template(layout, con)
 
         layout.prop(con, "use_rotation")
         layout.prop(con, "offset")
-
-        row = layout.row()
-        row.label(text="Min/Max:")
-        row.prop(con, "floor_location", expand=True)
+        layout.prop(con, "floor_location", expand=True, text="Min/Max")
 
         self.space_template(layout, con)
 
         self.draw_influence(layout, con)
 
 
-# HANS-TODO: Deprecated.. delete?
 class OBJECT_PT_constraints_rigid_body_join(ConstraintButtonsPanel):
 
     def draw(self, context):
@@ -879,12 +857,12 @@ class OBJECT_PT_bClampToConstraint(ConstraintButtonsPanel):
     def draw(self, context):
         layout = self.layout
         con = self.get_constraint(context)
+        layout.use_property_split = True
+        layout.use_property_decorate = True
 
         self.target_template(layout, con)
 
-        row = layout.row()
-        row.label(text="Main Axis:")
-        row.prop(con, "main_axis", expand=True)
+        layout.prop(con, "main_axis", expand=True)
 
         layout.prop(con, "use_cyclic")
 
@@ -995,39 +973,40 @@ class OBJECT_PT_bShrinkwrapConstraint(ConstraintButtonsPanel):
     def draw(self, context):
         layout = self.layout
         con = self.get_constraint(context)
+        layout.use_property_split = True
+        layout.use_property_decorate = True
 
         self.target_template(layout, con, False)
 
         layout.prop(con, "distance")
-        layout.prop(con, "shrinkwrap_type")
+        layout.prop(con, "shrinkwrap_type", text="Mode")
+
+        layout.separator()
 
         if con.shrinkwrap_type in {'PROJECT', 'NEAREST_SURFACE', 'TARGET_PROJECT'}:
             layout.prop(con, "wrap_mode", text="Snap Mode")
 
         if con.shrinkwrap_type == 'PROJECT':
-            row = layout.row(align=True)
-            row.prop(con, "project_axis", expand=True)
-            split = layout.split(factor=0.4)
-            split.label(text="Axis Space:")
-            rowsub = split.row()
-            rowsub.prop(con, "project_axis_space", text="")
-            split = layout.split(factor=0.4)
-            split.label(text="Face Culling:")
-            rowsub = split.row()
-            rowsub.prop(con, "cull_face", expand=True)
-            row = layout.row()
-            row.prop(con, "use_project_opposite")
-            rowsub = row.row()
-            rowsub.active = con.use_project_opposite and con.cull_face != 'OFF'
-            rowsub.prop(con, "use_invert_cull")
+            layout.prop(con, "project_axi

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list