From dcd1642121a14ddc3191399fb7120fe0a15437ce Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 24 Nov 2009 17:12:32 +0000 Subject: [PATCH] RNA api - EditBone was missing 'selected' - renamed 'selectable' to --> 'restrict_select', matching object mode. - renamed 'active_pchan' --> 'active_pose_bone' --- release/scripts/ui/properties_data_bone.py | 2 +- release/scripts/ui/space_view3d.py | 2 +- source/blender/blenkernel/BKE_context.h | 2 +- source/blender/blenkernel/intern/context.c | 4 ++-- source/blender/editors/armature/editarmature.c | 2 +- source/blender/editors/screen/screen_context.c | 4 ++-- source/blender/makesrna/intern/rna_armature.c | 9 +++++++-- 7 files changed, 15 insertions(+), 10 deletions(-) diff --git a/release/scripts/ui/properties_data_bone.py b/release/scripts/ui/properties_data_bone.py index 3b8911b3896..40877a6be08 100644 --- a/release/scripts/ui/properties_data_bone.py +++ b/release/scripts/ui/properties_data_bone.py @@ -284,7 +284,7 @@ class BONE_PT_properties(BoneButtonsPanel): # reload(rna_prop_ui) obj = context.object if obj and obj.mode == 'POSE': - item = "active_pchan" + item = "active_pose_bone" else: item = "active_bone" diff --git a/release/scripts/ui/space_view3d.py b/release/scripts/ui/space_view3d.py index 21521e36cba..edc526f3c55 100644 --- a/release/scripts/ui/space_view3d.py +++ b/release/scripts/ui/space_view3d.py @@ -1775,7 +1775,7 @@ class VIEW3D_PT_context_properties(bpy.types.Panel): if obj: mode = obj.mode if mode == 'POSE': - return "active_pchan" + return "active_pose_bone" elif mode == 'EDIT' and obj.type == 'ARMATURE': return "active_bone" else: diff --git a/source/blender/blenkernel/BKE_context.h b/source/blender/blenkernel/BKE_context.h index 7f64538b10d..947ec914fa4 100644 --- a/source/blender/blenkernel/BKE_context.h +++ b/source/blender/blenkernel/BKE_context.h @@ -248,7 +248,7 @@ int CTX_data_selected_editable_bones(const bContext *C, ListBase *list); int CTX_data_visible_bones(const bContext *C, ListBase *list); int CTX_data_editable_bones(const bContext *C, ListBase *list); -struct bPoseChannel *CTX_data_active_pchan(const bContext *C); +struct bPoseChannel *CTX_data_active_pose_bone(const bContext *C); int CTX_data_selected_pchans(const bContext *C, ListBase *list); int CTX_data_visible_pchans(const bContext *C, ListBase *list); diff --git a/source/blender/blenkernel/intern/context.c b/source/blender/blenkernel/intern/context.c index 21549f6b147..164e7a23d92 100644 --- a/source/blender/blenkernel/intern/context.c +++ b/source/blender/blenkernel/intern/context.c @@ -878,9 +878,9 @@ int CTX_data_editable_bones(const bContext *C, ListBase *list) return ctx_data_collection_get(C, "editable_bones", list); } -struct bPoseChannel *CTX_data_active_pchan(const bContext *C) +struct bPoseChannel *CTX_data_active_pose_bone(const bContext *C) { - return ctx_data_pointer_get(C, "active_pchan"); + return ctx_data_pointer_get(C, "active_pose_bone"); } int CTX_data_selected_pchans(const bContext *C, ListBase *list) diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index 78ba73ce5d5..ce3e4cc8f8d 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -5149,7 +5149,7 @@ static int pose_select_parent_exec(bContext *C, wmOperator *op) bPoseChannel *pchan,*parent; /* Determine if there is an active bone */ - pchan=CTX_data_active_pchan(C); + pchan=CTX_data_active_pose_bone(C); if (pchan) { bArmature *arm= ob->data; parent=pchan->parent; diff --git a/source/blender/editors/screen/screen_context.c b/source/blender/editors/screen/screen_context.c index 1ddc19a5ec0..cd80bcde19f 100644 --- a/source/blender/editors/screen/screen_context.c +++ b/source/blender/editors/screen/screen_context.c @@ -64,7 +64,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult "scene", "selected_objects", "selected_bases", "selected_editable_objects", "selected_editable_bases", "visible_bones", "editable_bones", "selected_bones", "selected_editable_bones", - "visible_pchans", "selected_pchans", "active_bone", "active_pchan", + "visible_pchans", "selected_pchans", "active_bone", "active_pose_bone", "active_base", "active_object", "object", "edit_object", "sculpt_object", "vertex_paint_object", "weight_paint_object", "texture_paint_object", "particle_edit_object", NULL}; @@ -240,7 +240,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult } } } - else if(CTX_data_equals(member, "active_pchan")) { + else if(CTX_data_equals(member, "active_pose_bone")) { bPoseChannel *pchan; pchan= get_active_posechannel(obact); diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c index f1164cda675..8d84257e219 100644 --- a/source/blender/makesrna/intern/rna_armature.c +++ b/source/blender/makesrna/intern/rna_armature.c @@ -439,8 +439,8 @@ static void rna_def_bone_common(StructRNA *srna, int editbone) RNA_def_property_ui_text(prop, "Cyclic Offset", "When bone doesn't have a parent, it receives cyclic offset effects."); RNA_def_property_update(prop, 0, "rna_Armature_update_data"); - prop= RNA_def_property(srna, "selectable", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BONE_UNSELECTABLE); + prop= RNA_def_property(srna, "restrict_select", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_UNSELECTABLE); RNA_def_property_ui_text(prop, "Selectable", "Bone is able to be selected"); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); @@ -610,6 +610,11 @@ static void rna_def_edit_bone(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Locked", "Bone is not able to be transformed when in Edit Mode."); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); + prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_SELECTED); + RNA_def_property_ui_text(prop, "Selected", ""); + RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); + prop= RNA_def_property(srna, "head_selected", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_ROOTSEL); RNA_def_property_ui_text(prop, "Head Selected", "");