When subscribing to name-changes through the API, the event doesn't trigger if the object is renamed in the outliner.
Fixed by publishing the RNA changes.
See T86613
Differential D10732
Fix for T86613: Renaming in outliner doesn't trigger rename event Authored by Erik Abrahamsson (erik85) on Mar 16 2021, 5:24 AM.
Details When subscribing to name-changes through the API, the event doesn't trigger if the object is renamed in the outliner. See T86613
Diff Detail
Event TimelineComment Actions This assumes the name is for an object, where as the name could be from a modifier or a bone. Instead namebutton_fn could call:
and similar functions for other ID types, eventually this should replace the notifiers. A larger refactor could use RNA, setting the "name" of each item, instead of having to add calls to BKE_object_defgroup_unique_name, BLI_libblock_ensure_unique_name.. etc, seems unnecessarily low level, for an operation RNA already supports. Comment Actions Thanks @Campbell Barton (campbellbarton) , I went for the easier idea you had. Not sure if I covered all possible cases but it's a start I guess.
Comment Actions The patch needs updating to apply on master.
source/blender/editors/space_outliner/outliner_draw.c:677:37: error: passing argument 1 of 'RNA_pointer_create' from incompatible pointer type [-Werror=incompatible-pointer-types]
677 | WM_msg_publish_rna_prop(mbus, &tselem->id, id, ID, name);
| ^~~~~~~~~~~
| |
| struct ID **This also warns: source/blender/editors/space_outliner/outliner_draw.c:733:11: error: a label can only be part of a statement and a declaration is not a statement
733 | bDeformGroup *vg = te->directdata;
| ^~~~~~~~~~~~Comment Actions @Campbell Barton (campbellbarton) sorry about that, must have missed to compile or something. Patch is updated to master and changed according to what I think you meant.. Comment Actions Applied with some edits, LayerCollection will use an ID of Collection, there was a missing message for pose bones. | ||||||