diff options
Diffstat (limited to 'release/scripts/startup/bl_ui/properties_data_curve.py')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_data_curve.py | 331 |
1 files changed, 183 insertions, 148 deletions
diff --git a/release/scripts/startup/bl_ui/properties_data_curve.py b/release/scripts/startup/bl_ui/properties_data_curve.py index f57156c1bae..47c53d6ffb5 100644 --- a/release/scripts/startup/bl_ui/properties_data_curve.py +++ b/release/scripts/startup/bl_ui/properties_data_curve.py @@ -93,63 +93,63 @@ class DATA_PT_shape_curve(CurveButtonsPanel, Panel): row = layout.row() row.prop(curve, "dimensions", expand=True) - split = layout.split() + layout.use_property_split = True + + col = layout.column() + sub = col.column(align=True) + sub.prop(curve, "resolution_u", text="Resolution Preview U") + if is_surf: + sub.prop(curve, "resolution_v", text="V") - col = split.column() - col.label(text="Resolution:") sub = col.column(align=True) - sub.prop(curve, "resolution_u", text="Preview U") sub.prop(curve, "render_resolution_u", text="Render U") + if is_surf: + sub.prop(curve, "render_resolution_v", text="V") + col.separator() + if is_curve: - col.label(text="Twisting:") - col.prop(curve, "twist_mode", text="") + col.prop(curve, "twist_mode") col.prop(curve, "twist_smooth", text="Smooth") elif is_text: - col.label(text="Display:") col.prop(curve, "use_fast_edit", text="Fast Editing") - col = split.column() - - if is_surf: - sub = col.column() - sub.label(text="") - sub = col.column(align=True) - sub.prop(curve, "resolution_v", text="Preview V") - sub.prop(curve, "render_resolution_v", text="Render V") - if is_curve or is_text: - col.label(text="Fill:") + col = layout.column() + col.separator() + sub = col.column() sub.active = (curve.dimensions == '2D' or (curve.bevel_object is None and curve.dimensions == '3D')) - sub.prop(curve, "fill_mode", text="") + sub.prop(curve, "fill_mode") col.prop(curve, "use_fill_deform") if is_curve: - col.label(text="Path/Curve-Deform:") + col = layout.column() + col.separator() + sub = col.column() - subsub = sub.row() - subsub.prop(curve, "use_radius") - subsub.prop(curve, "use_stretch") + sub.prop(curve, "use_radius") + sub.prop(curve, "use_stretch") sub.prop(curve, "use_deform_bounds") class DATA_PT_curve_texture_space(CurveButtonsPanel, Panel): bl_label = "Texture Space" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} def draw(self, context): layout = self.layout + layout.use_property_split = True curve = context.curve - row = layout.row() - row.prop(curve, "use_auto_texspace") - row.prop(curve, "use_uv_as_generated") + col = layout.column() + col.prop(curve, "use_uv_as_generated") + col.prop(curve, "use_auto_texspace") - row = layout.row() - row.column().prop(curve, "texspace_location", text="Location") - row.column().prop(curve, "texspace_size", text="Size") + col = layout.column() + col.prop(curve, "texspace_location") + col.prop(curve, "texspace_size") layout.operator("curve.match_texture_space") @@ -163,29 +163,51 @@ class DATA_PT_geometry_curve(CurveButtonsPanelCurve, Panel): def draw(self, context): layout = self.layout + layout.use_property_split = True curve = context.curve - split = layout.split() - - col = split.column() - col.label(text="Modification:") + col = layout.column() col.prop(curve, "offset") - col.prop(curve, "extrude") - col.label(text="Taper Object:") - col.prop(curve, "taper_object", text="") - col = split.column() - col.label(text="Bevel:") - col.prop(curve, "bevel_depth", text="Depth") - col.prop(curve, "bevel_resolution", text="Resolution") - col.label(text="Bevel Object:") - col.prop(curve, "bevel_object", text="") + sub = col.column() + sub.active = (curve.bevel_object is None) + sub.prop(curve, "extrude") + + col.prop(curve, "taper_object") + + sub = col.column() + sub.active = curve.taper_object is not None + sub.prop(curve, "use_map_taper") + + +class DATA_PT_geometry_curve_bevel(CurveButtonsPanelCurve, Panel): + bl_label = "Bevel" + bl_parent_id = "DATA_PT_geometry_curve" + + @classmethod + def poll(cls, context): + return (type(context.curve) in {Curve, TextCurve}) + + def draw(self, context): + layout = self.layout + layout.use_property_split = True + + curve = context.curve + + col = layout.column() + sub = col.column() + sub.active = (curve.bevel_object is None) + sub.prop(curve, "bevel_depth", text="Depth") + sub.prop(curve, "bevel_resolution", text="Resolution") + + col.prop(curve, "bevel_object", text="Object") + + sub = col.column() + sub.active = curve.bevel_object is not None + sub.prop(curve, "use_fill_caps") if type(curve) is not TextCurve: - col = layout.column(align=True) - row = col.row() - row.label(text="Bevel Factor:") col = layout.column() col.active = ( @@ -193,20 +215,13 @@ class DATA_PT_geometry_curve(CurveButtonsPanelCurve, Panel): (curve.extrude > 0.0) or (curve.bevel_object is not None) ) - row = col.row(align=True) - row.prop(curve, "bevel_factor_mapping_start", text="") - row.prop(curve, "bevel_factor_start", text="Start") - row = col.row(align=True) - row.prop(curve, "bevel_factor_mapping_end", text="") - row.prop(curve, "bevel_factor_end", text="End") + sub = col.column(align=True) + sub.prop(curve, "bevel_factor_start", text="Bevel Start") + sub.prop(curve, "bevel_factor_end", text="End") - row = layout.row() - sub = row.row() - sub.active = curve.taper_object is not None - sub.prop(curve, "use_map_taper") - sub = row.row() - sub.active = curve.bevel_object is not None - sub.prop(curve, "use_fill_caps") + sub = col.column(align=True) + sub.prop(curve, "bevel_factor_mapping_start", text="Bevel Mapping Start") + sub.prop(curve, "bevel_factor_mapping_end", text="End") class DATA_PT_pathanim(CurveButtonsPanelCurve, Panel): @@ -219,6 +234,7 @@ class DATA_PT_pathanim(CurveButtonsPanelCurve, Panel): def draw(self, context): layout = self.layout + layout.use_property_split = True curve = context.curve @@ -229,8 +245,9 @@ class DATA_PT_pathanim(CurveButtonsPanelCurve, Panel): col.prop(curve, "eval_time") # these are for paths only - row = layout.row() - row.prop(curve, "use_path_follow") + col.separator() + + col.prop(curve, "use_path_follow") class DATA_PT_active_spline(CurveButtonsPanelActive, Panel): @@ -238,65 +255,64 @@ class DATA_PT_active_spline(CurveButtonsPanelActive, Panel): def draw(self, context): layout = self.layout + layout.use_property_split = True curve = context.curve act_spline = curve.splines.active is_surf = type(curve) is SurfaceCurve is_poly = (act_spline.type == 'POLY') - split = layout.split() + col = layout.column() if is_poly: # These settings are below but its easier to have # polys set aside since they use so few settings - row = layout.row() - row.label(text="Cyclic:") - row.prop(act_spline, "use_cyclic_u", text="U") - layout.prop(act_spline, "use_smooth") + col.prop(act_spline, "use_cyclic_u") + col.prop(act_spline, "use_smooth") else: - col = split.column() - col.label(text="Cyclic:") - if act_spline.type == 'NURBS': - col.label(text="Bezier:") - col.label(text="Endpoint:") - col.label(text="Order:") - col.label(text="Resolution:") - - col = split.column() - col.prop(act_spline, "use_cyclic_u", text="U") + sub = col.column(align=True) + sub.prop(act_spline, "use_cyclic_u") + if is_surf: + sub.prop(act_spline, "use_cyclic_v", text="V") if act_spline.type == 'NURBS': - sub = col.column() + sub = col.column(align=True) # sub.active = (not act_spline.use_cyclic_u) - sub.prop(act_spline, "use_bezier_u", text="U") - sub.prop(act_spline, "use_endpoint_u", text="U") + sub.prop(act_spline, "use_bezier_u", text="Bezier U") - sub = col.column() - sub.prop(act_spline, "order_u", text="U") - col.prop(act_spline, "resolution_u", text="U") + if is_surf: + subsub = sub.column() + subsub.active = (not act_spline.use_cyclic_v) + subsub.prop(act_spline, "use_bezier_v", text="V") - if is_surf: - col = split.column() - col.prop(act_spline, "use_cyclic_v", text="V") + sub = col.column(align=True) + sub.prop(act_spline, "use_endpoint_u", text="Endpoint U") - # its a surface, assume its a nurbs - sub = col.column() - sub.active = (not act_spline.use_cyclic_v) - sub.prop(act_spline, "use_bezier_v", text="V") - sub.prop(act_spline, "use_endpoint_v", text="V") - sub = col.column() - sub.prop(act_spline, "order_v", text="V") + if is_surf: + subsub = sub.column() + subsub.active = (not act_spline.use_cyclic_v) + subsub.prop(act_spline, "use_endpoint_v", text="V") + + sub = col.column(align=True) + sub.prop(act_spline, "order_u", text="Order U") + + if is_surf: + sub.prop(act_spline, "order_v", text="V") + + sub = col.column(align=True) + sub.prop(act_spline, "resolution_u", text="Resolution U") + if is_surf: sub.prop(act_spline, "resolution_v", text="V") if act_spline.type == 'BEZIER': - col = layout.column() - col.label(text="Interpolation:") + + col.separator() sub = col.column() sub.active = (curve.dimensions == '3D') - sub.prop(act_spline, "tilt_interpolation", text="Tilt") + sub.prop(act_spline, "tilt_interpolation", text="Interpolation Tilt") col.prop(act_spline, "radius_interpolation", text="Radius") @@ -325,42 +341,46 @@ class DATA_PT_font(CurveButtonsPanelText, Panel): row.label(text="Bold & Italic") row.template_ID(text, "font_bold_italic", open="font.open", unlink="font.unlink") - # layout.prop(text, "font") + layout.separator() - split = layout.split() + row = layout.row(align=True) + row.prop(char, "use_bold", toggle=True) + row.prop(char, "use_italic", toggle=True) + row.prop(char, "use_underline", toggle=True) + row.prop(char, "use_small_caps", toggle=True) + + +class DATA_PT_font_transform(CurveButtonsPanelText, Panel): + bl_label = "Transform" + bl_parent_id = "DATA_PT_font" + + def draw(self, context): + layout = self.layout + + text = context.curve + char = context.curve.edit_format + + layout.use_property_split = True + + col = layout.column() + + col.separator() - col = split.column() col.prop(text, "size", text="Size") - col = split.column() col.prop(text, "shear") - split = layout.split() - - col = split.column() - col.label(text="Object Font:") - col.prop(text, "family", text="") + col.separator() - col = split.column() - col.label(text="Text on Curve:") - col.prop(text, "follow_curve", text="") + col.prop(text, "family") + col.prop(text, "follow_curve") - split = layout.split() + col.separator() - col = split.column() sub = col.column(align=True) - sub.label(text="Underline:") - sub.prop(text, "underline_position", text="Position") - sub.prop(text, "underline_height", text="Thickness") - - col = split.column() - col.label(text="Character:") - col.prop(char, "use_bold") - col.prop(char, "use_italic") - col.prop(char, "use_underline") + sub.prop(text, "underline_position", text="Underline Position") + sub.prop(text, "underline_height", text="Underline Thickness") - row = layout.row() - row.prop(text, "small_caps_scale", text="Small Caps") - row.prop(char, "use_small_caps") + col.prop(text, "small_caps_scale", text="Small Caps Scale") class DATA_PT_paragraph(CurveButtonsPanelText, Panel): @@ -371,23 +391,40 @@ class DATA_PT_paragraph(CurveButtonsPanelText, Panel): text = context.curve - layout.label(text="Horizontal Alignment:") - layout.row().prop(text, "align_x", expand=True) - layout.label(text="Vertical Alignment:") +class DATA_PT_paragraph_alignment(CurveButtonsPanelText, Panel): + bl_parent_id = "DATA_PT_paragraph" + bl_label = "Alignment" + + def draw(self, context): + layout = self.layout + layout.use_property_split = False + + text = context.curve + + layout.row().prop(text, "align_x", expand=True) layout.row().prop(text, "align_y", expand=True) - split = layout.split() - col = split.column(align=True) - col.label(text="Spacing:") - col.prop(text, "space_character", text="Letter") - col.prop(text, "space_word", text="Word") - col.prop(text, "space_line", text="Line") +class DATA_PT_paragraph_spacing(CurveButtonsPanelText, Panel): + bl_parent_id = "DATA_PT_paragraph" + bl_label = "Spacing" - col = split.column(align=True) - col.label(text="Offset:") - col.prop(text, "offset_x", text="X") + def draw(self, context): + layout = self.layout + layout.use_property_split = True + + text = context.curve + + col = layout.column(align=True) + col.prop(text, "space_character", text="Character Spacing") + col.prop(text, "space_word", text="Word Spacing") + col.prop(text, "space_line", text="Line Spacing") + + layout.separator() + + col = layout.column(align=True) + col.prop(text, "offset_x", text="Offset X") col.prop(text, "offset_y", text="Y") @@ -399,10 +436,7 @@ class DATA_PT_text_boxes(CurveButtonsPanelText, Panel): text = context.curve - split = layout.split() - col = split.column() - col.operator("font.textbox_add", icon='ZOOMIN') - col = split.column() + layout.operator("font.textbox_add", icon='ZOOMIN') for i, box in enumerate(text.text_boxes): @@ -410,25 +444,22 @@ class DATA_PT_text_boxes(CurveButtonsPanelText, Panel): row = boxy.row() - split = row.split() - - col = split.column(align=True) - - col.label(text="Dimensions:") - col.prop(box, "width", text="Width") - col.prop(box, "height", text="Height") + col = row.column() + col.use_property_split = True - col = split.column(align=True) + sub = col.column(align=True) + sub.prop(box, "width", text="Size X") + sub.prop(box, "height", text="Y") - col.label(text="Offset:") - col.prop(box, "x", text="X") - col.prop(box, "y", text="Y") + sub = col.column(align=True) + sub.prop(box, "x", text="Offset X") + sub.prop(box, "y", text="Y") row.operator("font.textbox_remove", text="", icon='X', emboss=False).index = i class DATA_PT_custom_props_curve(CurveButtonsPanel, PropertyPanel, Panel): - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} _context_path = "object.data" _property_type = bpy.types.Curve @@ -438,10 +469,14 @@ classes = ( DATA_PT_shape_curve, DATA_PT_curve_texture_space, DATA_PT_geometry_curve, + DATA_PT_geometry_curve_bevel, DATA_PT_pathanim, DATA_PT_active_spline, DATA_PT_font, + DATA_PT_font_transform, DATA_PT_paragraph, + DATA_PT_paragraph_alignment, + DATA_PT_paragraph_spacing, DATA_PT_text_boxes, DATA_PT_custom_props_curve, ) |