diff options
author | Thomas Dinges <blender@dingto.org> | 2010-11-26 20:11:16 +0300 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2010-11-26 20:11:16 +0300 |
commit | d6a90a6bff52b5bfeb20f94307a5c81b0ec25d5a (patch) | |
tree | 274252e29f6b0552128ba9093f4469e8a8df1802 /source | |
parent | fb42188c18097e57596c53191cfa923d916dba6c (diff) |
Rigid Body Joint Constraint:
* RNA fix for my last commit, we want the last 3 items of the array, not the first 3, added get/set functions.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/makesrna/intern/rna_constraint.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index f46827f95a6..ffc42eb97e4 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -324,6 +324,47 @@ static void rna_SplineIKConstraint_joint_bindings_set(PointerRNA *ptr, const flo memcpy(ikData->points, values, ikData->numpoints * sizeof(float)); } +/* Array Get/Set Functions for RigidBodyJointConstraint Min/Max Cone Limits */ +void rna_RigidBodyJointConstraint_limit_cone_min_get(PointerRNA *ptr, float values[3]) +{ + bRigidBodyJointConstraint *data= (bRigidBodyJointConstraint*)(((bConstraint*)ptr->data)->data); + float *limit = data->minLimit; + + values[0]= limit[3]; + values[1]= limit[4]; + values[2]= limit[5]; +} + +static void rna_RigidBodyJointConstraint_limit_cone_min_set(PointerRNA *ptr, const float values[3]) +{ + bRigidBodyJointConstraint *data= (bRigidBodyJointConstraint*)(((bConstraint*)ptr->data)->data); + float *limit = data->minLimit; + + limit[3]= values[0]; + limit[4]= values[1]; + limit[5]= values[2]; +} + +void rna_RigidBodyJointConstraint_limit_cone_max_get(PointerRNA *ptr, float values[3]) +{ + bRigidBodyJointConstraint *data= (bRigidBodyJointConstraint*)(((bConstraint*)ptr->data)->data); + float *limit = data->maxLimit; + + values[0]= limit[3]; + values[1]= limit[4]; + values[2]= limit[5]; +} + +static void rna_RigidBodyJointConstraint_limit_cone_max_set(PointerRNA *ptr, const float values[3]) +{ + bRigidBodyJointConstraint *data= (bRigidBodyJointConstraint*)(((bConstraint*)ptr->data)->data); + float *limit = data->maxLimit; + + limit[3]= values[0]; + limit[4]= values[1]; + limit[5]= values[2]; +} + #else EnumPropertyItem constraint_distance_items[] = { @@ -1269,11 +1310,13 @@ static void rna_def_constraint_rigid_body_joint(BlenderRNA *brna) /* Limit Min/Max for Cone Twist */ prop= RNA_def_property(srna, "limit_cone_min", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "minLimit"); + RNA_def_property_float_funcs(prop, "rna_RigidBodyJointConstraint_limit_cone_min_get", "rna_RigidBodyJointConstraint_limit_cone_min_set", NULL); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Minimum Limit", ""); prop= RNA_def_property(srna, "limit_cone_max", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "maxLimit"); + RNA_def_property_float_funcs(prop, "rna_RigidBodyJointConstraint_limit_cone_max_get", "rna_RigidBodyJointConstraint_limit_cone_max_set", NULL); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Maximum Limit", ""); |