Object Modes: only use selection for mode switch
Selection is no longer needed for an object to be considered in a mode. Part of T55246 design task, fixes T55187
This commit is contained in:
@@ -81,7 +81,6 @@ void BKE_object_copy_proxy_drivers(struct Object *ob, struct Object *target);
|
||||
bool BKE_object_exists_check(const struct Object *obtest);
|
||||
bool BKE_object_is_in_editmode(const struct Object *ob);
|
||||
bool BKE_object_is_in_editmode_vgroup(const struct Object *ob);
|
||||
bool BKE_object_is_in_editmode_and_selected(const struct Object *ob);
|
||||
bool BKE_object_is_in_wpaint_select_vert(const struct Object *ob);
|
||||
bool BKE_object_has_mode_data(const struct Object *ob, eObjectMode object_mode);
|
||||
|
||||
|
@@ -1206,8 +1206,7 @@ void BKE_view_layer_bases_in_mode_iterator_next(BLI_Iterator *iter)
|
||||
}
|
||||
|
||||
while (base) {
|
||||
if ((base->flag & BASE_SELECTED) != 0 &&
|
||||
(base->object->type == data->base_active->object->type) &&
|
||||
if ((base->object->type == data->base_active->object->type) &&
|
||||
(base != data->base_active) &&
|
||||
(base->object->mode & data->object_mode))
|
||||
{
|
||||
|
@@ -502,15 +502,6 @@ bool BKE_object_is_in_editmode(const Object *ob)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool BKE_object_is_in_editmode_and_selected(const Object *ob)
|
||||
{
|
||||
if ((ob->base_flag & BASE_SELECTED) && (BKE_object_is_in_editmode(ob))) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool BKE_object_is_in_editmode_vgroup(const Object *ob)
|
||||
{
|
||||
return (OB_TYPE_SUPPORT_VGROUP(ob->type) &&
|
||||
|
@@ -239,7 +239,7 @@ static void EDIT_CURVE_cache_populate(void *vedata, Object *ob)
|
||||
#if 0
|
||||
if (ob == draw_ctx->object_edit)
|
||||
#else
|
||||
if ((ob == draw_ctx->object_edit) || BKE_object_is_in_editmode_and_selected(ob))
|
||||
if ((ob == draw_ctx->object_edit) || BKE_object_is_in_editmode(ob))
|
||||
#endif
|
||||
{
|
||||
Curve *cu = ob->data;
|
||||
|
@@ -194,7 +194,7 @@ static void EDIT_LATTICE_cache_populate(void *vedata, Object *ob)
|
||||
UNUSED_VARS(psl);
|
||||
|
||||
if (ob->type == OB_LATTICE) {
|
||||
if ((ob == draw_ctx->object_edit) || BKE_object_is_in_editmode_and_selected(ob)) {
|
||||
if ((ob == draw_ctx->object_edit) || BKE_object_is_in_editmode(ob)) {
|
||||
/* Get geometry cache */
|
||||
struct Gwn_Batch *geom;
|
||||
|
||||
|
@@ -450,7 +450,7 @@ static void EDIT_MESH_cache_populate(void *vedata, Object *ob)
|
||||
struct Gwn_Batch *geom;
|
||||
|
||||
if (ob->type == OB_MESH) {
|
||||
if ((ob == draw_ctx->object_edit) || BKE_object_is_in_editmode_and_selected(ob)) {
|
||||
if ((ob == draw_ctx->object_edit) || BKE_object_is_in_editmode(ob)) {
|
||||
const Mesh *me = ob->data;
|
||||
bool do_occlude_wire = (v3d->overlay.edit_flag & V3D_OVERLAY_EDIT_OCCLUDE_WIRE) != 0;
|
||||
bool do_show_weight = (v3d->overlay.edit_flag & V3D_OVERLAY_EDIT_WEIGHT) != 0;
|
||||
|
@@ -136,7 +136,7 @@ static void EDIT_METABALL_cache_populate(void *vedata, Object *ob)
|
||||
const DRWContextState *draw_ctx = DRW_context_state_get();
|
||||
DRWShadingGroup *group = stl->g_data->group;
|
||||
|
||||
if ((ob == draw_ctx->object_edit) || BKE_object_is_in_editmode_and_selected(ob)) {
|
||||
if ((ob == draw_ctx->object_edit) || BKE_object_is_in_editmode(ob)) {
|
||||
MetaBall *mb = ob->data;
|
||||
|
||||
const float *color;
|
||||
|
@@ -468,16 +468,16 @@ static int editmode_toggle_exec(bContext *C, wmOperator *op)
|
||||
else {
|
||||
ED_object_editmode_exit(C, EM_FREEDATA | EM_WAITCURSOR);
|
||||
if ((obact->mode & mode_flag) == 0) {
|
||||
FOREACH_SELECTED_OBJECT_BEGIN(view_layer, ob)
|
||||
FOREACH_OBJECT_BEGIN(view_layer, ob)
|
||||
{
|
||||
if ((ob != obact) && (ob->type == obact->type)) {
|
||||
ED_object_editmode_exit_ex(scene, ob, EM_FREEDATA | EM_WAITCURSOR);
|
||||
}
|
||||
}
|
||||
FOREACH_SELECTED_OBJECT_END;
|
||||
FOREACH_OBJECT_END;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ED_space_image_uv_sculpt_update(CTX_wm_manager(C), scene);
|
||||
|
||||
WM_msg_publish_rna_prop(mbus, &obact->id, obact, Object, mode);
|
||||
@@ -549,7 +549,7 @@ static int posemode_exec(bContext *C, wmOperator *op)
|
||||
if (ok) {
|
||||
struct Main *bmain = CTX_data_main(C);
|
||||
ViewLayer *view_layer = CTX_data_view_layer(C);
|
||||
FOREACH_SELECTED_OBJECT_BEGIN(view_layer, ob)
|
||||
FOREACH_OBJECT_BEGIN(view_layer, ob)
|
||||
{
|
||||
if ((ob != obact) &&
|
||||
(ob->type == OB_ARMATURE) &&
|
||||
@@ -558,7 +558,7 @@ static int posemode_exec(bContext *C, wmOperator *op)
|
||||
ED_object_posemode_exit_ex(bmain, ob);
|
||||
}
|
||||
}
|
||||
FOREACH_SELECTED_OBJECT_END;
|
||||
FOREACH_OBJECT_END;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
Reference in New Issue
Block a user