diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-01-09 02:16:51 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-01-09 02:21:51 +0300 |
commit | b536d1b95f01de9400d77dbaf311677222063178 (patch) | |
tree | eb2dd3502c70a35b18fa08af006dc5d98930d782 /source/blender/editors/util | |
parent | 1b6b0fbd957f70ea177dbfd431ec2a2ba2d0daa6 (diff) |
Object Mode: only toggle active object mode once
- When toggling a mode that doesn't support multi editing
only do this once of the active object.
- For sculpt mode create sculpt data since this is needed
for activating other sculpt objects on reload.
Diffstat (limited to 'source/blender/editors/util')
-rw-r--r-- | source/blender/editors/util/ed_util.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c index b3ec0a4388f..188d06cec55 100644 --- a/source/blender/editors/util/ed_util.c +++ b/source/blender/editors/util/ed_util.c @@ -130,7 +130,17 @@ void ED_editors_init(bContext *C) ED_object_posemode_enter_ex(bmain, ob); } else { - ED_object_mode_toggle(C, mode); + if (obact == ob) { + ED_object_mode_toggle(C, mode); + } + else { + /* Create data for non-active objects which need it for + * mode-switching but don't yet support multi-editing. */ + if (mode & OB_MODE_ALL_SCULPT) { + ob->mode = mode; + BKE_object_sculpt_data_create(ob); + } + } } } } |