Fix #119384: Outliner Edit Mode Toggle When Data is Shared

This report includes a file that demonstrates a crash when ctrl-
clicking the "dot" icon to add to the objects in edit mode. This is
because the object has a mesh shared with another object that is
already in edit mode. This PR allows editing only one object at a
time between objects that share data.

Pull Request: https://projects.blender.org/blender/blender/pulls/119704
This commit is contained in:
Harley Acheson 2024-03-22 18:26:29 +01:00 committed by Harley Acheson
parent 7f4a4fa605
commit 986e4a8b7f
1 changed files with 20 additions and 0 deletions

View File

@ -2189,6 +2189,26 @@ static void outliner_draw_mode_column_toggle(uiBlock *block,
return;
}
if (ob->mode == OB_MODE_OBJECT && BKE_object_is_in_editmode(ob)) {
/* Another object has our (shared) data in edit mode, so nothing we can change. */
uiBut *but = uiDefIconBut(block,
UI_BTYPE_BUT,
0,
UI_icon_from_object_mode(ob_active->mode),
0,
te->ys,
UI_UNIT_X,
UI_UNIT_Y,
nullptr,
0.0,
0.0,
0.0,
0.0,
TIP_("Another object has this shared data in edit mode"));
UI_but_flag_enable(but, UI_BUT_DISABLED);
return;
}
bool draw_active_icon = ob->mode == ob_active->mode;
/* When not locking object modes, objects can remain in non-object modes. For modes that do not