diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_pose.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_pose.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c index ac27a6c21a5..f50be85c446 100644 --- a/source/blender/makesrna/intern/rna_pose.c +++ b/source/blender/makesrna/intern/rna_pose.c @@ -106,9 +106,11 @@ const EnumPropertyItem rna_enum_color_sets_items[] = { #include "BKE_context.h" #include "BKE_constraint.h" -#include "BKE_depsgraph.h" #include "BKE_idprop.h" +#include "DEG_depsgraph.h" +#include "DEG_depsgraph_build.h" + #include "ED_object.h" #include "ED_armature.h" @@ -120,7 +122,7 @@ static void rna_Pose_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRN { /* XXX when to use this? ob->pose->flag |= (POSE_LOCKED|POSE_DO_UNLOCK); */ - DAG_id_tag_update(ptr->id.data, OB_RECALC_DATA); + DEG_id_tag_update(ptr->id.data, OB_RECALC_DATA); } static void rna_Pose_IK_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) @@ -128,7 +130,7 @@ static void rna_Pose_IK_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Pointe /* XXX when to use this? ob->pose->flag |= (POSE_LOCKED|POSE_DO_UNLOCK); */ Object *ob = ptr->id.data; - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); BIK_clear_data(ob->pose); } @@ -233,13 +235,13 @@ static void rna_Pose_ik_solver_update(Main *bmain, Scene *UNUSED(scene), Pointer bPose *pose = ptr->data; BKE_pose_tag_recalc(bmain, pose); /* checks & sorts pose channels */ - DAG_relations_tag_update(bmain); + DEG_relations_tag_update(bmain); BKE_pose_update_constraint_flags(pose); object_test_constraints(ob); - DAG_id_tag_update(&ob->id, OB_RECALC_DATA | OB_RECALC_OB); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA | OB_RECALC_OB); } /* rotation - axis-angle */ @@ -349,7 +351,7 @@ static void rna_Itasc_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerR itasc->maxvel = 100.f; BIK_update_param(ob->pose); - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); } static void rna_Itasc_update_rebuild(Main *bmain, Scene *scene, PointerRNA *ptr) @@ -671,7 +673,7 @@ static void rna_PoseChannel_matrix_set(PointerRNA *ptr, const float *values) Object *ob = (Object *)ptr->id.data; float tmat[4][4]; - BKE_armature_mat_pose_to_bone_ex(ob, pchan, (float (*)[4])values, tmat); + BKE_armature_mat_pose_to_bone_ex(NULL, ob, pchan, (float (*)[4])values, tmat); BKE_pchan_apply_mat4(pchan, tmat, false); /* no compat for predictable result */ } @@ -821,22 +823,26 @@ static void rna_def_pose_channel(BlenderRNA *brna) prop = RNA_def_property(srna, "bone", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_struct_type(prop, "Bone"); + RNA_def_property_flag(prop, PROP_PTR_NO_OWNERSHIP); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Bone", "Bone associated with this PoseBone"); prop = RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "PoseBone"); + RNA_def_property_flag(prop, PROP_PTR_NO_OWNERSHIP); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Parent", "Parent of this pose bone"); prop = RNA_def_property(srna, "child", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "PoseBone"); + RNA_def_property_flag(prop, PROP_PTR_NO_OWNERSHIP); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Child", "Child of this pose bone"); /* Transformation settings */ prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION); RNA_def_property_float_sdna(prop, NULL, "loc"); + RNA_def_property_flag(prop, PROP_OVERRIDABLE_STATIC); RNA_def_property_editable_array_func(prop, "rna_PoseChannel_location_editable"); RNA_def_property_ui_text(prop, "Location", ""); RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT); @@ -844,7 +850,7 @@ static void rna_def_pose_channel(BlenderRNA *brna) prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ); RNA_def_property_float_sdna(prop, NULL, "size"); - RNA_def_property_flag(prop, PROP_PROPORTIONAL); + RNA_def_property_flag(prop, PROP_PROPORTIONAL | PROP_OVERRIDABLE_STATIC); RNA_def_property_editable_array_func(prop, "rna_PoseChannel_scale_editable"); RNA_def_property_float_array_default(prop, default_scale); RNA_def_property_ui_text(prop, "Scale", ""); @@ -852,6 +858,7 @@ static void rna_def_pose_channel(BlenderRNA *brna) prop = RNA_def_property(srna, "rotation_quaternion", PROP_FLOAT, PROP_QUATERNION); RNA_def_property_float_sdna(prop, NULL, "quat"); + RNA_def_property_flag(prop, PROP_OVERRIDABLE_STATIC); RNA_def_property_editable_array_func(prop, "rna_PoseChannel_rotation_4d_editable"); RNA_def_property_float_array_default(prop, default_quat); RNA_def_property_ui_text(prop, "Quaternion Rotation", "Rotation in Quaternions"); @@ -861,6 +868,7 @@ static void rna_def_pose_channel(BlenderRNA *brna) * having a single one is better for Keyframing and other property-management situations... */ prop = RNA_def_property(srna, "rotation_axis_angle", PROP_FLOAT, PROP_AXISANGLE); + RNA_def_property_flag(prop, PROP_OVERRIDABLE_STATIC); RNA_def_property_array(prop, 4); RNA_def_property_float_funcs(prop, "rna_PoseChannel_rotation_axis_angle_get", "rna_PoseChannel_rotation_axis_angle_set", NULL); @@ -871,6 +879,7 @@ static void rna_def_pose_channel(BlenderRNA *brna) prop = RNA_def_property(srna, "rotation_euler", PROP_FLOAT, PROP_EULER); RNA_def_property_float_sdna(prop, NULL, "eul"); + RNA_def_property_flag(prop, PROP_OVERRIDABLE_STATIC); RNA_def_property_editable_array_func(prop, "rna_PoseChannel_rotation_euler_editable"); RNA_def_property_ui_text(prop, "Euler Rotation", "Rotation in Eulers"); RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); @@ -1397,6 +1406,7 @@ static void rna_def_pose(BlenderRNA *brna) prop = RNA_def_property(srna, "bones", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "chanbase", NULL); RNA_def_property_struct_type(prop, "PoseBone"); + RNA_def_property_flag(prop, PROP_OVERRIDABLE_STATIC); RNA_def_property_ui_text(prop, "Pose Bones", "Individual pose bones for the armature"); /* can be removed, only for fast lookup */ RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, NULL, NULL, NULL, "rna_PoseBones_lookup_string", NULL); |