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:
Diffstat (limited to 'release/scripts/startup/bl_ui/space_view3d.py')
-rw-r--r--release/scripts/startup/bl_ui/space_view3d.py121
1 files changed, 86 insertions, 35 deletions
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index a8624030564..995b2afebf0 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -109,8 +109,8 @@ class VIEW3D_HT_tool_header(Header):
if is_valid_context:
brush = context.tool_settings.gpencil_sculpt_paint.brush
tool = brush.gpencil_sculpt_tool
- if tool in {'SMOOTH', 'RANDOMIZE'}:
- layout.popover("VIEW3D_PT_tools_grease_pencil_sculpt_options")
+ if tool != 'CLONE':
+ layout.popover("VIEW3D_PT_tools_grease_pencil_sculpt_brush_popover")
layout.popover("VIEW3D_PT_tools_grease_pencil_sculpt_appearance")
elif tool_mode == 'WEIGHT_GPENCIL':
if is_valid_context:
@@ -151,6 +151,11 @@ class VIEW3D_HT_tool_header(Header):
row.popover(panel="VIEW3D_PT_sculpt_symmetry_for_topbar", text="")
elif mode_string == 'PAINT_VERTEX':
row.popover(panel="VIEW3D_PT_tools_vertexpaint_symmetry_for_topbar", text="")
+ elif mode_string == 'SCULPT_CURVES':
+ _row, sub = row_for_mirror()
+ sub.prop(context.object.data, "use_mirror_x", text="X", toggle=True)
+ sub.prop(context.object.data, "use_mirror_y", text="Y", toggle=True)
+ sub.prop(context.object.data, "use_mirror_z", text="Z", toggle=True)
# Expand panels from the side-bar as popovers.
popover_kw = {"space_type": 'VIEW_3D', "region_type": 'UI', "category": "Tool"}
@@ -241,7 +246,7 @@ class _draw_tool_settings_context_mode:
unified_name="use_unified_size",
text="Radius",
slider=True,
- header=True
+ header=True,
)
# strength, use_strength_pressure
@@ -254,7 +259,7 @@ class _draw_tool_settings_context_mode:
pressure_name=pressure_name,
unified_name="use_unified_strength",
text="Strength",
- header=True
+ header=True,
)
# direction
@@ -315,7 +320,7 @@ class _draw_tool_settings_context_mode:
"weight",
unified_name="use_unified_weight",
slider=True,
- header=True
+ header=True,
)
UnifiedPaintPanel.prop_unified(
@@ -327,7 +332,7 @@ class _draw_tool_settings_context_mode:
unified_name="use_unified_size",
slider=True,
text="Radius",
- header=True
+ header=True,
)
UnifiedPaintPanel.prop_unified(
layout,
@@ -336,7 +341,7 @@ class _draw_tool_settings_context_mode:
"strength",
pressure_name="use_pressure_strength",
unified_name="use_unified_strength",
- header=True
+ header=True,
)
return True
@@ -479,7 +484,6 @@ class _draw_tool_settings_context_mode:
tool_settings = context.tool_settings
paint = tool_settings.curves_sculpt
- layout.template_ID_preview(paint, "brush", rows=3, cols=8, hide_buttons=True)
brush = paint.brush
if brush is None:
@@ -491,9 +495,10 @@ class _draw_tool_settings_context_mode:
brush,
"size",
unified_name="use_unified_size",
+ pressure_name="use_pressure_size",
text="Radius",
slider=True,
- header=True
+ header=True,
)
if brush.curves_sculpt_tool not in {'ADD', 'DELETE'}:
@@ -503,31 +508,29 @@ class _draw_tool_settings_context_mode:
brush,
"strength",
unified_name="use_unified_strength",
- header=True
+ pressure_name="use_pressure_strength",
+ header=True,
)
if brush.curves_sculpt_tool == 'COMB':
layout.prop(brush, "falloff_shape", expand=True)
- layout.prop(brush, "curve_preset")
+ layout.popover("VIEW3D_PT_tools_brush_falloff")
if brush.curves_sculpt_tool == 'ADD':
- layout.prop(brush, "use_frontface")
layout.prop(brush, "falloff_shape", expand=True)
layout.prop(brush.curves_sculpt_settings, "add_amount")
- layout.prop(brush.curves_sculpt_settings, "curve_length")
- layout.prop(brush.curves_sculpt_settings, "interpolate_length")
- layout.prop(brush.curves_sculpt_settings, "interpolate_shape")
+ layout.popover("VIEW3D_PT_curves_sculpt_add_shape", text="Curve Shape")
+ layout.prop(brush, "use_frontface", text="Front Faces Only")
if brush.curves_sculpt_tool == 'GROW_SHRINK':
layout.prop(brush, "direction", expand=True, text="")
layout.prop(brush, "falloff_shape", expand=True)
- layout.prop(brush.curves_sculpt_settings, "scale_uniform")
- layout.prop(brush.curves_sculpt_settings, "minimum_length")
- layout.prop(brush, "curve_preset")
+ layout.popover("VIEW3D_PT_curves_sculpt_grow_shrink_scaling", text="Scaling")
+ layout.popover("VIEW3D_PT_tools_brush_falloff")
if brush.curves_sculpt_tool == 'SNAKE_HOOK':
layout.prop(brush, "falloff_shape", expand=True)
- layout.prop(brush, "curve_preset")
+ layout.popover("VIEW3D_PT_tools_brush_falloff")
if brush.curves_sculpt_tool == 'DELETE':
layout.prop(brush, "falloff_shape", expand=True)
@@ -2035,7 +2038,7 @@ class VIEW3D_MT_curve_add(Menu):
bl_idname = "VIEW3D_MT_curve_add"
bl_label = "Curve"
- def draw(self, _context):
+ def draw(self, context):
layout = self.layout
layout.operator_context = 'INVOKE_REGION_WIN'
@@ -2049,18 +2052,14 @@ class VIEW3D_MT_curve_add(Menu):
layout.operator("curve.primitive_nurbs_circle_add", text="Nurbs Circle", icon='CURVE_NCIRCLE')
layout.operator("curve.primitive_nurbs_path_add", text="Path", icon='CURVE_PATH')
+ experimental = context.preferences.experimental
+ if experimental.use_new_curves_type:
+ layout.separator()
-class VIEW3D_MT_curves_add(Menu):
- bl_idname = "VIEW3D_MT_curves_add"
- bl_label = "Curves"
-
- def draw(self, _context):
- layout = self.layout
-
- layout.operator_context = 'INVOKE_REGION_WIN'
+ layout.operator("object.curves_empty_hair_add", text="Empty Hair", icon='CURVES_DATA')
- layout.operator("object.curves_empty_hair_add", text="Empty Hair", icon='CURVES_DATA')
- layout.operator("object.curves_random_add", text="Random", icon='CURVES_DATA')
+ if experimental.use_new_curves_tools:
+ layout.operator("object.curves_random_add", text="Random", icon='CURVES_DATA')
class VIEW3D_MT_surface_add(Menu):
@@ -2215,8 +2214,6 @@ class VIEW3D_MT_add(Menu):
# layout.operator_menu_enum("object.curve_add", "type", text="Curve", icon='OUTLINER_OB_CURVE')
layout.menu("VIEW3D_MT_curve_add", icon='OUTLINER_OB_CURVE')
- if context.preferences.experimental.use_new_curves_type:
- layout.menu("VIEW3D_MT_curves_add", icon='OUTLINER_OB_CURVES')
# layout.operator_menu_enum("object.surface_add", "type", text="Surface", icon='OUTLINER_OB_SURFACE')
layout.menu("VIEW3D_MT_surface_add", icon='OUTLINER_OB_SURFACE')
layout.menu("VIEW3D_MT_metaball_add", text="Metaball", icon='OUTLINER_OB_META')
@@ -2345,6 +2342,7 @@ class VIEW3D_MT_object(Menu):
layout.separator()
layout.operator("object.shade_smooth")
+ layout.operator("object.shade_smooth", text="Shade Auto Smooth").use_auto_smooth = True
layout.operator("object.shade_flat")
layout.separator()
@@ -2587,7 +2585,8 @@ class VIEW3D_MT_object_context_menu(Menu):
# Shared among some object types.
if obj is not None:
if obj.type in {'MESH', 'CURVE', 'SURFACE'}:
- layout.operator("object.shade_smooth", text="Shade Smooth")
+ layout.operator("object.shade_smooth")
+ layout.operator("object.shade_smooth", text="Shade Auto Smooth").use_auto_smooth = True
layout.operator("object.shade_flat", text="Shade Flat")
layout.separator()
@@ -3147,7 +3146,9 @@ class VIEW3D_MT_sculpt_curves(Menu):
def draw(self, _context):
layout = self.layout
- layout.operator("curves.snap_curves_to_surface")
+ layout.operator("curves.snap_curves_to_surface", text="Snap to Deformed Surface").attach_mode = 'DEFORM'
+ layout.operator("curves.snap_curves_to_surface", text="Snap to Nearest Surface").attach_mode = 'NEAREST'
+ layout.separator()
layout.operator("curves.convert_to_particle_system", text="Convert to Particle System")
@@ -7612,6 +7613,55 @@ class TOPBAR_PT_gpencil_vertexcolor(GreasePencilVertexcolorPanel, Panel):
return ob and ob.type == 'GPENCIL'
+class VIEW3D_PT_curves_sculpt_add_shape(Panel):
+ # Only for popover, these are dummy values.
+ bl_space_type = 'VIEW_3D'
+ bl_region_type = 'WINDOW'
+ bl_label = "Curves Sculpt Add Curve Options"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.use_property_split = True
+ layout.use_property_decorate = False # No animation.
+
+ settings = UnifiedPaintPanel.paint_settings(context)
+ brush = settings.brush
+
+ col = layout.column(heading="Interpolate", align=True)
+ col.prop(brush.curves_sculpt_settings, "interpolate_length", text="Length")
+ col.prop(brush.curves_sculpt_settings, "interpolate_shape", text="Shape")
+ col.prop(brush.curves_sculpt_settings, "interpolate_point_count", text="Point Count")
+
+ col = layout.column()
+ col.active = not brush.curves_sculpt_settings.interpolate_length
+ col.prop(brush.curves_sculpt_settings, "curve_length", text="Length")
+
+ col = layout.column()
+ col.active = not brush.curves_sculpt_settings.interpolate_point_count
+ col.prop(brush.curves_sculpt_settings, "points_per_curve", text="Points")
+
+
+class VIEW3D_PT_curves_sculpt_grow_shrink_scaling(Panel):
+ # Only for popover, these are dummy values.
+ bl_space_type = 'VIEW_3D'
+ bl_region_type = 'WINDOW'
+ bl_label = "Curves Grow/Shrink Scaling"
+ bl_ui_units_x = 12
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.use_property_split = True
+ layout.use_property_decorate = False # No animation.
+
+ settings = UnifiedPaintPanel.paint_settings(context)
+ brush = settings.brush
+
+ layout.prop(brush.curves_sculpt_settings, "scale_uniform")
+ layout.prop(brush.curves_sculpt_settings, "minimum_length")
+
+
classes = (
VIEW3D_HT_header,
VIEW3D_HT_tool_header,
@@ -7654,7 +7704,6 @@ classes = (
VIEW3D_MT_angle_control,
VIEW3D_MT_mesh_add,
VIEW3D_MT_curve_add,
- VIEW3D_MT_curves_add,
VIEW3D_MT_surface_add,
VIEW3D_MT_edit_metaball_context_menu,
VIEW3D_MT_metaball_add,
@@ -7844,6 +7893,8 @@ classes = (
TOPBAR_PT_gpencil_materials,
TOPBAR_PT_gpencil_vertexcolor,
TOPBAR_PT_annotation_layers,
+ VIEW3D_PT_curves_sculpt_add_shape,
+ VIEW3D_PT_curves_sculpt_grow_shrink_scaling,
)