[Bf-blender-cvs] [a4b2734fe26] master: Fix T76801: Renaming bone in pose mode doesn't redraw the viewport names

Julian Eisel noreply at git.blender.org
Mon May 18 09:51:27 CEST 2020


Commit: a4b2734fe2675fbe2aeacc813b3dcd716fe81782
Author: Julian Eisel
Date:   Mon May 18 09:46:22 2020 +0200
Branches: master
https://developer.blender.org/rBa4b2734fe2675fbe2aeacc813b3dcd716fe81782

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...

===================================================================

M	source/blender/makesrna/intern/rna_pose.c

===================================================================

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);



More information about the Bf-blender-cvs mailing list