Object: Switch Object operator

This object operator exits and frees the edit data of the
current object and enters the same mode in another one in a single step,
without going through object mode or keeping multiple edit object data
active. It is assigned to the D key.

This solves all conflicts that the right/click select keymap and the
emulate 3 button mouse produces for this operation and it is independent
of the state of Lock object modes.
Also, as the SculptSession is freed, when using Multires objects go
back to their preview resolution level, so it is possible to work on
high vertex count scenes without slowing down the viewport and other
performance problems.

Reviewed By: #user_interface, pablovazquez

Differential Revision: https://developer.blender.org/D7510
This commit is contained in:
Pablo Dobarro
2020-09-18 19:32:35 +02:00
committed by Pablo Dobarro
parent 6c9ec1c893
commit 827dfd76dd
4 changed files with 126 additions and 0 deletions

View File

@@ -4349,6 +4349,8 @@ def km_sculpt(params):
)
items.extend([
# Switch Object
("object.switch_object", {"type": 'D', "value": 'PRESS'}, None),
# Brush strokes
("sculpt.brush_stroke", {"type": 'LEFTMOUSE', "value": 'PRESS'},
{"properties": [("mode", 'NORMAL')]}),
@@ -4465,6 +4467,8 @@ def km_mesh(params):
)
items.extend([
#Switch Object
("object.switch_object", {"type": 'D', "value": 'PRESS'}, None),
# Tools.
("mesh.loopcut_slide", {"type": 'R', "value": 'PRESS', "ctrl": True},
{"properties": [("TRANSFORM_OT_edge_slide", [("release_confirm", False)],)]}),