diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-11-13 19:37:44 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-11-13 19:37:44 +0300 |
commit | c1d0f9179d4972eeb85fc8c5e182708ab7385930 (patch) | |
tree | cfbf0846eba173f049d0efcb6b605d955fb43ad5 /source/blender/makesrna/intern/rna_armature.c | |
parent | 91352006c4ba8276ff2c7c8ae21461d16cf3f702 (diff) |
fix for error with property getattro in recent commit which broke autocomp.
active base/bone & editbone were not converted to property srna
Diffstat (limited to 'source/blender/makesrna/intern/rna_armature.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_armature.c | 81 |
1 files changed, 57 insertions, 24 deletions
diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c index 25d602a8b2e..45710f11a4e 100644 --- a/source/blender/makesrna/intern/rna_armature.c +++ b/source/blender/makesrna/intern/rna_armature.c @@ -623,10 +623,64 @@ static void rna_def_edit_bone(BlenderRNA *brna) RNA_define_verify_sdna(1); } + +/* armature.bones.* */ +static void rna_def_armature_bones(BlenderRNA *brna, PropertyRNA *cprop) +{ + StructRNA *srna; + PropertyRNA *prop; + +// FunctionRNA *func; +// PropertyRNA *parm; + + srna= RNA_def_struct(brna, "ArmatureBones", NULL); + RNA_def_struct_sdna(srna, "bArmature"); + RNA_def_struct_ui_text(srna, "Armature Bones", "Collection of armature bones."); + + RNA_def_property_srna(cprop, "ArmatureBones"); + + prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); + RNA_def_property_struct_type(prop, "Bone"); + RNA_def_property_pointer_sdna(prop, NULL, "act_bone"); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Active Bone", "Armatures active bone."); + RNA_def_property_pointer_funcs(prop, NULL, "rna_Armature_act_bone_set", NULL); + + /* todo, redraw */ +// RNA_def_property_collection_active(prop, prop_act); +} + +/* armature.bones.* */ +static void rna_def_armature_edit_bones(BlenderRNA *brna, PropertyRNA *cprop) +{ + StructRNA *srna; + PropertyRNA *prop; + +// FunctionRNA *func; +// PropertyRNA *parm; + + srna= RNA_def_struct(brna, "ArmatureEditBones", NULL); + RNA_def_struct_sdna(srna, "bArmature"); + RNA_def_struct_ui_text(srna, "Armature EditBones", "Collection of armature edit bones."); + + RNA_def_property_srna(cprop, "ArmatureEditBones"); + + prop= RNA_def_property(srna, "edit_bones", PROP_POINTER, PROP_NONE); + RNA_def_property_struct_type(prop, "EditBone"); + RNA_def_property_pointer_sdna(prop, NULL, "act_edbone"); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Active EditBone", "Armatures active edit bone."); + //RNA_def_property_update(prop, 0, "rna_Armature_act_editbone_update"); + RNA_def_property_pointer_funcs(prop, NULL, "rna_Armature_act_edit_bone_set", NULL); + + /* todo, redraw */ +// RNA_def_property_collection_active(prop, prop_act); +} + static void rna_def_armature(BlenderRNA *brna) { StructRNA *srna; - PropertyRNA *prop, *prop_act; + PropertyRNA *prop; static EnumPropertyItem prop_drawtype_items[] = { {ARM_OCTA, "OCTAHEDRAL", 0, "Octahedral", "Display bones as octahedral shape (default)."}, @@ -666,34 +720,13 @@ static void rna_def_armature(BlenderRNA *brna) RNA_def_property_collection_funcs(prop, 0, "rna_Armature_bones_next", 0, 0, 0, 0, 0); RNA_def_property_struct_type(prop, "Bone"); RNA_def_property_ui_text(prop, "Bones", ""); - - { /* Collection active property */ - prop_act= RNA_def_property(srna, "bones__active", PROP_POINTER, PROP_NONE); - RNA_def_property_struct_type(prop_act, "Bone"); - RNA_def_property_pointer_sdna(prop_act, NULL, "act_bone"); - RNA_def_property_flag(prop_act, PROP_EDITABLE); - RNA_def_property_ui_text(prop_act, "Active Bone", "Armatures active bone."); - RNA_def_property_pointer_funcs(prop_act, NULL, "rna_Armature_act_bone_set", NULL); - - /* todo, redraw */ -// RNA_def_property_collection_active(prop, prop_act); - } + rna_def_armature_bones(brna, prop); prop= RNA_def_property(srna, "edit_bones", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "edbo", NULL); RNA_def_property_struct_type(prop, "EditBone"); RNA_def_property_ui_text(prop, "Edit Bones", ""); - - { /* Collection active property */ - prop_act= RNA_def_property(srna, "edit_bones__active", PROP_POINTER, PROP_NONE); - RNA_def_property_struct_type(prop_act, "EditBone"); - RNA_def_property_pointer_sdna(prop_act, NULL, "act_edbone"); - RNA_def_property_flag(prop_act, PROP_EDITABLE); - RNA_def_property_ui_text(prop_act, "Active EditBone", "Armatures active edit bone."); - //RNA_def_property_update(prop_act, 0, "rna_Armature_act_editbone_update"); - RNA_def_property_pointer_funcs(prop_act, NULL, "rna_Armature_act_edit_bone_set", NULL); -// RNA_def_property_collection_active(prop, prop_act); - } + rna_def_armature_edit_bones(brna, prop); /* Enum values */ // prop= RNA_def_property(srna, "rest_position", PROP_BOOLEAN, PROP_NONE); |