diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-06-22 11:29:45 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-06-22 11:39:28 +0300 |
commit | f1824507e2b73859ede1c2e850d05795f10da6bb (patch) | |
tree | 343d8c02b161506775d2825c83955737436b38b0 /source/blender/editors/mesh/editmesh_bisect.c | |
parent | 87adeb8dd91db5bfada04f6df749c28cc4b79251 (diff) |
Manipulator: target property definitions
Changes from custom-manipulator branch.
- use property type definitions.
- add property free callback.
- move properties into the wmManipulator struct (over alloc).
- use array length from property types instead of arg passing.
Diffstat (limited to 'source/blender/editors/mesh/editmesh_bisect.c')
-rw-r--r-- | source/blender/editors/mesh/editmesh_bisect.c | 48 |
1 files changed, 26 insertions, 22 deletions
diff --git a/source/blender/editors/mesh/editmesh_bisect.c b/source/blender/editors/mesh/editmesh_bisect.c index 4d301c009ee..8f1ba716b83 100644 --- a/source/blender/editors/mesh/editmesh_bisect.c +++ b/source/blender/editors/mesh/editmesh_bisect.c @@ -456,14 +456,14 @@ static void manipulator_mesh_bisect_update_from_op(ManipulatorGroup *man) /* depth callbacks */ static void manipulator_bisect_prop_depth_get( - const wmManipulator *mpr, wmManipulatorProperty *UNUSED(mpr_prop), void *UNUSED(user_data), - float *value, uint value_len) + const wmManipulator *mpr, wmManipulatorProperty *mpr_prop, + float *value) { ManipulatorGroup *man = mpr->parent_mgroup->customdata; wmOperator *op = man->data.op; - BLI_assert(value_len == 1); - UNUSED_VARS_NDEBUG(value_len); + BLI_assert(mpr_prop->type->array_length == 1); + UNUSED_VARS_NDEBUG(mpr_prop); float plane_co[3], plane_no[3]; RNA_property_float_get_array(op->ptr, man->data.prop_plane_co, plane_co); @@ -473,14 +473,14 @@ static void manipulator_bisect_prop_depth_get( } static void manipulator_bisect_prop_depth_set( - const wmManipulator *mpr, wmManipulatorProperty *UNUSED(mpr_prop), void *UNUSED(user_data), - const float *value, uint value_len) + const wmManipulator *mpr, wmManipulatorProperty *mpr_prop, + const float *value) { ManipulatorGroup *man = mpr->parent_mgroup->customdata; wmOperator *op = man->data.op; - BLI_assert(value_len == 1); - UNUSED_VARS_NDEBUG(value_len); + BLI_assert(mpr_prop->type->array_length == 1); + UNUSED_VARS_NDEBUG(mpr_prop); float plane_co[3], plane[4]; RNA_property_float_get_array(op->ptr, man->data.prop_plane_co, plane_co); @@ -499,24 +499,28 @@ static void manipulator_bisect_prop_depth_set( /* translate callbacks */ static void manipulator_bisect_prop_translate_get( - const wmManipulator *mpr, wmManipulatorProperty *UNUSED(mpr_prop), void *UNUSED(user_data), - float *value, uint value_len) + const wmManipulator *mpr, wmManipulatorProperty *mpr_prop, + float *value) { ManipulatorGroup *man = mpr->parent_mgroup->customdata; wmOperator *op = man->data.op; - BLI_assert(value_len == 3); + BLI_assert(mpr_prop->type->array_length == 3); + UNUSED_VARS_NDEBUG(mpr_prop); + RNA_property_float_get_array(op->ptr, man->data.prop_plane_co, value); } static void manipulator_bisect_prop_translate_set( - const wmManipulator *mpr, wmManipulatorProperty *UNUSED(mpr_prop), void *UNUSED(user_data), - const float *value, uint value_len) + const wmManipulator *mpr, wmManipulatorProperty *mpr_prop, + const float *value) { ManipulatorGroup *man = mpr->parent_mgroup->customdata; wmOperator *op = man->data.op; - BLI_assert(value_len == 3); + BLI_assert(mpr_prop->type->array_length == 3); + UNUSED_VARS_NDEBUG(mpr_prop); + RNA_property_float_set_array(op->ptr, man->data.prop_plane_co, value); manipulator_bisect_exec(man); @@ -524,14 +528,14 @@ static void manipulator_bisect_prop_translate_set( /* angle callbacks */ static void manipulator_bisect_prop_angle_get( - const wmManipulator *mpr, wmManipulatorProperty *UNUSED(mpr_prop), void *UNUSED(user_data), - float *value, uint value_len) + const wmManipulator *mpr, wmManipulatorProperty *mpr_prop, + float *value) { ManipulatorGroup *man = mpr->parent_mgroup->customdata; wmOperator *op = man->data.op; - BLI_assert(value_len == 1); - UNUSED_VARS_NDEBUG(value_len); + BLI_assert(mpr_prop->type->array_length == 1); + UNUSED_VARS_NDEBUG(mpr_prop); float plane_no[4]; RNA_property_float_get_array(op->ptr, man->data.prop_plane_no, plane_no); @@ -550,14 +554,14 @@ static void manipulator_bisect_prop_angle_get( } static void manipulator_bisect_prop_angle_set( - const wmManipulator *mpr, wmManipulatorProperty *UNUSED(mpr_prop), void *UNUSED(user_data), - const float *value, uint value_len) + const wmManipulator *mpr, wmManipulatorProperty *mpr_prop, + const float *value) { ManipulatorGroup *man = mpr->parent_mgroup->customdata; wmOperator *op = man->data.op; - BLI_assert(value_len == 1); - UNUSED_VARS_NDEBUG(value_len); + BLI_assert(mpr_prop->type->array_length == 1); + UNUSED_VARS_NDEBUG(mpr_prop); float plane_no[4]; RNA_property_float_get_array(op->ptr, man->data.prop_plane_no, plane_no); |