Transform: Always allow navigation with Transform #109388

Merged
Germano Cavalcante merged 3 commits from mano-wii/blender:transform-navigation-default into main 2023-06-27 20:29:13 +02:00
9 changed files with 82 additions and 155 deletions

View File

@ -87,9 +87,21 @@ def keyconfig_update(keyconfig_data, keyconfig_version):
keyconfig_data = copy.deepcopy(keyconfig_data)
has_copy = True
# "Snap Source Toggle" did not exist until then.
for km_name, _km_parms, km_items_data in keyconfig_data:
if km_name == "Transform Modal Map":
# Navigation during transform is now not optional and conflicts need to be resolved.
for (item_modal, item_event, _item_prop) in km_items_data["items"]:
if item_modal in {
"PROPORTIONAL_SIZE_UP",
"PROPORTIONAL_SIZE_DOWN",
"PROPORTIONAL_SIZE",
"AUTOIK_CHAIN_LEN_UP",
"AUTOIK_CHAIN_LEN_DOWN",
"AUTOCONSTRAIN",
"AUTOCONSTRAINPLANE"}:
item_event["alt"] = True
# "Snap Source Toggle" did not exist until then.
km_items_data["items"].extend(("EDIT_SNAP_SOURCE_ON", {"type": 'B', "value": 'PRESS'}, None))
km_items_data["items"].append(("EDIT_SNAP_SOURCE_OFF", {"type": 'B', "value": 'PRESS'}, None))
break

View File

@ -252,15 +252,6 @@ class Prefs(bpy.types.KeyConfigPreferences):
update=update_fn,
)
use_transform_navigation: BoolProperty(
name="Navigate during Transform",
description=(
"Enable view navigation while using transform operators. "
"Proportional Influence, Automatic Constraints and Auto IK Chain Length shortcuts will require holding Alt key"),
default=False,
update=update_fn,
)
def draw(self, layout):
from bpy import context
@ -324,7 +315,6 @@ class Prefs(bpy.types.KeyConfigPreferences):
sub.prop(self, "use_v3d_tab_menu")
sub.prop(self, "use_pie_click_drag")
sub.prop(self, "use_v3d_shade_ex_pie")
sub.prop(self, "use_transform_navigation")
# File Browser settings.
col = layout.column()
@ -385,7 +375,6 @@ def load():
use_pie_click_drag=kc_prefs.use_pie_click_drag,
use_file_single_click=kc_prefs.use_file_single_click,
experimental=prefs.experimental,
use_transform_navigation=kc_prefs.use_transform_navigation,
),
)

View File

@ -99,8 +99,6 @@ class Params:
"tool_maybe_tweak_event",
# Access to bpy.context.preferences.experimental
"experimental",
# Changes some transformers modal key-map items to avoid conflicts with navigation operations
"use_transform_navigation",
)
def __init__(
@ -129,7 +127,6 @@ class Params:
v3d_tilde_action='VIEW',
v3d_alt_mmb_drag_action='RELATIVE',
experimental=None,
use_transform_navigation=False,
):
from sys import platform
self.apple = (platform == 'darwin')
@ -228,7 +225,6 @@ class Params:
self.pie_value = 'CLICK_DRAG' if use_pie_click_drag else 'PRESS'
self.tool_tweak_event = {"type": self.tool_mouse, "value": 'CLICK_DRAG'}
self.tool_maybe_tweak_event = {"type": self.tool_mouse, "value": self.tool_maybe_tweak_value}
self.use_transform_navigation = use_transform_navigation
self.experimental = experimental
@ -1608,16 +1604,13 @@ def km_view3d(params):
# Transform.
("transform.translate", {"type": params.select_mouse, "value": 'CLICK_DRAG'}, None),
op_tool_optional(
("transform.translate", {"type": 'G', "value": 'PRESS'},
{"properties": [("allow_navigation", params.use_transform_navigation)]}),
("transform.translate", {"type": 'G', "value": 'PRESS'}, None),
(op_tool_cycle, "builtin.move"), params),
op_tool_optional(
("transform.rotate", {"type": 'R', "value": 'PRESS'},
{"properties": [("allow_navigation", params.use_transform_navigation)]}),
("transform.rotate", {"type": 'R', "value": 'PRESS'}, None),
(op_tool_cycle, "builtin.rotate"), params),
op_tool_optional(
("transform.resize", {"type": 'S', "value": 'PRESS'},
{"properties": [("allow_navigation", params.use_transform_navigation)]}),
("transform.resize", {"type": 'S', "value": 'PRESS'}, None),
(op_tool_cycle, "builtin.scale"), params),
op_tool_optional(
("transform.tosphere", {"type": 'S', "value": 'PRESS', "shift": True, "alt": True}, None),
@ -3675,8 +3668,7 @@ def km_grease_pencil_stroke_edit_mode(params):
("gpencil.duplicate_move", {"type": 'D', "value": 'PRESS', "shift": True}, None),
# Extrude and move selected points
op_tool_optional(
("gpencil.extrude_move", {"type": 'E', "value": 'PRESS'},
{"properties": [("TRANSFORM_OT_translate", [("allow_navigation", params.use_transform_navigation)])]}),
("gpencil.extrude_move", {"type": 'E', "value": 'PRESS'}, None),
(op_tool_cycle, "builtin.extrude"), params),
# Delete
op_menu("VIEW3D_MT_edit_gpencil_delete", {"type": 'X', "value": 'PRESS'}),
@ -4685,10 +4677,8 @@ def km_object_mode(params):
op_menu("VIEW3D_MT_add", {"type": 'A', "value": 'PRESS', "shift": True}),
op_menu("VIEW3D_MT_object_apply", {"type": 'A', "value": 'PRESS', "ctrl": True}),
op_menu("VIEW3D_MT_make_links", {"type": 'L', "value": 'PRESS', "ctrl": True}),
("object.duplicate_move", {"type": 'D', "value": 'PRESS', "shift": True},
{"properties": [("TRANSFORM_OT_translate", [("allow_navigation", params.use_transform_navigation)])]}),
("object.duplicate_move_linked", {"type": 'D', "value": 'PRESS', "alt": True},
{"properties": [("TRANSFORM_OT_translate", [("allow_navigation", params.use_transform_navigation)])]}),
("object.duplicate_move", {"type": 'D', "value": 'PRESS', "shift": True}, None),
("object.duplicate_move_linked", {"type": 'D', "value": 'PRESS', "alt": True}, None),
("object.join", {"type": 'J', "value": 'PRESS', "ctrl": True}, None),
("wm.context_toggle", {"type": 'PERIOD', "value": 'PRESS', "ctrl": True},
{"properties": [("data_path", 'tool_settings.use_transform_data_origin')]}),
@ -4754,13 +4744,10 @@ def km_paint_curve(params):
("paintcurve.delete_point", {"type": 'DEL', "value": 'PRESS'}, None),
("paintcurve.draw", {"type": 'RET', "value": 'PRESS'}, None),
("paintcurve.draw", {"type": 'NUMPAD_ENTER', "value": 'PRESS'}, None),
("transform.translate", {"type": 'G', "value": 'PRESS'},
{"properties": [("allow_navigation", params.use_transform_navigation)]}),
("transform.translate", {"type": 'G', "value": 'PRESS'}, None),
("transform.translate", {"type": params.select_mouse, "value": 'CLICK_DRAG'}, None),
("transform.rotate", {"type": 'R', "value": 'PRESS'},
{"properties": [("allow_navigation", params.use_transform_navigation)]}),
("transform.resize", {"type": 'S', "value": 'PRESS'},
{"properties": [("allow_navigation", params.use_transform_navigation)]}),
("transform.rotate", {"type": 'R', "value": 'PRESS'}, None),
("transform.resize", {"type": 'S', "value": 'PRESS'}, None),
])
return keymap
@ -4793,8 +4780,7 @@ def km_curve(params):
("curve.separate", {"type": 'P', "value": 'PRESS'}, None),
("curve.split", {"type": 'Y', "value": 'PRESS'}, None),
op_tool_optional(
("curve.extrude_move", {"type": 'E', "value": 'PRESS'},
{"properties": [("TRANSFORM_OT_translate", [("allow_navigation", params.use_transform_navigation)])]}),
("curve.extrude_move", {"type": 'E', "value": 'PRESS'}, None),
(op_tool_cycle, "builtin.extrude"), params),
("curve.duplicate_move", {"type": 'D', "value": 'PRESS', "shift": True}, None),
("curve.make_segment", {"type": 'F', "value": 'PRESS'}, None),
@ -5403,8 +5389,7 @@ def km_mesh(params):
("mesh.normals_make_consistent", {"type": 'N', "value": 'PRESS', "shift": True, "ctrl": True},
{"properties": [("inside", True)]}),
op_tool_optional(
("view3d.edit_mesh_extrude_move_normal", {"type": 'E', "value": 'PRESS'},
{"properties": [("allow_navigation", params.use_transform_navigation)]}),
("view3d.edit_mesh_extrude_move_normal", {"type": 'E', "value": 'PRESS'}, None),
(op_tool_cycle, "builtin.extrude_region"), params),
op_menu("VIEW3D_MT_edit_mesh_extrude", {"type": 'E', "value": 'PRESS', "alt": True}),
("transform.edge_crease", {"type": 'E', "value": 'PRESS', "shift": True}, None),
@ -5421,13 +5406,11 @@ def km_mesh(params):
# No tool is available for this.
("mesh.rip_move", {"type": 'V', "value": 'PRESS', "alt": True},
{"properties": [("MESH_OT_rip", [("use_fill", True)],)]}),
("mesh.rip_edge_move", {"type": 'D', "value": 'PRESS', "alt": True},
{"properties": [("TRANSFORM_OT_translate", [("allow_navigation", params.use_transform_navigation)])]}),
("mesh.rip_edge_move", {"type": 'D', "value": 'PRESS', "alt": True}, None),
op_menu("VIEW3D_MT_edit_mesh_merge", {"type": 'M', "value": 'PRESS'}),
op_menu("VIEW3D_MT_edit_mesh_split", {"type": 'M', "value": 'PRESS', "alt": True}),
("mesh.edge_face_add", {"type": 'F', "value": 'PRESS', "repeat": True}, None),
("mesh.duplicate_move", {"type": 'D', "value": 'PRESS', "shift": True},
{"properties": [("TRANSFORM_OT_translate", [("allow_navigation", params.use_transform_navigation)])]}),
("mesh.duplicate_move", {"type": 'D', "value": 'PRESS', "shift": True}, None),
op_menu("VIEW3D_MT_mesh_add", {"type": 'A', "value": 'PRESS', "shift": True}),
("mesh.separate", {"type": 'P', "value": 'PRESS'}, None),
("mesh.split", {"type": 'Y', "value": 'PRESS'}, None),
@ -5545,8 +5528,7 @@ def km_armature(params):
("armature.dissolve", {"type": 'X', "value": 'PRESS', "ctrl": True}, None),
("armature.dissolve", {"type": 'DEL', "value": 'PRESS', "ctrl": True}, None),
op_tool_optional(
("armature.extrude_move", {"type": 'E', "value": 'PRESS'},
{"properties": [("TRANSFORM_OT_translate", [("allow_navigation", params.use_transform_navigation)])]}),
("armature.extrude_move", {"type": 'E', "value": 'PRESS'}, None),
(op_tool_cycle, "builtin.extrude"), params),
("armature.extrude_forked", {"type": 'E', "value": 'PRESS', "shift": True}, None),
("armature.click_extrude", {"type": params.action_mouse, "value": 'CLICK', "ctrl": True}, None),
@ -5965,24 +5947,24 @@ def km_transform_modal_map(params):
("PROPORTIONAL_SIZE_DOWN", {"type": 'PAGE_DOWN', "value": 'PRESS', "repeat": True}, None),
("PROPORTIONAL_SIZE_UP", {"type": 'PAGE_UP', "value": 'PRESS', "shift": True, "repeat": True}, None),
("PROPORTIONAL_SIZE_DOWN", {"type": 'PAGE_DOWN', "value": 'PRESS', "shift": True, "repeat": True}, None),
("PROPORTIONAL_SIZE_UP", {"type": 'WHEELDOWNMOUSE', "value": 'PRESS', "alt": params.use_transform_navigation}, None),
("PROPORTIONAL_SIZE_DOWN", {"type": 'WHEELUPMOUSE', "value": 'PRESS', "alt": params.use_transform_navigation}, None),
("PROPORTIONAL_SIZE_UP", {"type": 'WHEELDOWNMOUSE', "value": 'PRESS', "alt": True}, None),
("PROPORTIONAL_SIZE_DOWN", {"type": 'WHEELUPMOUSE', "value": 'PRESS', "alt": True}, None),
("PROPORTIONAL_SIZE_UP", {"type": 'WHEELDOWNMOUSE', "value": 'PRESS', "shift": True}, None),
("PROPORTIONAL_SIZE_DOWN", {"type": 'WHEELUPMOUSE', "value": 'PRESS', "shift": True}, None),
("PROPORTIONAL_SIZE", {"type": 'TRACKPADPAN', "value": 'ANY', "alt": params.use_transform_navigation}, None),
("PROPORTIONAL_SIZE", {"type": 'TRACKPADPAN', "value": 'ANY', "alt": True}, None),
("AUTOIK_CHAIN_LEN_UP", {"type": 'PAGE_UP', "value": 'PRESS', "repeat": True}, None),
("AUTOIK_CHAIN_LEN_DOWN", {"type": 'PAGE_DOWN', "value": 'PRESS', "repeat": True}, None),
("AUTOIK_CHAIN_LEN_UP", {"type": 'PAGE_UP', "value": 'PRESS', "shift": True, "repeat": True}, None),
("AUTOIK_CHAIN_LEN_DOWN", {"type": 'PAGE_DOWN', "value": 'PRESS', "shift": True, "repeat": True}, None),
("AUTOIK_CHAIN_LEN_UP", {"type": 'WHEELDOWNMOUSE', "value": 'PRESS', "alt": params.use_transform_navigation}, None),
("AUTOIK_CHAIN_LEN_DOWN", {"type": 'WHEELUPMOUSE', "value": 'PRESS', "alt": params.use_transform_navigation}, None),
("AUTOIK_CHAIN_LEN_UP", {"type": 'WHEELDOWNMOUSE', "value": 'PRESS', "alt": True}, None),
("AUTOIK_CHAIN_LEN_DOWN", {"type": 'WHEELUPMOUSE', "value": 'PRESS', "alt": True}, None),
("AUTOIK_CHAIN_LEN_UP", {"type": 'WHEELDOWNMOUSE', "value": 'PRESS', "shift": True}, None),
("AUTOIK_CHAIN_LEN_DOWN", {"type": 'WHEELUPMOUSE', "value": 'PRESS', "shift": True}, None),
("INSERTOFS_TOGGLE_DIR", {"type": 'T', "value": 'PRESS'}, None),
("NODE_ATTACH_ON", {"type": 'LEFT_ALT', "value": 'RELEASE', "any": True}, None),
("NODE_ATTACH_OFF", {"type": 'LEFT_ALT', "value": 'PRESS', "any": True}, None),
("AUTOCONSTRAIN", {"type": 'MIDDLEMOUSE', "value": 'ANY', "alt": params.use_transform_navigation}, None),
("AUTOCONSTRAINPLANE", {"type": 'MIDDLEMOUSE', "value": 'ANY', "shift": True, "alt": params.use_transform_navigation}, None),
("AUTOCONSTRAIN", {"type": 'MIDDLEMOUSE', "value": 'ANY', "alt": True}, None),
("AUTOCONSTRAINPLANE", {"type": 'MIDDLEMOUSE', "value": 'ANY', "shift": True, "alt": True}, None),
("PRECISION", {"type": 'LEFT_SHIFT', "value": 'ANY', "any": True}, None),
("PRECISION", {"type": 'RIGHT_SHIFT', "value": 'ANY', "any": True}, None),
])

View File

@ -15,12 +15,6 @@ class VIEW3D_OT_edit_mesh_extrude_individual_move(Operator):
bl_label = "Extrude Individual and Move"
bl_idname = "view3d.edit_mesh_extrude_individual_move"
allow_navigation: BoolProperty(
name="allow_navigation",
default=False,
description="Allow navigation",
)
@classmethod
def poll(cls, context):
obj = context.active_object
@ -40,27 +34,27 @@ class VIEW3D_OT_edit_mesh_extrude_individual_move(Operator):
TRANSFORM_OT_translate={
"orient_type": 'NORMAL',
"constraint_axis": (False, False, True),
"allow_navigation": self.allow_navigation,
"release_confirm": False,
},
)
elif select_mode[2] and totface > 1:
bpy.ops.mesh.extrude_faces_move(
'INVOKE_REGION_WIN',
TRANSFORM_OT_shrink_fatten={
"allow_navigation": self.allow_navigation,
"release_confirm": False,
})
elif select_mode[1] and totedge >= 1:
bpy.ops.mesh.extrude_edges_move(
'INVOKE_REGION_WIN',
TRANSFORM_OT_translate={
"allow_navigation": self.allow_navigation,
"release_confirm": False,
},
)
else:
bpy.ops.mesh.extrude_vertices_move(
'INVOKE_REGION_WIN',
TRANSFORM_OT_translate={
"allow_navigation": self.allow_navigation,
"release_confirm": False,
},
)
@ -83,19 +77,13 @@ class VIEW3D_OT_edit_mesh_extrude_move(Operator):
description="Dissolves adjacent faces and intersects new geometry",
)
allow_navigation: BoolProperty(
name="allow_navigation",
default=False,
description="Allow navigation",
)
@classmethod
def poll(cls, context):
obj = context.active_object
return (obj is not None and obj.mode == 'EDIT')
@staticmethod
def extrude_region(context, use_vert_normals, dissolve_and_intersect, allow_navigation):
def extrude_region(context, use_vert_normals, dissolve_and_intersect):
mesh = context.object.data
totface = mesh.total_face_sel
@ -107,7 +95,7 @@ class VIEW3D_OT_edit_mesh_extrude_move(Operator):
bpy.ops.mesh.extrude_region_shrink_fatten(
'INVOKE_REGION_WIN',
TRANSFORM_OT_shrink_fatten={
"allow_navigation": allow_navigation,
"release_confirm": False,
},
)
elif dissolve_and_intersect:
@ -119,7 +107,7 @@ class VIEW3D_OT_edit_mesh_extrude_move(Operator):
TRANSFORM_OT_translate={
"orient_type": 'NORMAL',
"constraint_axis": (False, False, True),
"allow_navigation": allow_navigation,
"release_confirm": False,
},
)
else:
@ -128,7 +116,7 @@ class VIEW3D_OT_edit_mesh_extrude_move(Operator):
TRANSFORM_OT_translate={
"orient_type": 'NORMAL',
"constraint_axis": (False, False, True),
"allow_navigation": allow_navigation,
"release_confirm": False,
},
)
@ -142,13 +130,13 @@ class VIEW3D_OT_edit_mesh_extrude_move(Operator):
# Not a popular choice, too restrictive for retopo.
# "constraint_axis": (True, True, False)})
"constraint_axis": (False, False, False),
"allow_navigation": allow_navigation,
"release_confirm": False,
})
else:
bpy.ops.mesh.extrude_region_move(
'INVOKE_REGION_WIN',
TRANSFORM_OT_translate={
"allow_navigation": allow_navigation,
"release_confirm": False,
},
)
@ -157,8 +145,7 @@ class VIEW3D_OT_edit_mesh_extrude_move(Operator):
return {'FINISHED'}
def execute(self, context):
return VIEW3D_OT_edit_mesh_extrude_move.extrude_region(
context, False, self.dissolve_and_intersect, self.allow_navigation)
return VIEW3D_OT_edit_mesh_extrude_move.extrude_region(context, False, self.dissolve_and_intersect)
def invoke(self, context, _event):
return self.execute(context)
@ -169,19 +156,13 @@ class VIEW3D_OT_edit_mesh_extrude_shrink_fatten(Operator):
bl_label = "Extrude and Move on Individual Normals"
bl_idname = "view3d.edit_mesh_extrude_move_shrink_fatten"
allow_navigation: BoolProperty(
name="allow_navigation",
default=False,
description="Allow navigation",
)
@classmethod
def poll(cls, context):
obj = context.active_object
return (obj is not None and obj.mode == 'EDIT')
def execute(self, context):
return VIEW3D_OT_edit_mesh_extrude_move.extrude_region(context, True, False, self.allow_navigation)
return VIEW3D_OT_edit_mesh_extrude_move.extrude_region(context, True, False)
def invoke(self, context, _event):
return self.execute(context)
@ -192,12 +173,6 @@ class VIEW3D_OT_edit_mesh_extrude_manifold_normal(Operator):
bl_label = "Extrude Manifold Along Normals"
bl_idname = "view3d.edit_mesh_extrude_manifold_normal"
allow_navigation: BoolProperty(
name="allow_navigation",
default=False,
description="Allow navigation",
)
@classmethod
def poll(cls, context):
obj = context.active_object
@ -212,7 +187,7 @@ class VIEW3D_OT_edit_mesh_extrude_manifold_normal(Operator):
TRANSFORM_OT_translate={
"orient_type": 'NORMAL',
"constraint_axis": (False, False, True),
"allow_navigation": self.allow_navigation,
"release_confirm": False,
},
)
return {'FINISHED'}

View File

@ -513,8 +513,6 @@ class _defs_view3d_add:
row.label(text="Orientation:")
row = layout.row()
row.prop(tool_settings, "plane_orientation", text="")
row = layout.row()
row.prop(tool_settings, "snap_elements_tool")
region_is_header = bpy.context.region.type == 'TOOL_HEADER'
if region_is_header:

View File

@ -641,7 +641,7 @@ class VIEW3D_HT_header(Header):
icon = snap_items[elem].icon
break
else:
text = "Mix"
text = "Multi"
icon = 'NONE'
del snap_items, snap_elements
@ -1049,14 +1049,10 @@ class VIEW3D_MT_transform_base:
# TODO: get rid of the custom text strings?
def draw(self, context):
layout = self.layout
allow_navigation = getattr(
context.window_manager.keyconfigs.active.preferences,
"use_transform_navigation",
False)
layout.operator("transform.translate").allow_navigation = allow_navigation
layout.operator("transform.rotate").allow_navigation = allow_navigation
layout.operator("transform.resize", text="Scale").allow_navigation = allow_navigation
layout.operator("transform.translate").release_confirm = False
layout.operator("transform.rotate").release_confirm = False
layout.operator("transform.resize", text="Scale").release_confirm = False
layout.separator()
@ -1076,18 +1072,13 @@ class VIEW3D_MT_transform_base:
# Generic transform menu - geometry types
class VIEW3D_MT_transform(VIEW3D_MT_transform_base, Menu):
def draw(self, context):
allow_navigation = getattr(
context.window_manager.keyconfigs.active.preferences,
"use_transform_navigation",
False)
# base menu
VIEW3D_MT_transform_base.draw(self, context)
# generic...
layout = self.layout
if context.mode == 'EDIT_MESH':
layout.operator("transform.shrink_fatten", text="Shrink/Fatten").allow_navigation = allow_navigation
layout.operator("transform.shrink_fatten", text="Shrink/Fatten").release_confirm = False
layout.operator("transform.skin_resize")
elif context.mode == 'EDIT_CURVE':
layout.operator("transform.transform", text="Radius").mode = 'CURVE_SHRINKFATTEN'
@ -1096,10 +1087,11 @@ class VIEW3D_MT_transform(VIEW3D_MT_transform_base, Menu):
layout.separator()
props = layout.operator("transform.translate", text="Move Texture Space")
props.texture_space = True
props.allow_navigation = allow_navigation
props.release_confirm = False
props = layout.operator("transform.resize", text="Scale Texture Space")
props.texture_space = True
props.allow_navigation = allow_navigation
props.release_confirm = False
# Object-specific extensions to Transform menu
@ -4209,11 +4201,6 @@ class VIEW3D_MT_edit_mesh_context_menu(Menu):
col.operator("mesh.delete", text="Delete Edges").type = 'EDGE'
if is_face_mode:
allow_navigation = getattr(
context.window_manager.keyconfigs.active.preferences,
"use_transform_navigation",
False)
col = row.column(align=True)
col.label(text="Face Context Menu", icon='FACESEL')
@ -4225,11 +4212,11 @@ class VIEW3D_MT_edit_mesh_context_menu(Menu):
col.separator()
col.operator("view3d.edit_mesh_extrude_move_normal",
text="Extrude Faces").allow_navigation = allow_navigation
text="Extrude Faces").release_confirm = False
col.operator("view3d.edit_mesh_extrude_move_shrink_fatten",
text="Extrude Faces Along Normals").allow_navigation = allow_navigation
text="Extrude Faces Along Normals").release_confirm = False
col.operator("mesh.extrude_faces_move",
text="Extrude Individual Faces").TRANSFORM_OT_shrink_fatten.allow_navigation = allow_navigation
text="Extrude Individual Faces").TRANSFORM_OT_shrink_fatten.release_confirm = False
col.operator("mesh.inset")
col.operator("mesh.poke")
@ -4281,11 +4268,6 @@ class VIEW3D_MT_edit_mesh_extrude(Menu):
def draw(self, context):
from math import pi
allow_navigation = getattr(
context.window_manager.keyconfigs.active.preferences,
"use_transform_navigation",
False)
layout = self.layout
layout.operator_context = 'INVOKE_REGION_WIN'
@ -4295,22 +4277,22 @@ class VIEW3D_MT_edit_mesh_extrude(Menu):
if mesh.total_face_sel:
layout.operator("view3d.edit_mesh_extrude_move_normal",
text="Extrude Faces").allow_navigation = allow_navigation
text="Extrude Faces").release_confirm = False
layout.operator("view3d.edit_mesh_extrude_move_shrink_fatten",
text="Extrude Faces Along Normals").allow_navigation = allow_navigation
text="Extrude Faces Along Normals").release_confirm = False
layout.operator(
"mesh.extrude_faces_move",
text="Extrude Individual Faces").TRANSFORM_OT_shrink_fatten.allow_navigation = allow_navigation
text="Extrude Individual Faces").TRANSFORM_OT_shrink_fatten.release_confirm = False
layout.operator("view3d.edit_mesh_extrude_manifold_normal",
text="Extrude Manifold").allow_navigation = allow_navigation
text="Extrude Manifold").release_confirm = False
if mesh.total_edge_sel and (select_mode[0] or select_mode[1]):
layout.operator("mesh.extrude_edges_move",
text="Extrude Edges").TRANSFORM_OT_translate.allow_navigation = allow_navigation
text="Extrude Edges").TRANSFORM_OT_translate.release_confirm = False
if mesh.total_vert_sel and select_mode[0]:
layout.operator("mesh.extrude_vertices_move",
text="Extrude Vertices").TRANSFORM_OT_translate.allow_navigation = allow_navigation
text="Extrude Vertices").TRANSFORM_OT_translate.release_confirm = False
layout.separator()
@ -4463,22 +4445,17 @@ class VIEW3D_MT_edit_mesh_faces(Menu):
bl_idname = "VIEW3D_MT_edit_mesh_faces"
def draw(self, context):
allow_navigation = getattr(
context.window_manager.keyconfigs.active.preferences,
"use_transform_navigation",
False)
layout = self.layout
layout.operator_context = 'INVOKE_REGION_WIN'
layout.operator("view3d.edit_mesh_extrude_move_normal",
text="Extrude Faces").allow_navigation = allow_navigation
text="Extrude Faces").release_confirm = False
layout.operator("view3d.edit_mesh_extrude_move_shrink_fatten",
text="Extrude Faces Along Normals").allow_navigation = allow_navigation
text="Extrude Faces Along Normals").release_confirm = False
layout.operator(
"mesh.extrude_faces_move",
text="Extrude Individual Faces").TRANSFORM_OT_shrink_fatten.allow_navigation = allow_navigation
text="Extrude Individual Faces").TRANSFORM_OT_shrink_fatten.release_confirm = False
layout.separator()

View File

@ -126,7 +126,6 @@ int BIF_countTransformOrientation(const struct bContext *C);
#define P_CURSOR_EDIT (1 << 16)
#define P_CLNOR_INVALIDATE (1 << 17)
#define P_VIEW2D_EDGE_PAN (1 << 18)
#define P_VIEW3D_NAVIGATION (1 << 19)
/* For properties performed when confirming the transformation. */
#define P_POST_TRANSFORM (1 << 20)

View File

@ -658,9 +658,14 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
t->flag |= T_NO_CURSOR_WRAP;
}
if (op && (t->flag & T_MODAL) &&
(prop = RNA_struct_find_property(op->ptr, "allow_navigation")) &&
RNA_property_boolean_get(op->ptr, prop))
if (op && (t->flag & T_MODAL) && !(t->flag & T_RELEASE_CONFIRM) &&
ELEM(t->mode,
TFM_TRANSLATION,
TFM_RESIZE,
TFM_ROTATION,
TFM_SHRINKFATTEN,
TFM_EDGE_SLIDE,
TFM_VERT_SLIDE))
{
t->vod = ED_view3d_navigation_init(C);
}

View File

@ -793,15 +793,6 @@ void Transform_Properties(wmOperatorType *ot, int flags)
RNA_def_property_flag(prop, PROP_HIDDEN);
}
if (flags & P_VIEW3D_NAVIGATION) {
prop = RNA_def_boolean(ot->srna,
"allow_navigation",
0,
"Allow Navigation",
"Allow navigation while transforming");
RNA_def_property_flag(prop, PROP_HIDDEN);
}
if (flags & P_POST_TRANSFORM) {
prop = RNA_def_boolean(ot->srna,
"use_automerge_and_split",
@ -836,7 +827,7 @@ static void TRANSFORM_OT_translate(wmOperatorType *ot)
Transform_Properties(ot,
P_ORIENT_MATRIX | P_CONSTRAINT | P_PROPORTIONAL | P_MIRROR | P_ALIGN_SNAP |
P_OPTIONS | P_GPENCIL_EDIT | P_CURSOR_EDIT | P_VIEW2D_EDGE_PAN |
P_VIEW3D_NAVIGATION | P_POST_TRANSFORM);
P_POST_TRANSFORM);
}
static void TRANSFORM_OT_resize(wmOperatorType *ot)
@ -875,7 +866,7 @@ static void TRANSFORM_OT_resize(wmOperatorType *ot)
Transform_Properties(ot,
P_ORIENT_MATRIX | P_CONSTRAINT | P_PROPORTIONAL | P_MIRROR | P_GEO_SNAP |
P_OPTIONS | P_GPENCIL_EDIT | P_CENTER | P_VIEW3D_NAVIGATION);
P_OPTIONS | P_GPENCIL_EDIT | P_CENTER);
}
static void TRANSFORM_OT_skin_resize(wmOperatorType *ot)
@ -952,7 +943,7 @@ static void TRANSFORM_OT_rotate(wmOperatorType *ot)
Transform_Properties(ot,
P_ORIENT_AXIS | P_ORIENT_MATRIX | P_CONSTRAINT | P_PROPORTIONAL | P_MIRROR |
P_GEO_SNAP | P_GPENCIL_EDIT | P_CENTER | P_VIEW3D_NAVIGATION);
P_GEO_SNAP | P_GPENCIL_EDIT | P_CENTER);
}
static void TRANSFORM_OT_tilt(wmOperatorType *ot)
@ -1091,7 +1082,7 @@ static void TRANSFORM_OT_shrink_fatten(wmOperatorType *ot)
WM_operatortype_props_advanced_begin(ot);
Transform_Properties(ot, P_PROPORTIONAL | P_MIRROR | P_SNAP | P_VIEW3D_NAVIGATION);
Transform_Properties(ot, P_PROPORTIONAL | P_MIRROR | P_SNAP);
}
static void TRANSFORM_OT_tosphere(wmOperatorType *ot)
@ -1197,7 +1188,7 @@ static void TRANSFORM_OT_edge_slide(wmOperatorType *ot)
"When Even mode is active, flips between the two adjacent edge loops");
RNA_def_boolean(ot->srna, "use_clamp", true, "Clamp", "Clamp within the edge extents");
Transform_Properties(ot, P_MIRROR | P_GEO_SNAP | P_CORRECT_UV | P_VIEW3D_NAVIGATION);
Transform_Properties(ot, P_MIRROR | P_GEO_SNAP | P_CORRECT_UV);
}
static void TRANSFORM_OT_vert_slide(wmOperatorType *ot)
@ -1232,7 +1223,7 @@ static void TRANSFORM_OT_vert_slide(wmOperatorType *ot)
"When Even mode is active, flips between the two adjacent edge loops");
RNA_def_boolean(ot->srna, "use_clamp", true, "Clamp", "Clamp within the edge extents");
Transform_Properties(ot, P_MIRROR | P_GEO_SNAP | P_CORRECT_UV | P_VIEW3D_NAVIGATION);
Transform_Properties(ot, P_MIRROR | P_GEO_SNAP | P_CORRECT_UV);
}
static void TRANSFORM_OT_edge_crease(wmOperatorType *ot)
@ -1380,8 +1371,7 @@ static void TRANSFORM_OT_transform(wmOperatorType *ot)
Transform_Properties(ot,
P_ORIENT_AXIS | P_ORIENT_MATRIX | P_CONSTRAINT | P_PROPORTIONAL | P_MIRROR |
P_ALIGN_SNAP | P_GPENCIL_EDIT | P_CENTER | P_VIEW3D_NAVIGATION |
P_POST_TRANSFORM);
P_ALIGN_SNAP | P_GPENCIL_EDIT | P_CENTER | P_POST_TRANSFORM);
}
static int transform_from_gizmo_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *event)