From 85c5c5531e990b12fed60c428b70f887c1bd0c81 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 21 Jun 2017 17:06:24 +1000 Subject: Manipulator: edit_properties -> target_properties Naming was too confusing between properties of a manipulator and properties it edits. --- .../manipulator_library_utils.c | 6 ++--- .../manipulator_types/arrow3d_manipulator.c | 28 +++++++++++----------- .../manipulator_types/cage2d_manipulator.c | 8 +++---- .../manipulator_types/dial3d_manipulator.c | 14 +++++------ .../manipulator_types/grab3d_manipulator.c | 12 +++++----- source/blender/editors/mesh/editmesh_bisect.c | 6 ++--- source/blender/editors/mesh/editmesh_extrude.c | 8 +++---- .../blender/editors/space_node/node_manipulators.c | 4 ++-- .../editors/space_view3d/view3d_manipulators.c | 10 ++++---- 9 files changed, 48 insertions(+), 48 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/manipulator_library/manipulator_library_utils.c b/source/blender/editors/manipulator_library/manipulator_library_utils.c index 093842aeb65..9c182fcf4bc 100644 --- a/source/blender/editors/manipulator_library/manipulator_library_utils.c +++ b/source/blender/editors/manipulator_library/manipulator_library_utils.c @@ -116,12 +116,12 @@ void manipulator_property_data_update( return; } - float value = WM_manipulator_property_value_get(mpr, mpr_prop); + float value = WM_manipulator_target_property_value_get(mpr, mpr_prop); if (constrained) { if ((data->flag & MANIPULATOR_CUSTOM_RANGE_SET) == 0) { float range[2]; - WM_manipulator_property_range_get(mpr, mpr_prop, range); + WM_manipulator_target_property_range_get(mpr, mpr_prop, range); data->range = range[1] - range[0]; data->min = range[0]; } @@ -136,7 +136,7 @@ void manipulator_property_value_reset( bContext *C, const wmManipulator *mpr, ManipulatorInteraction *inter, wmManipulatorProperty *mpr_prop) { - WM_manipulator_property_value_set(C, mpr, mpr_prop, inter->init_value); + WM_manipulator_target_property_value_set(C, mpr, mpr_prop, inter->init_value); } /* -------------------------------------------------------------------- */ diff --git a/source/blender/editors/manipulator_library/manipulator_types/arrow3d_manipulator.c b/source/blender/editors/manipulator_library/manipulator_types/arrow3d_manipulator.c index 17e5d53874d..e13815f3997 100644 --- a/source/blender/editors/manipulator_library/manipulator_types/arrow3d_manipulator.c +++ b/source/blender/editors/manipulator_library/manipulator_types/arrow3d_manipulator.c @@ -327,19 +327,19 @@ static void manipulator_arrow_modal(bContext *C, wmManipulator *mpr, const wmEve ManipulatorCommonData *data = &arrow->data; const float ofs_new = facdir * len_v3(offset); - wmManipulatorProperty *mpr_prop = WM_manipulator_property_find(mpr, "offset"); + wmManipulatorProperty *mpr_prop = WM_manipulator_target_property_find(mpr, "offset"); /* set the property for the operator and call its modal function */ - if (WM_manipulator_property_is_valid(mpr_prop)) { + if (WM_manipulator_target_property_is_valid(mpr_prop)) { const int draw_options = RNA_enum_get(arrow->manipulator.ptr, "draw_options"); const bool constrained = (draw_options & ED_MANIPULATOR_ARROW_STYLE_CONSTRAINED) != 0; const bool inverted = (draw_options & ED_MANIPULATOR_ARROW_STYLE_INVERTED) != 0; const bool use_precision = (flag & WM_MANIPULATOR_TWEAK_PRECISE) != 0; float value = manipulator_value_from_offset(data, inter, ofs_new, constrained, inverted, use_precision); - WM_manipulator_property_value_set(C, mpr, mpr_prop, value); + WM_manipulator_target_property_value_set(C, mpr, mpr_prop, value); /* get clamped value */ - value = WM_manipulator_property_value_get(mpr, mpr_prop); + value = WM_manipulator_target_property_value_get(mpr, mpr_prop); data->offset = manipulator_offset_from_value(data, value, constrained, inverted); } @@ -366,11 +366,11 @@ static void manipulator_arrow_invoke( { ArrowManipulator3D *arrow = (ArrowManipulator3D *)mpr; ManipulatorInteraction *inter = MEM_callocN(sizeof(ManipulatorInteraction), __func__); - wmManipulatorProperty *mpr_prop = WM_manipulator_property_find(mpr, "offset"); + wmManipulatorProperty *mpr_prop = WM_manipulator_target_property_find(mpr, "offset"); /* Some manipulators don't use properties. */ - if (mpr_prop && WM_manipulator_property_is_valid(mpr_prop)) { - inter->init_value = WM_manipulator_property_value_get(mpr, mpr_prop); + if (mpr_prop && WM_manipulator_target_property_is_valid(mpr_prop)) { + inter->init_value = WM_manipulator_target_property_value_get(mpr, mpr_prop); } inter->init_offset = arrow->data.offset; @@ -403,7 +403,7 @@ static void manipulator_arrow_exit(bContext *C, wmManipulator *mpr, const bool c ManipulatorCommonData *data = &arrow->data; ManipulatorInteraction *inter = mpr->interaction_data; - wmManipulatorProperty *mpr_prop = WM_manipulator_property_find(mpr, "offset"); + wmManipulatorProperty *mpr_prop = WM_manipulator_target_property_find(mpr, "offset"); manipulator_property_value_reset(C, mpr, inter, mpr_prop); data->offset = inter->init_offset; } @@ -417,15 +417,15 @@ static void manipulator_arrow_exit(bContext *C, wmManipulator *mpr, const bool c /** * Define a custom property UI range * - * \note Needs to be called before WM_manipulator_property_def_rna! + * \note Needs to be called before WM_manipulator_target_property_def_rna! */ void ED_manipulator_arrow3d_set_ui_range(wmManipulator *mpr, const float min, const float max) { ArrowManipulator3D *arrow = (ArrowManipulator3D *)mpr; BLI_assert(min < max); - BLI_assert(!(WM_manipulator_property_find(mpr, "offset") && "Make sure this function " - "is called before WM_manipulator_property_def_rna")); + BLI_assert(!(WM_manipulator_target_property_find(mpr, "offset") && "Make sure this function " + "is called before WM_manipulator_target_property_def_rna")); arrow->data.range = max - min; arrow->data.min = min; @@ -435,13 +435,13 @@ void ED_manipulator_arrow3d_set_ui_range(wmManipulator *mpr, const float min, co /** * Define a custom factor for arrow min/max distance * - * \note Needs to be called before WM_manipulator_property_def_rna! + * \note Needs to be called before WM_manipulator_target_property_def_rna! */ void ED_manipulator_arrow3d_set_range_fac(wmManipulator *mpr, const float range_fac) { ArrowManipulator3D *arrow = (ArrowManipulator3D *)mpr; - BLI_assert(!(WM_manipulator_property_find(mpr, "offset") && "Make sure this function " - "is called before WM_manipulator_property_def_rna")); + BLI_assert(!(WM_manipulator_target_property_find(mpr, "offset") && "Make sure this function " + "is called before WM_manipulator_target_property_def_rna")); arrow->data.range_fac = range_fac; } diff --git a/source/blender/editors/manipulator_library/manipulator_types/cage2d_manipulator.c b/source/blender/editors/manipulator_library/manipulator_types/cage2d_manipulator.c index 21e5778d509..f35e3b481a6 100644 --- a/source/blender/editors/manipulator_library/manipulator_types/cage2d_manipulator.c +++ b/source/blender/editors/manipulator_library/manipulator_types/cage2d_manipulator.c @@ -510,13 +510,13 @@ static void manipulator_rect_transform_modal( wmManipulatorProperty *mpr_prop; - mpr_prop = WM_manipulator_property_find(mpr, "offset"); + mpr_prop = WM_manipulator_target_property_find(mpr, "offset"); if (mpr_prop->prop != NULL) { RNA_property_float_set_array(&mpr_prop->ptr, mpr_prop->prop, mpr->matrix_offset[3]); RNA_property_update(C, &mpr_prop->ptr, mpr_prop->prop); } - mpr_prop = WM_manipulator_property_find(mpr, "scale"); + mpr_prop = WM_manipulator_target_property_find(mpr, "scale"); if (mpr_prop->prop != NULL) { if (transform_flag & ED_MANIPULATOR_RECT_TRANSFORM_FLAG_SCALE_UNIFORM) { RNA_property_float_set(&mpr_prop->ptr, mpr_prop->prop, scale[0]); @@ -556,13 +556,13 @@ static void manipulator_rect_transform_exit(bContext *C, wmManipulator *mpr, con wmManipulatorProperty *mpr_prop; /* reset properties */ - mpr_prop = WM_manipulator_property_find(mpr, "offset"); + mpr_prop = WM_manipulator_target_property_find(mpr, "offset"); if (mpr_prop->prop != NULL) { RNA_property_float_set_array(&mpr_prop->ptr, mpr_prop->prop, data->orig_offset); RNA_property_update(C, &mpr_prop->ptr, mpr_prop->prop); } - mpr_prop = WM_manipulator_property_find(mpr, "scale"); + mpr_prop = WM_manipulator_target_property_find(mpr, "scale"); if (mpr_prop->prop != NULL) { const int transform_flag = RNA_enum_get(mpr->ptr, "transform"); if (transform_flag & ED_MANIPULATOR_RECT_TRANSFORM_FLAG_SCALE_UNIFORM) { diff --git a/source/blender/editors/manipulator_library/manipulator_types/dial3d_manipulator.c b/source/blender/editors/manipulator_library/manipulator_types/dial3d_manipulator.c index e8b1a583be9..40cf67e1133 100644 --- a/source/blender/editors/manipulator_library/manipulator_types/dial3d_manipulator.c +++ b/source/blender/editors/manipulator_library/manipulator_types/dial3d_manipulator.c @@ -293,7 +293,7 @@ static void dial_draw_intern( DialInteraction *inter = mpr->interaction_data; /* XXX, View3D rotation manipulator doesn't call modal. */ - if (mpr->properties_edit.first == NULL) { + if (mpr->target_properties.first == NULL) { wmWindow *win = CTX_wm_window(C); manipulator_dial_modal((bContext *)C, mpr, win->eventstate, 0); } @@ -396,9 +396,9 @@ static void manipulator_dial_modal(bContext *C, wmManipulator *mpr, const wmEven inter->output.angle_ofs = angle_ofs; /* set the property for the operator and call its modal function */ - wmManipulatorProperty *mpr_prop = WM_manipulator_property_find(mpr, "offset"); - if (mpr_prop && WM_manipulator_property_is_valid(mpr_prop)) { - WM_manipulator_property_value_set(C, mpr, mpr_prop, inter->init_prop_angle + angle_delta); + wmManipulatorProperty *mpr_prop = WM_manipulator_target_property_find(mpr, "offset"); + if (mpr_prop && WM_manipulator_target_property_is_valid(mpr_prop)) { + WM_manipulator_target_property_value_set(C, mpr, mpr_prop, inter->init_prop_angle + angle_delta); } } @@ -419,9 +419,9 @@ static void manipulator_dial_invoke( inter->init_mval[0] = event->mval[0]; inter->init_mval[1] = event->mval[1]; - wmManipulatorProperty *mpr_prop = WM_manipulator_property_find(mpr, "offset"); - if (mpr_prop && WM_manipulator_property_is_valid(mpr_prop)) { - inter->init_prop_angle = WM_manipulator_property_value_get(mpr, mpr_prop); + wmManipulatorProperty *mpr_prop = WM_manipulator_target_property_find(mpr, "offset"); + if (mpr_prop && WM_manipulator_target_property_is_valid(mpr_prop)) { + inter->init_prop_angle = WM_manipulator_target_property_value_get(mpr, mpr_prop); } mpr->interaction_data = inter; diff --git a/source/blender/editors/manipulator_library/manipulator_types/grab3d_manipulator.c b/source/blender/editors/manipulator_library/manipulator_types/grab3d_manipulator.c index b5eccaf2699..527e29c79e8 100644 --- a/source/blender/editors/manipulator_library/manipulator_types/grab3d_manipulator.c +++ b/source/blender/editors/manipulator_library/manipulator_types/grab3d_manipulator.c @@ -196,9 +196,9 @@ static void manipulator_grab_modal(bContext *C, wmManipulator *mpr, const wmEven add_v3_v3v3(inter->output.co_final, inter->init_prop_co, inter->output.co_ofs); /* set the property for the operator and call its modal function */ - wmManipulatorProperty *mpr_prop = WM_manipulator_property_find(mpr, "offset"); - if (mpr_prop && WM_manipulator_property_is_valid(mpr_prop)) { - WM_manipulator_property_value_set_array(C, mpr, mpr_prop, inter->output.co_final, 3); + wmManipulatorProperty *mpr_prop = WM_manipulator_target_property_find(mpr, "offset"); + if (mpr_prop && WM_manipulator_target_property_is_valid(mpr_prop)) { + WM_manipulator_target_property_value_set_array(C, mpr, mpr_prop, inter->output.co_final, 3); } } @@ -210,9 +210,9 @@ static void manipulator_grab_invoke( inter->init_mval[0] = event->mval[0]; inter->init_mval[1] = event->mval[1]; - wmManipulatorProperty *mpr_prop = WM_manipulator_property_find(mpr, "offset"); - if (mpr_prop && WM_manipulator_property_is_valid(mpr_prop)) { - WM_manipulator_property_value_get_array(mpr, mpr_prop, inter->init_prop_co, 3); + wmManipulatorProperty *mpr_prop = WM_manipulator_target_property_find(mpr, "offset"); + if (mpr_prop && WM_manipulator_target_property_is_valid(mpr_prop)) { + WM_manipulator_target_property_value_get_array(mpr, mpr_prop, inter->init_prop_co, 3); } mpr->interaction_data = inter; diff --git a/source/blender/editors/mesh/editmesh_bisect.c b/source/blender/editors/mesh/editmesh_bisect.c index 34644bb7fd6..4d301c009ee 100644 --- a/source/blender/editors/mesh/editmesh_bisect.c +++ b/source/blender/editors/mesh/editmesh_bisect.c @@ -628,7 +628,7 @@ static void manipulator_mesh_bisect_setup(const bContext *C, wmManipulatorGroup /* Setup property callbacks */ { - WM_manipulator_property_def_func( + WM_manipulator_target_property_def_func( man->translate_z, "offset", &(const struct wmManipulatorPropertyFnParams) { .value_get_fn = manipulator_bisect_prop_depth_get, @@ -637,7 +637,7 @@ static void manipulator_mesh_bisect_setup(const bContext *C, wmManipulatorGroup .user_data = NULL, }); - WM_manipulator_property_def_func( + WM_manipulator_target_property_def_func( man->translate_c, "offset", &(const struct wmManipulatorPropertyFnParams) { .value_get_fn = manipulator_bisect_prop_translate_get, @@ -646,7 +646,7 @@ static void manipulator_mesh_bisect_setup(const bContext *C, wmManipulatorGroup .user_data = NULL, }); - WM_manipulator_property_def_func( + WM_manipulator_target_property_def_func( man->rotate_c, "offset", &(const struct wmManipulatorPropertyFnParams) { .value_get_fn = manipulator_bisect_prop_angle_get, diff --git a/source/blender/editors/mesh/editmesh_extrude.c b/source/blender/editors/mesh/editmesh_extrude.c index cfeff6a65af..32f5dcd5526 100644 --- a/source/blender/editors/mesh/editmesh_extrude.c +++ b/source/blender/editors/mesh/editmesh_extrude.c @@ -1090,7 +1090,7 @@ static void manipulator_mesh_spin_setup(const bContext *C, wmManipulatorGroup *m /* Setup property callbacks */ { - WM_manipulator_property_def_func( + WM_manipulator_target_property_def_func( man->translate_z, "offset", &(const struct wmManipulatorPropertyFnParams) { .value_get_fn = manipulator_spin_prop_depth_get, @@ -1099,7 +1099,7 @@ static void manipulator_mesh_spin_setup(const bContext *C, wmManipulatorGroup *m .user_data = NULL, }); - WM_manipulator_property_def_func( + WM_manipulator_target_property_def_func( man->translate_c, "offset", &(const struct wmManipulatorPropertyFnParams) { .value_get_fn = manipulator_spin_prop_translate_get, @@ -1108,7 +1108,7 @@ static void manipulator_mesh_spin_setup(const bContext *C, wmManipulatorGroup *m .user_data = NULL, }); - WM_manipulator_property_def_func( + WM_manipulator_target_property_def_func( man->rotate_c, "offset", &(const struct wmManipulatorPropertyFnParams) { .value_get_fn = manipulator_spin_prop_axis_angle_get, @@ -1117,7 +1117,7 @@ static void manipulator_mesh_spin_setup(const bContext *C, wmManipulatorGroup *m .user_data = NULL, }); - WM_manipulator_property_def_func( + WM_manipulator_target_property_def_func( man->angle_z, "offset", &(const struct wmManipulatorPropertyFnParams) { .value_get_fn = manipulator_spin_prop_angle_get, diff --git a/source/blender/editors/space_node/node_manipulators.c b/source/blender/editors/space_node/node_manipulators.c index e3f699cabdf..8b4ebd70874 100644 --- a/source/blender/editors/space_node/node_manipulators.c +++ b/source/blender/editors/space_node/node_manipulators.c @@ -96,8 +96,8 @@ static void WIDGETGROUP_node_transform_refresh(const bContext *C, wmManipulatorG SpaceNode *snode = CTX_wm_space_node(C); PointerRNA nodeptr; RNA_pointer_create(snode->id, &RNA_SpaceNodeEditor, snode, &nodeptr); - WM_manipulator_property_def_rna(cage, "offset", &nodeptr, "backdrop_offset", -1); - WM_manipulator_property_def_rna(cage, "scale", &nodeptr, "backdrop_zoom", -1); + WM_manipulator_target_property_def_rna(cage, "offset", &nodeptr, "backdrop_offset", -1); + WM_manipulator_target_property_def_rna(cage, "scale", &nodeptr, "backdrop_zoom", -1); } else { WM_manipulator_set_flag(cage, WM_MANIPULATOR_HIDDEN, true); diff --git a/source/blender/editors/space_view3d/view3d_manipulators.c b/source/blender/editors/space_view3d/view3d_manipulators.c index 907fe91009a..4d1357e1297 100644 --- a/source/blender/editors/space_view3d/view3d_manipulators.c +++ b/source/blender/editors/space_view3d/view3d_manipulators.c @@ -104,7 +104,7 @@ static void WIDGETGROUP_lamp_refresh(const bContext *C, wmManipulatorGroup *mgro PointerRNA lamp_ptr; const char *propname = "spot_size"; RNA_pointer_create(&la->id, &RNA_Lamp, la, &lamp_ptr); - WM_manipulator_property_def_rna(wwrapper->manipulator, "offset", &lamp_ptr, propname, -1); + WM_manipulator_target_property_def_rna(wwrapper->manipulator, "offset", &lamp_ptr, propname, -1); } void VIEW3D_WGT_lamp(wmManipulatorGroupType *wgt) @@ -237,7 +237,7 @@ static void WIDGETGROUP_camera_refresh(const bContext *C, wmManipulatorGroup *mg WM_manipulator_set_flag(camgroup->dop_dist, WM_MANIPULATOR_HIDDEN, false); /* need to set property here for undo. TODO would prefer to do this in _init */ - WM_manipulator_property_def_rna(camgroup->dop_dist, "offset", &camera_ptr, "dof_distance", -1); + WM_manipulator_target_property_def_rna(camgroup->dop_dist, "offset", &camera_ptr, "dof_distance", -1); } else { WM_manipulator_set_flag(camgroup->dop_dist, WM_MANIPULATOR_HIDDEN, true); @@ -281,8 +281,8 @@ static void WIDGETGROUP_camera_refresh(const bContext *C, wmManipulatorGroup *mg WM_manipulator_set_scale(widget, drawsize); /* need to set property here for undo. TODO would prefer to do this in _init */ - WM_manipulator_property_def_rna(camgroup->focal_len, "offset", &camera_ptr, "lens", -1); - WM_manipulator_property_def_rna(camgroup->ortho_scale, "offset", &camera_ptr, "ortho_scale", -1); + WM_manipulator_target_property_def_rna(camgroup->focal_len, "offset", &camera_ptr, "lens", -1); + WM_manipulator_target_property_def_rna(camgroup->ortho_scale, "offset", &camera_ptr, "ortho_scale", -1); } } @@ -347,7 +347,7 @@ static void WIDGETGROUP_forcefield_refresh(const bContext *C, wmManipulatorGroup WM_manipulator_set_matrix_rotation_from_z_axis(wwrapper->manipulator, ob->obmat[2]); WM_manipulator_set_matrix_offset_location(wwrapper->manipulator, ofs); WM_manipulator_set_flag(wwrapper->manipulator, WM_MANIPULATOR_HIDDEN, false); - WM_manipulator_property_def_rna(wwrapper->manipulator, "offset", &field_ptr, "strength", -1); + WM_manipulator_target_property_def_rna(wwrapper->manipulator, "offset", &field_ptr, "strength", -1); } else { WM_manipulator_set_flag(wwrapper->manipulator, WM_MANIPULATOR_HIDDEN, true); -- cgit v1.2.3