From 30395a491f5aa0764b57cb8b715740152d61fdcc Mon Sep 17 00:00:00 2001 From: Nathan Craddock Date: Thu, 4 Jun 2020 21:46:40 +1000 Subject: Fix T77073: Objects cannot be activated after collection exclude When excluding a collection containing the active object in either texture paint or particle edit mode, the object could not be reactivated when the collection was re-enabled. This is because the object's mode was left in TEXTURE_PAINT or PARTICLE_EDIT, and the activation code did not have cases to handle these modes. This moves the code that is run when toggling out of texture paint or particle edit modes to functions so activation can properly toggle off the respective interaction mode. --- source/blender/editors/object/object_modes.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source/blender/editors/object/object_modes.c') diff --git a/source/blender/editors/object/object_modes.c b/source/blender/editors/object/object_modes.c index fbd935c2e55..c518fd32c7f 100644 --- a/source/blender/editors/object/object_modes.c +++ b/source/blender/editors/object/object_modes.c @@ -274,6 +274,18 @@ static bool ed_object_mode_generic_exit_ex(struct Main *bmain, ED_object_posemode_exit_ex(bmain, ob); } } + else if (ob->mode & OB_MODE_TEXTURE_PAINT) { + if (only_test) { + return true; + } + ED_object_texture_paint_mode_exit_ex(bmain, scene, ob); + } + else if (ob->mode & OB_MODE_PARTICLE_EDIT) { + if (only_test) { + return true; + } + ED_object_particle_edit_mode_exit_ex(scene, ob); + } else if (ob->type == OB_GPENCIL) { /* Accounted for above. */ BLI_assert((ob->mode & OB_MODE_OBJECT) == 0); -- cgit v1.2.3