UI: Add Placement Settings to the Options popover #107854

Open
Germano Cavalcante wants to merge 9 commits from mano-wii/blender:snap_menu_placement into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
2 changed files with 32 additions and 19 deletions

View File

@ -126,6 +126,9 @@ class _defs_view3d_generic:
@ToolDef.from_fn
def ruler():
def draw_settings(context, layout, _tool):
layout.prop(context.tool_settings, "snap_elements_tool")
def description(_context, _item, km):
if km is not None:
kmi_add = km.keymap_items.find_from_operator("view3d.ruler_add")
@ -151,6 +154,7 @@ class _defs_view3d_generic:
icon="ops.view3d.ruler",
widget="VIEW3D_GGT_ruler",
keymap="3D View Tool: Measure",
draw_settings=draw_settings,
)
@ -505,16 +509,9 @@ class _defs_view3d_add:
def draw_settings_interactive_add(layout, tool_settings, tool, extra):
show_extra = False
if not extra:
row = layout.row()
row.label(text="Depth:")
row = layout.row()
row.prop(tool_settings, "plane_depth", text="")
row = layout.row()
row.label(text="Orientation:")
row = layout.row()
row.prop(tool_settings, "plane_orientation", text="")
row = layout.row()
row.prop(tool_settings, "snap_elements_tool")
layout.row().prop(tool_settings, "plane_depth", text="Depth")
layout.row().prop(tool_settings, "plane_orientation")
layout.row().prop(tool_settings, "snap_elements_tool")
region_is_header = bpy.context.region.type == 'TOOL_HEADER'
if region_is_header:

View File

@ -107,15 +107,6 @@ def draw_vpaint_symmetry(layout, vpaint, obj):
col.prop(vpaint, "radial_symmetry", text="Radial")
# Most of these panels should not be visible in GP edit modes
def is_not_gpencil_edit_mode(context):
is_gpmode = (
context.active_object and
context.active_object.mode in {'EDIT_GPENCIL', 'PAINT_GPENCIL', 'SCULPT_GPENCIL', 'WEIGHT_GPENCIL'}
)
return not is_gpmode
# ********** default tools for object mode ****************

The Transform is center aligned, where as the Placement is left aligned which looks a bit off, perhaps both could be aligned left, don't think it's a blocker for this patch though.

The `Transform` is center aligned, where as the `Placement` is left aligned which looks a bit off, perhaps both could be aligned left, don't think it's a blocker for this patch though.
@ -149,6 +140,30 @@ class VIEW3D_PT_tools_object_options_transform(View3DPanel, Panel):
col.prop(tool_settings, "use_transform_skip_children", text="Parents")
class VIEW3D_PT_tools_object_options_dragdrop(View3DPanel, Panel):
bl_category = "Tool"
bl_context = ".objectmode" # dot on purpose (access from topbar)
bl_label = "Drag & Drop"
bl_parent_id = "VIEW3D_PT_tools_object_options"
bl_options = {'DEFAULT_CLOSED'}
def draw(self, context):
layout = self.layout
tool_settings = context.tool_settings
layout.use_property_split = True
layout.use_property_decorate = False
col = layout.column(align=False)
col.prop(tool_settings, "plane_depth", text="Depth")
col.prop(tool_settings, "plane_orientation")
col.prop(tool_settings, "snap_elements_tool")
sub = col.row(align=True)
sub.active = not tool_settings.plane_axis_auto
sub.prop(tool_settings, "plane_axis")
col.prop(tool_settings, "plane_axis_auto")
# ********** default tools for editmode_mesh ****************
@ -2372,6 +2387,7 @@ classes = (
VIEW3D_MT_brush_gpencil_context_menu,
VIEW3D_PT_tools_object_options,
VIEW3D_PT_tools_object_options_transform,
VIEW3D_PT_tools_object_options_dragdrop,
VIEW3D_PT_tools_meshedit_options,
VIEW3D_PT_tools_meshedit_options_transform,
VIEW3D_PT_tools_meshedit_options_uvs,