Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Oeser <info@graphics-engineer.com>2021-11-03 14:05:43 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2021-11-03 17:03:40 +0300
commit8b516d8712024af9380fe3f7559c336042d612f5 (patch)
tree44b3e024566cf161ca28d77781747047de344d26 /source/blender/editors/animation/anim_ipo_utils.c
parent2a883432138d15f746dccaa703c50e483189e138 (diff)
Include node name for socket animation channel UI
The channel names were often indistingushable in animation editors. Now include the node _name_ (unfortunately, getting the _label_ could result in bad performance in some circustances -- see previous version of D13085). Similar to what rB77744b581d08 did for some VSE strip properties. ref. T91917 Maniphest Tasks: T91917 Differential Revision: https://developer.blender.org/D13085
Diffstat (limited to 'source/blender/editors/animation/anim_ipo_utils.c')
-rw-r--r--source/blender/editors/animation/anim_ipo_utils.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/editors/animation/anim_ipo_utils.c b/source/blender/editors/animation/anim_ipo_utils.c
index 6fe32699907..05837ed17b9 100644
--- a/source/blender/editors/animation/anim_ipo_utils.c
+++ b/source/blender/editors/animation/anim_ipo_utils.c
@@ -145,6 +145,22 @@ int getname_anim_fcurve(char *name, ID *id, FCurve *fcu)
}
}
}
+ /* For node sockets, it is useful to include the node name as well (multiple similar nodes
+ * are not distinguishable otherwise). Unfortunately, the node label cannot be retrieved
+ * from the rna path, for this to work access to the underlying node is needed (but finding
+ * the node iterates all nodes & sockets which would result in bad performance in some
+ * circumstances). */
+ if (RNA_struct_is_a(ptr.type, &RNA_NodeSocket)) {
+ char nodename[256];
+ if (BLI_str_quoted_substr(fcu->rna_path, "nodes[", nodename, sizeof(nodename))) {
+ const char *structname_all = BLI_sprintfN("%s : %s", nodename, structname);
+ if (free_structname) {
+ MEM_freeN((void *)structname);
+ }
+ structname = structname_all;
+ free_structname = 1;
+ }
+ }
}
/* Property Name is straightforward */