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_exists_check(const struct Object *obtest);
|
||||||
bool BKE_object_is_in_editmode(const struct Object *ob);
|
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_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_is_in_wpaint_select_vert(const struct Object *ob);
|
||||||
bool BKE_object_has_mode_data(const struct Object *ob, eObjectMode object_mode);
|
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) {
|
while (base) {
|
||||||
if ((base->flag & BASE_SELECTED) != 0 &&
|
if ((base->object->type == data->base_active->object->type) &&
|
||||||
(base->object->type == data->base_active->object->type) &&
|
|
||||||
(base != data->base_active) &&
|
(base != data->base_active) &&
|
||||||
(base->object->mode & data->object_mode))
|
(base->object->mode & data->object_mode))
|
||||||
{
|
{
|
||||||
|
@@ -502,15 +502,6 @@ bool BKE_object_is_in_editmode(const Object *ob)
|
|||||||
return false;
|
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)
|
bool BKE_object_is_in_editmode_vgroup(const Object *ob)
|
||||||
{
|
{
|
||||||
return (OB_TYPE_SUPPORT_VGROUP(ob->type) &&
|
return (OB_TYPE_SUPPORT_VGROUP(ob->type) &&
|
||||||
|
@@ -239,7 +239,7 @@ static void EDIT_CURVE_cache_populate(void *vedata, Object *ob)
|
|||||||
#if 0
|
#if 0
|
||||||
if (ob == draw_ctx->object_edit)
|
if (ob == draw_ctx->object_edit)
|
||||||
#else
|
#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
|
#endif
|
||||||
{
|
{
|
||||||
Curve *cu = ob->data;
|
Curve *cu = ob->data;
|
||||||
|
@@ -194,7 +194,7 @@ static void EDIT_LATTICE_cache_populate(void *vedata, Object *ob)
|
|||||||
UNUSED_VARS(psl);
|
UNUSED_VARS(psl);
|
||||||
|
|
||||||
if (ob->type == OB_LATTICE) {
|
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 */
|
/* Get geometry cache */
|
||||||
struct Gwn_Batch *geom;
|
struct Gwn_Batch *geom;
|
||||||
|
|
||||||
|
@@ -450,7 +450,7 @@ static void EDIT_MESH_cache_populate(void *vedata, Object *ob)
|
|||||||
struct Gwn_Batch *geom;
|
struct Gwn_Batch *geom;
|
||||||
|
|
||||||
if (ob->type == OB_MESH) {
|
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;
|
const Mesh *me = ob->data;
|
||||||
bool do_occlude_wire = (v3d->overlay.edit_flag & V3D_OVERLAY_EDIT_OCCLUDE_WIRE) != 0;
|
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;
|
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();
|
const DRWContextState *draw_ctx = DRW_context_state_get();
|
||||||
DRWShadingGroup *group = stl->g_data->group;
|
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;
|
MetaBall *mb = ob->data;
|
||||||
|
|
||||||
const float *color;
|
const float *color;
|
||||||
|
@@ -468,13 +468,13 @@ static int editmode_toggle_exec(bContext *C, wmOperator *op)
|
|||||||
else {
|
else {
|
||||||
ED_object_editmode_exit(C, EM_FREEDATA | EM_WAITCURSOR);
|
ED_object_editmode_exit(C, EM_FREEDATA | EM_WAITCURSOR);
|
||||||
if ((obact->mode & mode_flag) == 0) {
|
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)) {
|
if ((ob != obact) && (ob->type == obact->type)) {
|
||||||
ED_object_editmode_exit_ex(scene, ob, EM_FREEDATA | EM_WAITCURSOR);
|
ED_object_editmode_exit_ex(scene, ob, EM_FREEDATA | EM_WAITCURSOR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FOREACH_SELECTED_OBJECT_END;
|
FOREACH_OBJECT_END;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -549,7 +549,7 @@ static int posemode_exec(bContext *C, wmOperator *op)
|
|||||||
if (ok) {
|
if (ok) {
|
||||||
struct Main *bmain = CTX_data_main(C);
|
struct Main *bmain = CTX_data_main(C);
|
||||||
ViewLayer *view_layer = CTX_data_view_layer(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) &&
|
if ((ob != obact) &&
|
||||||
(ob->type == OB_ARMATURE) &&
|
(ob->type == OB_ARMATURE) &&
|
||||||
@@ -558,7 +558,7 @@ static int posemode_exec(bContext *C, wmOperator *op)
|
|||||||
ED_object_posemode_exit_ex(bmain, ob);
|
ED_object_posemode_exit_ex(bmain, ob);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FOREACH_SELECTED_OBJECT_END;
|
FOREACH_OBJECT_END;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Reference in New Issue
Block a user