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:
authorNathan Craddock <nzcraddock@gmail.com>2020-05-23 19:07:51 +0300
committerNathan Craddock <nzcraddock@gmail.com>2020-05-23 19:36:54 +0300
commit6f8d99322cf65d7cb24e9949d371e6bbdc726cd5 (patch)
treeb59cac0e0983e71c995a55db0522b380a3266b0a /source/blender/makesrna/intern/rna_armature.c
parentb4613e0bca9ba3999f1198f84257a763167c6a15 (diff)
Fix T76578: Show bone visibility driver in outliner
Allow setting drivers and keyframes for the bone visibility restriction icon in the outliner. Before the button was a simple icon button, but it is now connected to the RNA property to show the driven or keyframed state. Also when hiding a bone from the outliner it would be deselected, but from the properties editor it would remain selected. This moves the deselection to the RNA update function to ensure the bone is always deselected. Differential Revision: https://developer.blender.org/D7825
Diffstat (limited to 'source/blender/makesrna/intern/rna_armature.c')
-rw-r--r--source/blender/makesrna/intern/rna_armature.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c
index fe35af8c2e0..cd7875d84e3 100644
--- a/source/blender/makesrna/intern/rna_armature.c
+++ b/source/blender/makesrna/intern/rna_armature.c
@@ -176,6 +176,20 @@ static void rna_Armature_redraw_data(Main *UNUSED(bmain), Scene *UNUSED(scene),
WM_main_add_notifier(NC_GEOM | ND_DATA, id);
}
+/* Unselect bones when hidden */
+static void rna_Bone_hide_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
+{
+ bArmature *arm = (bArmature *)ptr->owner_id;
+ Bone *bone = (Bone *)ptr->data;
+
+ if (bone->flag & BONE_HIDDEN_P) {
+ bone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
+ }
+
+ WM_main_add_notifier(NC_OBJECT | ND_POSE, arm);
+ DEG_id_tag_update(&arm->id, ID_RECALC_COPY_ON_WRITE);
+}
+
/* called whenever a bone is renamed */
static void rna_Bone_update_renamed(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
@@ -1143,7 +1157,8 @@ static void rna_def_bone(BlenderRNA *brna)
prop,
"Hide",
"Bone is not visible when it is not in Edit Mode (i.e. in Object or Pose Modes)");
- RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
+ RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_OFF, -1);
+ RNA_def_property_update(prop, 0, "rna_Bone_hide_update");
prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_SELECTED);