Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_armature.c
| Show First 20 Lines • Show All 942 Lines • ▼ Show 20 Lines | static void rna_def_armature_edit_bones(BlenderRNA *brna, PropertyRNA *cprop) | ||||
| /* todo, redraw */ | /* todo, redraw */ | ||||
| /* RNA_def_property_collection_active(prop, prop_act); */ | /* RNA_def_property_collection_active(prop, prop_act); */ | ||||
| /* add target */ | /* add target */ | ||||
| func = RNA_def_function(srna, "new", "rna_Armature_edit_bone_new"); | func = RNA_def_function(srna, "new", "rna_Armature_edit_bone_new"); | ||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS); | RNA_def_function_flag(func, FUNC_USE_REPORTS); | ||||
| RNA_def_function_ui_description(func, "Add a new bone"); | RNA_def_function_ui_description(func, "Add a new bone"); | ||||
| parm = RNA_def_string(func, "name", "Object", 0, "", "New name for the bone"); | parm = RNA_def_string(func, "name", "Object", 0, "", "New name for the bone"); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| /* return type */ | /* return type */ | ||||
| parm = RNA_def_pointer(func, "bone", "EditBone", "", "Newly created edit bone"); | parm = RNA_def_pointer(func, "bone", "EditBone", "", "Newly created edit bone"); | ||||
| RNA_def_function_return(func, parm); | RNA_def_function_return(func, parm); | ||||
| /* remove target */ | /* remove target */ | ||||
| func = RNA_def_function(srna, "remove", "rna_Armature_edit_bone_remove"); | func = RNA_def_function(srna, "remove", "rna_Armature_edit_bone_remove"); | ||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS); | RNA_def_function_flag(func, FUNC_USE_REPORTS); | ||||
| RNA_def_function_ui_description(func, "Remove an existing bone from the armature"); | RNA_def_function_ui_description(func, "Remove an existing bone from the armature"); | ||||
| /* target to remove*/ | /* target to remove*/ | ||||
| parm = RNA_def_pointer(func, "bone", "EditBone", "", "EditBone to remove"); | parm = RNA_def_pointer(func, "bone", "EditBone", "", "EditBone to remove"); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR); | RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR); | ||||
| RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); | RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0); | ||||
| } | } | ||||
| static void rna_def_armature(BlenderRNA *brna) | static void rna_def_armature(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| FunctionRNA *func; | |||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| FunctionRNA *func; | |||||
| PropertyRNA *parm; | |||||
| static EnumPropertyItem prop_drawtype_items[] = { | static EnumPropertyItem prop_drawtype_items[] = { | ||||
| {ARM_OCTA, "OCTAHEDRAL", 0, "Octahedral", "Display bones as octahedral shape (default)"}, | {ARM_OCTA, "OCTAHEDRAL", 0, "Octahedral", "Display bones as octahedral shape (default)"}, | ||||
| {ARM_LINE, "STICK", 0, "Stick", "Display bones as simple 2D lines with dots"}, | {ARM_LINE, "STICK", 0, "Stick", "Display bones as simple 2D lines with dots"}, | ||||
| {ARM_B_BONE, "BBONE", 0, "B-Bone", "Display bones as boxes, showing subdivision and B-Splines"}, | {ARM_B_BONE, "BBONE", 0, "B-Bone", "Display bones as boxes, showing subdivision and B-Splines"}, | ||||
| {ARM_ENVELOPE, "ENVELOPE", 0, "Envelope", | {ARM_ENVELOPE, "ENVELOPE", 0, "Envelope", | ||||
| "Display bones as extruded spheres, showing deformation influence volume"}, | "Display bones as extruded spheres, showing deformation influence volume"}, | ||||
| {ARM_WIRE, "WIRE", 0, "Wire", "Display bones as thin wires, showing subdivision and B-Splines"}, | {ARM_WIRE, "WIRE", 0, "Wire", "Display bones as thin wires, showing subdivision and B-Splines"}, | ||||
| {0, NULL, 0, NULL, NULL} | {0, NULL, 0, NULL, NULL} | ||||
| Show All 19 Lines | static void rna_def_armature(BlenderRNA *brna) | ||||
| srna = RNA_def_struct(brna, "Armature", "ID"); | srna = RNA_def_struct(brna, "Armature", "ID"); | ||||
| RNA_def_struct_ui_text(srna, "Armature", | RNA_def_struct_ui_text(srna, "Armature", | ||||
| "Armature data-block containing a hierarchy of bones, usually used for rigging characters"); | "Armature data-block containing a hierarchy of bones, usually used for rigging characters"); | ||||
| RNA_def_struct_ui_icon(srna, ICON_ARMATURE_DATA); | RNA_def_struct_ui_icon(srna, ICON_ARMATURE_DATA); | ||||
| RNA_def_struct_sdna(srna, "bArmature"); | RNA_def_struct_sdna(srna, "bArmature"); | ||||
| func = RNA_def_function(srna, "transform", "rna_Armature_transform"); | func = RNA_def_function(srna, "transform", "rna_Armature_transform"); | ||||
| RNA_def_function_ui_description(func, "Transform armature bones by a matrix"); | RNA_def_function_ui_description(func, "Transform armature bones by a matrix"); | ||||
| prop = RNA_def_float_matrix(func, "matrix", 4, 4, NULL, 0.0f, 0.0f, "", "Matrix", 0.0f, 0.0f); | parm = RNA_def_float_matrix(func, "matrix", 4, 4, NULL, 0.0f, 0.0f, "", "Matrix", 0.0f, 0.0f); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| /* Animation Data */ | /* Animation Data */ | ||||
| rna_def_animdata_common(srna); | rna_def_animdata_common(srna); | ||||
| /* Collections */ | /* Collections */ | ||||
| prop = RNA_def_property(srna, "bones", PROP_COLLECTION, PROP_NONE); | prop = RNA_def_property(srna, "bones", PROP_COLLECTION, PROP_NONE); | ||||
| RNA_def_property_collection_sdna(prop, NULL, "bonebase", NULL); | RNA_def_property_collection_sdna(prop, NULL, "bonebase", NULL); | ||||
| RNA_def_property_collection_funcs(prop, NULL, "rna_Armature_bones_next", NULL, NULL, NULL, NULL, NULL, NULL); | RNA_def_property_collection_funcs(prop, NULL, "rna_Armature_bones_next", NULL, NULL, NULL, NULL, NULL, NULL); | ||||
| ▲ Show 20 Lines • Show All 162 Lines • Show Last 20 Lines | |||||