From cc7460eaa491ed020acdc8f863cd521688fad01c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 25 Apr 2018 15:22:02 +0200 Subject: Fix multi-edit mode on file load Setting up the initial object mode would change objects which were already moved into their mode along with the active object. --- source/blender/editors/util/ed_util.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/blender/editors/util/ed_util.c') diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c index d3a9c22bc73..61a70d2da42 100644 --- a/source/blender/editors/util/ed_util.c +++ b/source/blender/editors/util/ed_util.c @@ -56,6 +56,7 @@ #include "BKE_global.h" #include "BKE_main.h" #include "BKE_multires.h" +#include "BKE_object.h" #include "BKE_packedFile.h" #include "BKE_paint.h" #include "BKE_screen.h" @@ -113,7 +114,8 @@ void ED_editors_init(bContext *C) if (mode == OB_MODE_OBJECT) { /* pass */ } - else { + else if (!BKE_object_has_mode_data(ob, mode)) { + /* For multi-edit mode we may already have mode data. */ ID *data = ob->data; ob->mode = OB_MODE_OBJECT; if ((ob == obact) && !ID_IS_LINKED(ob) && !(data && ID_IS_LINKED(data))) { -- cgit v1.2.3