Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2020-09-22 03:19:21 +0300
committerHans Goudey <h.goudey@me.com>2020-09-22 03:19:21 +0300
commit4e667ecef92f4ba7e1d58cfb3effc2bf010085ce (patch)
tree478ec83ca7c50cd8398ca7175d13f02f8a7512f2 /release/scripts/startup/bl_ui/properties_data_curve.py
parent8eda3ddc4f047fcf7d8bd71d4fea958d8005ade8 (diff)
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
Diffstat (limited to 'release/scripts/startup/bl_ui/properties_data_curve.py')
-rw-r--r--release/scripts/startup/bl_ui/properties_data_curve.py47
1 files changed, 31 insertions, 16 deletions
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,