diff options
Diffstat (limited to 'release/scripts/startup/bl_ui/space_view3d.py')
-rw-r--r-- | release/scripts/startup/bl_ui/space_view3d.py | 221 |
1 files changed, 179 insertions, 42 deletions
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 5e5e7a79035..a687f3c937f 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -535,6 +535,31 @@ class _draw_tool_settings_context_mode: layout.prop(brush, "direction", expand=True, text="") layout.prop(brush, "falloff_shape", expand=True) layout.popover("VIEW3D_PT_tools_brush_falloff") + elif curves_tool == 'PINCH': + layout.prop(brush, "direction", expand=True, text="") + layout.prop(brush, "falloff_shape", expand=True) + layout.popover("VIEW3D_PT_tools_brush_falloff") + elif curves_tool == 'SMOOTH': + layout.prop(brush, "falloff_shape", expand=True) + layout.popover("VIEW3D_PT_tools_brush_falloff") + elif curves_tool == 'PUFF': + layout.prop(brush, "falloff_shape", expand=True) + layout.popover("VIEW3D_PT_tools_brush_falloff") + elif curves_tool == 'DENSITY': + layout.prop(brush, "falloff_shape", expand=True) + row = layout.row(align=True) + row.prop(brush.curves_sculpt_settings, "density_mode", text="", expand=True) + row = layout.row(align=True) + row.prop(brush.curves_sculpt_settings, "minimum_distance", text="Distance Min") + row.operator_context = 'INVOKE_REGION_WIN' + row.operator("sculpt_curves.min_distance_edit", text="", icon='DRIVER_DISTANCE') + row = layout.row(align=True) + row.enabled = brush.curves_sculpt_settings.density_mode != 'REMOVE' + row.prop(brush.curves_sculpt_settings, "density_add_attempts", text="Count Max") + layout.popover("VIEW3D_PT_tools_brush_falloff") + layout.popover("VIEW3D_PT_curves_sculpt_add_shape", text="Curve Shape") + elif curves_tool == "SLIDE": + layout.popover("VIEW3D_PT_tools_brush_falloff") class VIEW3D_HT_header(Header): @@ -578,8 +603,8 @@ class VIEW3D_HT_header(Header): show_snap = True else: if (object_mode not in { - 'SCULPT', 'VERTEX_PAINT', 'WEIGHT_PAINT', 'TEXTURE_PAINT', - 'PAINT_GPENCIL', 'SCULPT_GPENCIL', 'WEIGHT_GPENCIL', 'VERTEX_GPENCIL' + 'SCULPT', 'SCULPT_CURVES', 'VERTEX_PAINT', 'WEIGHT_PAINT', 'TEXTURE_PAINT', + 'PAINT_GPENCIL', 'SCULPT_GPENCIL', 'WEIGHT_GPENCIL', 'VERTEX_GPENCIL', }) or has_pose_mode: show_snap = True else: @@ -693,19 +718,17 @@ class VIEW3D_HT_header(Header): row = layout.row(align=True) - experimental = context.preferences.experimental - if experimental.use_new_curves_tools: - # Combine the "use selection" toggle with the "set domain" operators - # to allow turning selection off directly. - domain = curves.selection_domain - if domain == 'POINT': - row.prop(curves, "use_sculpt_selection", text="", icon='CURVE_BEZCIRCLE') - else: - row.operator("curves.set_selection_domain", text="", icon='CURVE_BEZCIRCLE').domain = 'POINT' - if domain == 'CURVE': - row.prop(curves, "use_sculpt_selection", text="", icon='CURVE_PATH') - else: - row.operator("curves.set_selection_domain", text="", icon='CURVE_PATH').domain = 'CURVE' + # Combine the "use selection" toggle with the "set domain" operators + # to allow turning selection off directly. + domain = curves.selection_domain + if domain == 'POINT': + row.prop(curves, "use_sculpt_selection", text="", icon='CURVE_BEZCIRCLE') + else: + row.operator("curves.set_selection_domain", text="", icon='CURVE_BEZCIRCLE').domain = 'POINT' + if domain == 'CURVE': + row.prop(curves, "use_sculpt_selection", text="", icon='CURVE_PATH') + else: + row.operator("curves.set_selection_domain", text="", icon='CURVE_PATH').domain = 'CURVE' # Grease Pencil if obj and obj.type == 'GPENCIL' and context.gpencil_data: @@ -2005,6 +2028,9 @@ class VIEW3D_MT_select_sculpt_curves(Menu): layout.operator("sculpt_curves.select_all", text="All").action = 'SELECT' layout.operator("sculpt_curves.select_all", text="None").action = 'DESELECT' layout.operator("sculpt_curves.select_all", text="Invert").action = 'INVERT' + layout.operator("sculpt_curves.select_random", text="Random") + layout.operator("sculpt_curves.select_end", text="Endpoints") + layout.operator("sculpt_curves.select_grow", text="Grow") class VIEW3D_MT_angle_control(Menu): @@ -2083,14 +2109,13 @@ 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() + layout.separator() - 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') - if experimental.use_new_curves_tools: - layout.operator("object.curves_random_add", text="Random", icon='CURVES_DATA') + experimental = context.preferences.experimental + if experimental.use_new_curves_tools: + layout.operator("object.curves_random_add", text="Random", icon='CURVES_DATA') class VIEW3D_MT_surface_add(Menu): @@ -2187,6 +2212,7 @@ class VIEW3D_MT_armature_add(Menu): class VIEW3D_MT_light_add(Menu): bl_idname = "VIEW3D_MT_light_add" + bl_context = i18n_contexts.id_light bl_label = "Light" def draw(self, _context): @@ -2224,7 +2250,9 @@ class VIEW3D_MT_volume_add(Menu): def draw(self, _context): layout = self.layout layout.operator("object.volume_import", text="Import OpenVDB...", icon='OUTLINER_DATA_VOLUME') - layout.operator("object.volume_add", text="Empty", icon='OUTLINER_DATA_VOLUME') + layout.operator("object.volume_add", text="Empty", + text_ctxt=i18n_contexts.id_volume, + icon='OUTLINER_DATA_VOLUME') class VIEW3D_MT_add(Menu): @@ -2265,7 +2293,9 @@ class VIEW3D_MT_add(Menu): layout.separator() - layout.operator_menu_enum("object.empty_add", "type", text="Empty", icon='OUTLINER_OB_EMPTY') + layout.operator_menu_enum("object.empty_add", "type", text="Empty", + text_ctxt=i18n_contexts.id_id, + icon='OUTLINER_OB_EMPTY') layout.menu("VIEW3D_MT_image_add", text="Image", icon='OUTLINER_OB_IMAGE') layout.separator() @@ -2326,8 +2356,6 @@ class VIEW3D_MT_object_relations(Menu): layout = self.layout layout.operator("object.make_override_library", text="Make Library Override...") - layout.operator("object.make_override_library", - text="Make Library Override - Fully Editable...").do_fully_editable = True layout.operator("object.make_dupli_face") @@ -2337,6 +2365,17 @@ class VIEW3D_MT_object_relations(Menu): layout.menu("VIEW3D_MT_make_single_user") +class VIEW3D_MT_object_liboverride(Menu): + bl_label = "Library Override" + + def draw(self, _context): + layout = self.layout + + layout.operator("object.make_override_library", text="Make") + layout.operator("object.reset_override_library", text="Reset") + layout.operator("object.clear_override_library", text="Clear") + + class VIEW3D_MT_object(Menu): bl_context = "objectmode" bl_label = "Object" @@ -2368,6 +2407,7 @@ class VIEW3D_MT_object(Menu): layout.menu("VIEW3D_MT_object_parent") layout.menu("VIEW3D_MT_object_collection") layout.menu("VIEW3D_MT_object_relations") + layout.menu("VIEW3D_MT_object_liboverride") layout.menu("VIEW3D_MT_object_constraints") layout.menu("VIEW3D_MT_object_track") layout.menu("VIEW3D_MT_make_links") @@ -5113,6 +5153,7 @@ class VIEW3D_MT_edit_gpencil_stroke(Menu): layout.operator("gpencil.stroke_subdivide", text="Subdivide").only_selected = False layout.menu("VIEW3D_MT_gpencil_simplify") layout.operator("gpencil.stroke_trim", text="Trim") + layout.operator("gpencil.stroke_outline", text="Outline") layout.separator() @@ -5134,11 +5175,12 @@ class VIEW3D_MT_edit_gpencil_stroke(Menu): layout.operator("gpencil.stroke_cyclical_set", text="Toggle Cyclic").type = 'TOGGLE' layout.operator_menu_enum("gpencil.stroke_caps_set", text="Toggle Caps", property="type") layout.operator("gpencil.stroke_flip", text="Switch Direction") - layout.prop(settings, "use_scale_thickness", text="Scale Thickness") + layout.operator("gpencil.stroke_start_set", text="Set Start Point") layout.separator() layout.operator("gpencil.stroke_normalize", text="Normalize Thickness").mode = 'THICKNESS' layout.operator("gpencil.stroke_normalize", text="Normalize Opacity").mode = 'OPACITY' + layout.prop(settings, "use_scale_thickness", text="Scale Thickness") layout.separator() layout.operator("gpencil.reset_transform_fill", text="Reset Fill Transform") @@ -6105,6 +6147,24 @@ class VIEW3D_PT_shading_render_pass(Panel): layout.prop(shading, "render_pass", text="") +class VIEW3D_PT_shading_compositor(Panel): + bl_space_type = 'VIEW_3D' + bl_region_type = 'HEADER' + bl_label = "Compositor" + bl_parent_id = 'VIEW3D_PT_shading' + + @classmethod + def poll(cls, context): + return (context.space_data.shading.type in {'MATERIAL', 'RENDERED'} and + context.preferences.experimental.use_realtime_compositor) + + def draw(self, context): + shading = context.space_data.shading + + layout = self.layout + layout.prop(shading, "use_compositor") + + class VIEW3D_PT_gizmo_display(Panel): bl_space_type = 'VIEW_3D' bl_region_type = 'HEADER' @@ -6621,6 +6681,30 @@ class VIEW3D_PT_overlay_sculpt(Panel): row.prop(overlay, "sculpt_mode_face_sets_opacity", text="Face Sets") +class VIEW3D_PT_overlay_sculpt_curves(Panel): + bl_space_type = 'VIEW_3D' + bl_context = ".curves_sculpt" + bl_region_type = 'HEADER' + bl_parent_id = 'VIEW3D_PT_overlay' + bl_label = "Sculpt" + + @classmethod + def poll(cls, context): + return context.mode == 'SCULPT_CURVES' and (context.object) + + def draw(self, context): + layout = self.layout + tool_settings = context.tool_settings + sculpt = tool_settings.sculpt + + view = context.space_data + overlay = view.overlay + + row = layout.row(align=True) + row.active = overlay.show_overlays + row.prop(overlay, "sculpt_mode_mask_opacity", text="Selection Opacity") + + class VIEW3D_PT_overlay_bones(Panel): bl_space_type = 'VIEW_3D' bl_region_type = 'HEADER' @@ -6773,23 +6857,53 @@ class VIEW3D_PT_snapping(Panel): col.prop(tool_settings, "use_snap_grid_absolute") if snap_elements != {'INCREMENT'}: - col.label(text="Snap With") - row = col.row(align=True) - row.prop(tool_settings, "snap_target", expand=True) - - col.prop(tool_settings, "use_snap_backface_culling") + if snap_elements != {'FACE_NEAREST'}: + col.label(text="Snap With") + row = col.row(align=True) + row.prop(tool_settings, "snap_target", expand=True) if obj: + col.label(text="Target Selection") + col_targetsel = col.column(align=True) if object_mode == 'EDIT' and obj.type not in {'LATTICE', 'META', 'FONT'}: - sub = col.column() - sub.active = not (tool_settings.use_proportional_edit and obj.type == 'MESH') - sub.prop(tool_settings, "use_snap_self") + col_targetsel.prop( + tool_settings, + "use_snap_self", + text="Include Active", + icon='EDITMODE_HLT', + ) + col_targetsel.prop( + tool_settings, + "use_snap_edit", + text="Include Edited", + icon='OUTLINER_DATA_MESH', + ) + col_targetsel.prop( + tool_settings, + "use_snap_nonedit", + text="Include Non-Edited", + icon='OUTLINER_OB_MESH', + ) + col_targetsel.prop( + tool_settings, + "use_snap_selectable", + text="Exclude Non-Selectable", + icon='RESTRICT_SELECT_OFF', + ) + if object_mode in {'OBJECT', 'POSE', 'EDIT', 'WEIGHT_PAINT'}: col.prop(tool_settings, "use_snap_align_rotation") + col.prop(tool_settings, "use_snap_backface_culling") + if 'FACE' in snap_elements: col.prop(tool_settings, "use_snap_project") + if 'FACE_NEAREST' in snap_elements: + col.prop(tool_settings, 'use_snap_to_same_target') + if object_mode == 'EDIT': + col.prop(tool_settings, 'snap_face_nearest_steps') + if 'VOLUME' in snap_elements: col.prop(tool_settings, "use_snap_peel_object") @@ -6970,13 +7084,13 @@ class VIEW3D_PT_overlay_gpencil_options(Panel): row.prop(overlay, "use_gpencil_fade_layers", text="") sub = row.row() sub.active = overlay.use_gpencil_fade_layers - sub.prop(overlay, "gpencil_fade_layer", text="Fade Layers", slider=True) + sub.prop(overlay, "gpencil_fade_layer", text="Fade Inactive Layers", slider=True) row = col.row() row.prop(overlay, "use_gpencil_fade_objects", text="") sub = row.row(align=True) sub.active = overlay.use_gpencil_fade_objects - sub.prop(overlay, "gpencil_fade_objects", text="Fade Objects", slider=True) + sub.prop(overlay, "gpencil_fade_objects", text="Fade Inactive Objects", slider=True) sub.prop(overlay, "use_gpencil_fade_gp_objects", text="", icon='OUTLINER_OB_GREASEPENCIL') if context.object.mode in {'EDIT_GPENCIL', 'SCULPT_GPENCIL', 'WEIGHT_GPENCIL', 'VERTEX_GPENCIL'}: @@ -6987,18 +7101,17 @@ class VIEW3D_PT_overlay_gpencil_options(Panel): col.prop(overlay, "use_gpencil_multiedit_line_only", text="Only in Multiframe") if context.object.mode == 'EDIT_GPENCIL': + gpd = context.object.data split = layout.split() col = split.column() col.prop(overlay, "use_gpencil_show_directions") col = split.column() col.prop(overlay, "use_gpencil_show_material_name", text="Material Name") - layout.prop(overlay, "vertex_opacity", text="Vertex Opacity", slider=True) - - # Handles for Curve Edit - if context.object.mode == 'EDIT_GPENCIL': - gpd = context.object.data - if gpd.use_curve_edit: + if not gpd.use_curve_edit: + layout.prop(overlay, "vertex_opacity", text="Vertex Opacity", slider=True) + else: + # Handles for Curve Edit layout.prop(overlay, "display_handle", text="Handles") if context.object.mode in {'PAINT_GPENCIL', 'VERTEX_GPENCIL'}: @@ -7217,6 +7330,7 @@ class VIEW3D_MT_gpencil_edit_context_menu(Menu): col.operator("transform.shear", text="Shear") col.operator("transform.tosphere", text="To Sphere") col.operator("transform.transform", text="Shrink/Fatten").mode = 'GPENCIL_SHRINKFATTEN' + col.operator("gpencil.stroke_start_set", text="Set Start Point") col.separator() @@ -7695,6 +7809,25 @@ class VIEW3D_PT_curves_sculpt_grow_shrink_scaling(Panel): layout.prop(brush.curves_sculpt_settings, "minimum_length") +class VIEW3D_PT_viewport_debug(Panel): + bl_space_type = 'VIEW_3D' + bl_region_type = 'HEADER' + bl_parent_id = 'VIEW3D_PT_overlay' + bl_label = "Viewport Debug" + + @classmethod + def poll(cls, context): + prefs = context.preferences + return prefs.experimental.use_viewport_debug + + def draw(self, context): + layout = self.layout + view = context.space_data + overlay = view.overlay + + layout.prop(overlay, "use_debug_freeze_view_culling") + + classes = ( VIEW3D_HT_header, VIEW3D_HT_tool_header, @@ -7760,6 +7893,7 @@ classes = ( VIEW3D_MT_object_shading, VIEW3D_MT_object_apply, VIEW3D_MT_object_relations, + VIEW3D_MT_object_liboverride, VIEW3D_MT_object_parent, VIEW3D_MT_object_track, VIEW3D_MT_object_collection, @@ -7891,6 +8025,7 @@ classes = ( VIEW3D_PT_shading_options_shadow, VIEW3D_PT_shading_options_ssao, VIEW3D_PT_shading_render_pass, + VIEW3D_PT_shading_compositor, VIEW3D_PT_gizmo_display, VIEW3D_PT_overlay, VIEW3D_PT_overlay_guides, @@ -7908,6 +8043,7 @@ classes = ( VIEW3D_PT_overlay_weight_paint, VIEW3D_PT_overlay_bones, VIEW3D_PT_overlay_sculpt, + VIEW3D_PT_overlay_sculpt_curves, VIEW3D_PT_snapping, VIEW3D_PT_proportional_edit, VIEW3D_PT_gpencil_origin, @@ -7929,6 +8065,7 @@ classes = ( TOPBAR_PT_annotation_layers, VIEW3D_PT_curves_sculpt_add_shape, VIEW3D_PT_curves_sculpt_grow_shrink_scaling, + VIEW3D_PT_viewport_debug, ) |