From 7037ff9204475ae4dd19926b55382d558fc12a62 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Tue, 25 Jun 2019 18:00:33 -0300 Subject: Partial fix to T66126: Non-Active Grease Pencil object stuck in drawmode This only handles the issue after file load. To make it an all-around solution we need to deal with this in ed_object_select_pick, do_outliner_item_activate_tree_element(), ... --- source/blender/editors/util/ed_util.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source/blender') diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c index e751c7263cb..1ee8ff6966c 100644 --- a/source/blender/editors/util/ed_util.c +++ b/source/blender/editors/util/ed_util.c @@ -126,8 +126,12 @@ void ED_editors_init(bContext *C) continue; } else if (ob->type == OB_GPENCIL) { - /* For multi-edit mode we may already have mode data. - * (grease pencil does not need it) */ + /* For multi-edit mode we may already have mode data (grease pencil does not need it). + * However we may have a non-active object stuck in a greasepencil edit mode. */ + if (ob != obact) { + ob->mode = OB_MODE_OBJECT; + DEG_id_tag_update(&ob->id, ID_RECALC_COPY_ON_WRITE); + } continue; } -- cgit v1.2.3