Merge branch 'blender-v2.91-release'
This commit is contained in:
commit
7863ded680
@ -1947,60 +1947,65 @@ static void outliner_draw_mode_column_toggle(uiBlock *block,
|
||||
TreeStoreElem *tselem,
|
||||
const bool lock_object_modes)
|
||||
{
|
||||
const int active_mode = tvc->obact->mode;
|
||||
bool draw_active_icon = true;
|
||||
if (tselem->type != 0 || te->idcode != ID_OB) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (tselem->type == 0 && te->idcode == ID_OB) {
|
||||
Object *ob = (Object *)tselem->id;
|
||||
Object *ob = (Object *)tselem->id;
|
||||
Object *ob_active = tvc->obact;
|
||||
|
||||
/* When not locking object modes, objects can remain in non-object modes. For modes that do not
|
||||
* allow multi-object editing, these other objects should still show be viewed as not in the
|
||||
* mode. Otherwise multiple objects show the same mode icon in the outliner even though only
|
||||
* one object is actually editable in the mode. */
|
||||
if (!lock_object_modes && ob != tvc->obact && !(tvc->ob_edit || tvc->ob_pose)) {
|
||||
draw_active_icon = false;
|
||||
}
|
||||
/* Not all objects support particle systems. */
|
||||
if (ob_active->mode == OB_MODE_PARTICLE_EDIT && !psys_get_current(ob)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (ob->type == tvc->obact->type) {
|
||||
int icon;
|
||||
const char *tip;
|
||||
/* Only for objects with the same type. */
|
||||
if (ob->type != ob_active->type) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (draw_active_icon && ob->mode == tvc->obact->mode) {
|
||||
icon = UI_icon_from_object_mode(active_mode);
|
||||
tip = TIP_("Remove from the current mode");
|
||||
}
|
||||
else {
|
||||
/* Not all objects support particle systems */
|
||||
if (active_mode == OB_MODE_PARTICLE_EDIT && !psys_get_current(ob)) {
|
||||
return;
|
||||
}
|
||||
icon = ICON_DOT;
|
||||
tip = TIP_(
|
||||
"Change the object in the current mode\n"
|
||||
"* Ctrl to add to the current mode");
|
||||
}
|
||||
bool draw_active_icon = ob->mode == ob_active->mode;
|
||||
|
||||
uiBut *but = uiDefIconBut(block,
|
||||
UI_BTYPE_ICON_TOGGLE,
|
||||
0,
|
||||
icon,
|
||||
0,
|
||||
te->ys,
|
||||
UI_UNIT_X,
|
||||
UI_UNIT_Y,
|
||||
NULL,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
tip);
|
||||
UI_but_func_set(but, outliner_mode_toggle_fn, tselem, NULL);
|
||||
UI_but_flag_enable(but, UI_BUT_DRAG_LOCK);
|
||||
/* When not locking object modes, objects can remain in non-object modes. For modes that do not
|
||||
* allow multi-object editing, these other objects should still show be viewed as not in the
|
||||
* mode. Otherwise multiple objects show the same mode icon in the outliner even though only
|
||||
* one object is actually editable in the mode. */
|
||||
if (!lock_object_modes && ob != ob_active && !(tvc->ob_edit || tvc->ob_pose)) {
|
||||
draw_active_icon = false;
|
||||
}
|
||||
|
||||
if (ID_IS_LINKED(&ob->id)) {
|
||||
UI_but_disable(but, TIP_("Can't edit external library data"));
|
||||
}
|
||||
}
|
||||
int icon;
|
||||
const char *tip;
|
||||
if (draw_active_icon) {
|
||||
icon = UI_icon_from_object_mode(ob_active->mode);
|
||||
tip = TIP_("Remove from the current mode");
|
||||
}
|
||||
else {
|
||||
icon = ICON_DOT;
|
||||
tip = TIP_(
|
||||
"Change the object in the current mode\n"
|
||||
"* Ctrl to add to the current mode");
|
||||
}
|
||||
|
||||
uiBut *but = uiDefIconBut(block,
|
||||
UI_BTYPE_ICON_TOGGLE,
|
||||
0,
|
||||
icon,
|
||||
0,
|
||||
te->ys,
|
||||
UI_UNIT_X,
|
||||
UI_UNIT_Y,
|
||||
NULL,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
tip);
|
||||
UI_but_func_set(but, outliner_mode_toggle_fn, tselem, NULL);
|
||||
UI_but_flag_enable(but, UI_BUT_DRAG_LOCK);
|
||||
|
||||
if (ID_IS_LINKED(&ob->id)) {
|
||||
UI_but_disable(but, TIP_("Can't edit external library data"));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user