Fix #111067: NLA tracks cannot be renamed from Outliner
Outliner `do_item_rename` has checks so linked or overridden IDs cannot be renamed. A `TreeStoreElem`s ID can point to other data than "real" IDs though (see how `outliner_add_element` casts to an ID from an arbitrary void pointer and cases marked `/* NO ID */` in code). In those cases, `ID_IS_LINKED` or `ID_IS_OVERRIDE_LIBRARY` _could_ return true and a the renaming operation would fail. Now also check if this is a real ID (`TSE_IS_REAL_ID`), so code can continue. Also add a proper notifier, so track renaming from the Outliner will update the NLA immediately. Pull Request: https://projects.blender.org/blender/blender/pulls/111110
This commit is contained in:
committed by
Philipp Oeser
parent
02969de155
commit
cf43477839
@@ -757,6 +757,10 @@ static void namebutton_fn(bContext *C, void *tsep, char *oldname)
|
||||
DEG_id_tag_update(tselem->id, ID_RECALC_COPY_ON_WRITE);
|
||||
break;
|
||||
}
|
||||
case TSE_NLA_TRACK: {
|
||||
WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN | NA_RENAME, nullptr);
|
||||
break;
|
||||
}
|
||||
case TSE_EBONE: {
|
||||
bArmature *arm = (bArmature *)tselem->id;
|
||||
if (arm->edbo) {
|
||||
|
||||
@@ -336,10 +336,10 @@ static void do_item_rename(ARegion *region,
|
||||
else if (ELEM(tselem->type, TSE_SEQUENCE, TSE_SEQ_STRIP, TSE_SEQUENCE_DUP)) {
|
||||
BKE_report(reports, RPT_WARNING, "Cannot edit sequence name");
|
||||
}
|
||||
else if (ID_IS_LINKED(tselem->id)) {
|
||||
else if (TSE_IS_REAL_ID(tselem) && ID_IS_LINKED(tselem->id)) {
|
||||
BKE_report(reports, RPT_WARNING, "Cannot edit external library data");
|
||||
}
|
||||
else if (ID_IS_OVERRIDE_LIBRARY(tselem->id)) {
|
||||
else if (TSE_IS_REAL_ID(tselem) && ID_IS_OVERRIDE_LIBRARY(tselem->id)) {
|
||||
BKE_report(reports, RPT_WARNING, "Cannot edit name of an override data-block");
|
||||
}
|
||||
else if (outliner_is_collection_tree_element(te)) {
|
||||
|
||||
Reference in New Issue
Block a user