[Bf-blender-cvs] [4e667ecef92] master: UI: Add curve geometry start and end panel

Hans Goudey noreply at git.blender.org
Tue Sep 22 02:19:59 CEST 2020


Commit: 4e667ecef92f4ba7e1d58cfb3effc2bf010085ce
Author: Hans Goudey
Date:   Mon Sep 21 19:19:21 2020 -0500
Branches: master
https://developer.blender.org/rB4e667ecef92f4ba7e1d58cfb3effc2bf010085ce

UI: Add curve geometry start and end panel

The placement of the start and end factor and mapping settings for
curves has been quite misleading for a long time. They were in the
"Bevel" subpanel, but they aren't related to bevel because they affect
curves with only extrusion and no bevel.

This commit moves these properties to their own subpanel, labeled
"Start & End Mapping".

Differential Revision: https://developer.blender.org/D8910

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

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

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

diff --git a/release/scripts/startup/bl_ui/properties_data_curve.py b/release/scripts/startup/bl_ui/properties_data_curve.py
index 083e5470a99..9f9261bde92 100644
--- a/release/scripts/startup/bl_ui/properties_data_curve.py
+++ b/release/scripts/startup/bl_ui/properties_data_curve.py
@@ -207,25 +207,39 @@ class DATA_PT_geometry_curve_bevel(CurveButtonsPanelCurve, Panel):
             col.prop(curve, "bevel_resolution", text="Resolution")
         col.prop(curve, "use_fill_caps")
 
-        if type(curve) is not TextCurve:
+        if curve.bevel_mode == 'PROFILE':
+            col.template_curveprofile(curve, "bevel_profile")
 
-            col = layout.column()
-            col.active = (
-                (curve.bevel_depth > 0.0) or
-                (curve.extrude > 0.0) or
-                (curve.bevel_object is not None)
-            )
-            sub = col.column(align=True)
-            sub.prop(curve, "bevel_factor_start", text="Start")
-            sub.prop(curve, "bevel_factor_end", text="End")
 
-            sub = col.column(align=True)
-            sub.prop(curve, "bevel_factor_mapping_start", text="Mapping Start")
-            sub.prop(curve, "bevel_factor_mapping_end", text="End")
+class DATA_PT_geometry_curve_start_end(CurveButtonsPanelCurve, Panel):
+    bl_label = "Start & End Mapping"
+    bl_parent_id = "DATA_PT_geometry_curve"
+    bl_options = {'DEFAULT_CLOSED'}
 
-        # Put the large template at the end so it doesn't displace the other properties
-        if curve.bevel_mode == 'PROFILE':
-            col.template_curveprofile(curve, "bevel_profile")
+    @classmethod
+    def poll(cls, context):
+        # Text objects don't support these properties
+        return (type(context.curve) in {Curve})
+
+    def draw(self, context):
+        layout = self.layout
+        layout.use_property_split = True
+
+        curve = context.curve
+
+        col = layout.column()
+
+        col.active = (
+            ((curve.bevel_depth > 0.0) or (curve.extrude > 0.0)) and
+            (curve.bevel_mode != 'OBJECT')
+        )
+        sub = col.column(align=True)
+        sub.prop(curve, "bevel_factor_start", text="Factor Start")
+        sub.prop(curve, "bevel_factor_end", text="End")
+
+        sub = col.column(align=True)
+        sub.prop(curve, "bevel_factor_mapping_start", text="Mapping Start")
+        sub.prop(curve, "bevel_factor_mapping_end", text="End")
 
 
 class DATA_PT_pathanim(CurveButtonsPanelCurve, Panel):
@@ -480,6 +494,7 @@ classes = (
     DATA_PT_curve_texture_space,
     DATA_PT_geometry_curve,
     DATA_PT_geometry_curve_bevel,
+    DATA_PT_geometry_curve_start_end,
     DATA_PT_pathanim,
     DATA_PT_active_spline,
     DATA_PT_font,



More information about the Bf-blender-cvs mailing list