Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_armature.c
| Show First 20 Lines • Show All 170 Lines • ▼ Show 20 Lines | |||||
| static void rna_Armature_redraw_data(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) | static void rna_Armature_redraw_data(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) | ||||
| { | { | ||||
| ID *id = ptr->owner_id; | ID *id = ptr->owner_id; | ||||
| DEG_id_tag_update(id, ID_RECALC_COPY_ON_WRITE); | DEG_id_tag_update(id, ID_RECALC_COPY_ON_WRITE); | ||||
| WM_main_add_notifier(NC_GEOM | ND_DATA, id); | 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) | |||||
Severin: Should be called `rna_Bone_hide_update()`. | |||||
| { | |||||
| 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 */ | /* called whenever a bone is renamed */ | ||||
| static void rna_Bone_update_renamed(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) | static void rna_Bone_update_renamed(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) | ||||
| { | { | ||||
| ID *id = ptr->owner_id; | ID *id = ptr->owner_id; | ||||
| /* redraw view */ | /* redraw view */ | ||||
| WM_main_add_notifier(NC_GEOM | ND_DATA, id); | WM_main_add_notifier(NC_GEOM | ND_DATA, id); | ||||
| ▲ Show 20 Lines • Show All 951 Lines • ▼ Show 20 Lines | static void rna_def_bone(BlenderRNA *brna) | ||||
| /* XXX should we define this in PoseChannel wrapping code instead? | /* XXX should we define this in PoseChannel wrapping code instead? | ||||
| * But PoseChannels directly get some of their flags from here... */ | * But PoseChannels directly get some of their flags from here... */ | ||||
| prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_HIDDEN_P); | RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_HIDDEN_P); | ||||
| RNA_def_property_ui_text( | RNA_def_property_ui_text( | ||||
| prop, | prop, | ||||
| "Hide", | "Hide", | ||||
| "Bone is not visible when it is not in Edit Mode (i.e. in Object or Pose Modes)"); | "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); | prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_SELECTED); | RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_SELECTED); | ||||
| RNA_def_property_ui_text(prop, "Select", ""); | RNA_def_property_ui_text(prop, "Select", ""); | ||||
| RNA_def_property_clear_flag( | RNA_def_property_clear_flag( | ||||
| prop, | prop, | ||||
| PROP_ANIMATABLE); /* XXX: review whether this could be used for interesting effects... */ | PROP_ANIMATABLE); /* XXX: review whether this could be used for interesting effects... */ | ||||
| RNA_def_property_update(prop, 0, "rna_Bone_select_update"); | RNA_def_property_update(prop, 0, "rna_Bone_select_update"); | ||||
| ▲ Show 20 Lines • Show All 395 Lines • Show Last 20 Lines | |||||
Should be called rna_Bone_hide_update().