Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_armature.c
| Show All 32 Lines | |||||
| # include "BKE_main.h" | # include "BKE_main.h" | ||||
| # include "BKE_armature.h" | # include "BKE_armature.h" | ||||
| # include "ED_armature.h" | # include "ED_armature.h" | ||||
| # include "DEG_depsgraph.h" | # include "DEG_depsgraph.h" | ||||
| # include "DEG_depsgraph_build.h" | # include "DEG_depsgraph_build.h" | ||||
| static void rna_Armature_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) | |||||
| { | |||||
| ID *id = ptr->owner_id; | |||||
| DEG_id_tag_update(id, ID_RECALC_COPY_ON_WRITE); | |||||
| } | |||||
| static void rna_Armature_update_data(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) | static void rna_Armature_update_data(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) | ||||
| { | { | ||||
| ID *id = ptr->owner_id; | ID *id = ptr->owner_id; | ||||
| DEG_id_tag_update(id, 0); | DEG_id_tag_update(id, 0); | ||||
| WM_main_add_notifier(NC_GEOM | ND_DATA, id); | WM_main_add_notifier(NC_GEOM | ND_DATA, id); | ||||
| // WM_main_add_notifier(NC_OBJECT|ND_POSE, NULL); | // WM_main_add_notifier(NC_OBJECT|ND_POSE, NULL); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 1,311 Lines • ▼ Show 20 Lines | static void rna_def_armature_bones(BlenderRNA *brna, PropertyRNA *cprop) | ||||
| RNA_def_struct_ui_text(srna, "Armature Bones", "Collection of armature bones"); | RNA_def_struct_ui_text(srna, "Armature Bones", "Collection of armature bones"); | ||||
| prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); | prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); | ||||
| RNA_def_property_struct_type(prop, "Bone"); | RNA_def_property_struct_type(prop, "Bone"); | ||||
| RNA_def_property_pointer_sdna(prop, NULL, "act_bone"); | RNA_def_property_pointer_sdna(prop, NULL, "act_bone"); | ||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | RNA_def_property_flag(prop, PROP_EDITABLE); | ||||
| RNA_def_property_ui_text(prop, "Active Bone", "Armature's active bone"); | RNA_def_property_ui_text(prop, "Active Bone", "Armature's active bone"); | ||||
| RNA_def_property_pointer_funcs(prop, NULL, "rna_Armature_act_bone_set", NULL, NULL); | RNA_def_property_pointer_funcs(prop, NULL, "rna_Armature_act_bone_set", NULL, NULL); | ||||
| RNA_def_property_update(prop, 0, "rna_Armature_update"); | |||||
| /* TODO: redraw. */ | /* TODO: redraw. */ | ||||
| /* RNA_def_property_collection_active(prop, prop_act); */ | /* RNA_def_property_collection_active(prop, prop_act); */ | ||||
| } | } | ||||
| /* armature.bones.* */ | /* armature.bones.* */ | ||||
| static void rna_def_armature_edit_bones(BlenderRNA *brna, PropertyRNA *cprop) | static void rna_def_armature_edit_bones(BlenderRNA *brna, PropertyRNA *cprop) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| FunctionRNA *func; | FunctionRNA *func; | ||||
| PropertyRNA *parm; | PropertyRNA *parm; | ||||
| RNA_def_property_srna(cprop, "ArmatureEditBones"); | RNA_def_property_srna(cprop, "ArmatureEditBones"); | ||||
| srna = RNA_def_struct(brna, "ArmatureEditBones", NULL); | srna = RNA_def_struct(brna, "ArmatureEditBones", NULL); | ||||
| RNA_def_struct_sdna(srna, "bArmature"); | RNA_def_struct_sdna(srna, "bArmature"); | ||||
| RNA_def_struct_ui_text(srna, "Armature EditBones", "Collection of armature edit bones"); | RNA_def_struct_ui_text(srna, "Armature EditBones", "Collection of armature edit bones"); | ||||
| prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); | prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); | ||||
| RNA_def_property_struct_type(prop, "EditBone"); | RNA_def_property_struct_type(prop, "EditBone"); | ||||
| RNA_def_property_pointer_sdna(prop, NULL, "act_edbone"); | RNA_def_property_pointer_sdna(prop, NULL, "act_edbone"); | ||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | RNA_def_property_flag(prop, PROP_EDITABLE); | ||||
| RNA_def_property_ui_text(prop, "Active EditBone", "Armatures active edit bone"); | 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_update(prop, 0, "rna_Armature_update"); | ||||
| RNA_def_property_pointer_funcs(prop, NULL, "rna_Armature_act_edit_bone_set", NULL, NULL); | RNA_def_property_pointer_funcs(prop, NULL, "rna_Armature_act_edit_bone_set", NULL, NULL); | ||||
| /* 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); | ||||
| ▲ Show 20 Lines • Show All 188 Lines • Show Last 20 Lines | |||||