Extrude Widget: Add orientation to topbar

Add extrude operator that's intended to work on the current selection
and be activated as a tool.
This commit is contained in:
Campbell Barton
2018-05-07 21:30:55 +02:00
parent 170223804b
commit eefaec4114
6 changed files with 103 additions and 9 deletions

View File

@@ -367,14 +367,21 @@ class _defs_edit_mesh:
@ToolDef.from_fn
def extrude():
def draw_settings(context, layout):
wm = context.window_manager
props = wm.operator_properties_last("mesh.extrude_context_move")
props_xform = props.TRANSFORM_OT_translate
layout.prop(props_xform, "constraint_orientation")
return dict(
text="Extrude Region",
icon="ops.mesh.extrude_region_move",
widget="MESH_WGT_extrude",
keymap=(
("mesh.extrude_region_move", dict(TRANSFORM_OT_translate=dict(release_confirm=True)),
("mesh.extrude_context_move", dict(TRANSFORM_OT_translate=dict(release_confirm=True)),
dict(type='ACTIONMOUSE', value='PRESS')),
),
draw_settings=draw_settings,
)
@ToolDef.from_fn