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.
This commit is contained in:
Nathan Craddock
2020-06-04 21:46:40 +10:00
committed by Campbell Barton
parent c7c3908b8e
commit 30395a491f

View File

@@ -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);