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:
authorJulian Eisel <julian@blender.org>2020-05-18 10:46:22 +0300
committerJulian Eisel <julian@blender.org>2020-05-18 10:51:20 +0300
commita4b2734fe2675fbe2aeacc813b3dcd716fe81782 (patch)
tree5e8657c6de5451c312ae30235371a8108f28ec70 /source/blender/makesrna/intern/rna_pose.c
parent68ba1548696e4d01c204d1e09e596bfa21f53a9c (diff)
Fix T76801: Renaming bone in pose mode doesn't redraw the viewport names
The RNA name property of pose bones did not have any update logic defined. Same issue also applied to the channel name in animation editors. Duplicated the update logic from (edit-)bones now, other pose bone functions do this too...
Diffstat (limited to 'source/blender/makesrna/intern/rna_pose.c')
-rw-r--r--source/blender/makesrna/intern/rna_pose.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c
index 17e5f3d3649..8f28fc56712 100644
--- a/source/blender/makesrna/intern/rna_pose.c
+++ b/source/blender/makesrna/intern/rna_pose.c
@@ -295,6 +295,18 @@ static void rna_PoseChannel_name_set(PointerRNA *ptr, const char *value)
ED_armature_bone_rename(G_MAIN, ob->data, oldname, newname);
}
+/* See rna_Bone_update_renamed() */
+static void rna_PoseChannel_name_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
+{
+ ID *id = ptr->owner_id;
+
+ /* redraw view */
+ WM_main_add_notifier(NC_GEOM | ND_DATA, id);
+
+ /* update animation channels */
+ WM_main_add_notifier(NC_ANIMATION | ND_ANIMCHAN, id);
+}
+
static PointerRNA rna_PoseChannel_bone_get(PointerRNA *ptr)
{
Object *ob = (Object *)ptr->owner_id;
@@ -996,6 +1008,7 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Name", "");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_struct_name_property(srna, prop);
+ RNA_def_property_update(prop, 0, "rna_PoseChannel_name_update");
/* Baked Bone Path cache data */
rna_def_motionpath_common(srna);