From 5ebebcfbfff4c218ab4101ee7f6a66617ee9b01f Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 14 Jul 2018 23:49:00 +0200 Subject: WM: rename manipulator to gizmo internally --- source/blender/python/intern/bpy.c | 2 +- source/blender/python/intern/bpy_gizmo_wrap.c | 38 +++--- source/blender/python/intern/bpy_gizmo_wrap.h | 8 +- source/blender/python/intern/bpy_rna.c | 8 +- source/blender/python/intern/bpy_rna_gizmo.c | 172 +++++++++++++------------- source/blender/python/intern/bpy_rna_gizmo.h | 2 +- source/blender/python/intern/gpu_py_select.c | 2 +- 7 files changed, 116 insertions(+), 116 deletions(-) (limited to 'source/blender/python') diff --git a/source/blender/python/intern/bpy.c b/source/blender/python/intern/bpy.c index 3083322d496..07ad8274f11 100644 --- a/source/blender/python/intern/bpy.c +++ b/source/blender/python/intern/bpy.c @@ -340,7 +340,7 @@ void BPy_init_modules(void) BPY_rna_id_collection_module(mod); - BPY_rna_manipulator_module(mod); + BPY_rna_gizmo_module(mod); bpy_import_test("bpy_types"); PyModule_AddObject(mod, "data", BPY_rna_module()); /* imports bpy_types by running this */ diff --git a/source/blender/python/intern/bpy_gizmo_wrap.c b/source/blender/python/intern/bpy_gizmo_wrap.c index eda1f58a4cc..4b71ea92010 100644 --- a/source/blender/python/intern/bpy_gizmo_wrap.c +++ b/source/blender/python/intern/bpy_gizmo_wrap.c @@ -49,12 +49,12 @@ /* -------------------------------------------------------------------- */ -/** \name Manipulator +/** \name Gizmo * \{ */ -static bool bpy_manipulatortype_target_property_def( - wmManipulatorType *wt, PyObject *item) +static bool bpy_gizmotype_target_property_def( + wmGizmoType *wt, PyObject *item) { /* Note: names based on 'rna_rna.c' */ PyObject *empty_tuple = PyTuple_New(0); @@ -102,7 +102,7 @@ static bool bpy_manipulatortype_target_property_def( goto fail; } - WM_manipulatortype_target_property_def(wt, params.id, params.type, params.array_length); + WM_gizmotype_target_property_def(wt, params.id, params.type, params.array_length); Py_DECREF(empty_tuple); return true; @@ -111,7 +111,7 @@ fail: return false; } -static void manipulator_properties_init(wmManipulatorType *wt) +static void gizmo_properties_init(wmGizmoType *wt) { PyTypeObject *py_class = wt->ext.data; RNA_struct_blender_type_set(wt->ext.srna, wt); @@ -149,7 +149,7 @@ static void manipulator_properties_init(wmManipulatorType *wt) PyObject **items = PySequence_Fast_ITEMS(bl_target_properties_fast); for (uint i = 0; i < items_len; i++) { - if (!bpy_manipulatortype_target_property_def(wt, items[i])) { + if (!bpy_gizmotype_target_property_def(wt, items[i])) { PyErr_Print(); PyErr_Clear(); break; @@ -161,25 +161,25 @@ static void manipulator_properties_init(wmManipulatorType *wt) } } -void BPY_RNA_manipulator_wrapper(wmManipulatorType *wt, void *userdata) +void BPY_RNA_gizmo_wrapper(wmGizmoType *wt, void *userdata) { /* take care not to overwrite anything set in - * WM_manipulatormaptype_group_link_ptr before opfunc() is called */ + * WM_gizmomaptype_group_link_ptr before opfunc() is called */ StructRNA *srna = wt->srna; - *wt = *((wmManipulatorType *)userdata); + *wt = *((wmGizmoType *)userdata); wt->srna = srna; /* restore */ /* don't do translations here yet */ #if 0 - /* Use i18n context from ext.srna if possible (py manipulatorgroups). */ + /* Use i18n context from ext.srna if possible (py gizmogroups). */ if (wt->ext.srna) { RNA_def_struct_translation_context(wt->srna, RNA_struct_translation_context(wt->ext.srna)); } #endif - wt->struct_size = sizeof(wmManipulator); + wt->struct_size = sizeof(wmGizmo); - manipulator_properties_init(wt); + gizmo_properties_init(wt); } /** \} */ @@ -187,10 +187,10 @@ void BPY_RNA_manipulator_wrapper(wmManipulatorType *wt, void *userdata) /* -------------------------------------------------------------------- */ -/** \name Manipulator Group +/** \name Gizmo Group * \{ */ -static void manipulatorgroup_properties_init(wmManipulatorGroupType *wgt) +static void gizmogroup_properties_init(wmGizmoGroupType *wgt) { #ifdef USE_SRNA PyTypeObject *py_class = wgt->ext.data; @@ -210,26 +210,26 @@ static void manipulatorgroup_properties_init(wmManipulatorGroupType *wgt) #endif } -void BPY_RNA_manipulatorgroup_wrapper(wmManipulatorGroupType *wgt, void *userdata) +void BPY_RNA_gizmogroup_wrapper(wmGizmoGroupType *wgt, void *userdata) { /* take care not to overwrite anything set in - * WM_manipulatormaptype_group_link_ptr before opfunc() is called */ + * WM_gizmomaptype_group_link_ptr before opfunc() is called */ #ifdef USE_SRNA StructRNA *srna = wgt->srna; #endif - *wgt = *((wmManipulatorGroupType *)userdata); + *wgt = *((wmGizmoGroupType *)userdata); #ifdef USE_SRNA wgt->srna = srna; /* restore */ #endif #ifdef USE_SRNA - /* Use i18n context from ext.srna if possible (py manipulatorgroups). */ + /* Use i18n context from ext.srna if possible (py gizmogroups). */ if (wgt->ext.srna) { RNA_def_struct_translation_context(wgt->srna, RNA_struct_translation_context(wgt->ext.srna)); } #endif - manipulatorgroup_properties_init(wgt); + gizmogroup_properties_init(wgt); } /** \} */ diff --git a/source/blender/python/intern/bpy_gizmo_wrap.h b/source/blender/python/intern/bpy_gizmo_wrap.h index 71fa123d6ce..4d6639d977f 100644 --- a/source/blender/python/intern/bpy_gizmo_wrap.h +++ b/source/blender/python/intern/bpy_gizmo_wrap.h @@ -25,11 +25,11 @@ #ifndef __BPY_GIZMO_WRAP_H__ #define __BPY_GIZMO_WRAP_H__ -struct wmManipulatorType; -struct wmManipulatorGroupType; +struct wmGizmoType; +struct wmGizmoGroupType; /* exposed to rna/wm api */ -void BPY_RNA_manipulator_wrapper(struct wmManipulatorType *wt, void *userdata); -void BPY_RNA_manipulatorgroup_wrapper(struct wmManipulatorGroupType *wgt, void *userdata); +void BPY_RNA_gizmo_wrapper(struct wmGizmoType *wt, void *userdata); +void BPY_RNA_gizmogroup_wrapper(struct wmGizmoGroupType *wgt, void *userdata); #endif /* __BPY_GIZMO_WRAP_H__ */ diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index b288e311633..e0fbd144590 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -1853,13 +1853,13 @@ static int pyrna_py_to_prop( { const StructRNA *base_type = RNA_struct_base_child_of(((const BPy_StructRNA *)value)->ptr.type, NULL); - if (ELEM(base_type, &RNA_Operator, &RNA_Manipulator)) { + if (ELEM(base_type, &RNA_Operator, &RNA_Gizmo)) { value = PyObject_GetAttr(value, bpy_intern_str_properties); value_new = value; } } - /* if property is an OperatorProperties/ManipulatorProperties pointer and value is a map, + /* if property is an OperatorProperties/GizmoProperties pointer and value is a map, * forward back to pyrna_pydict_to_props */ if (PyDict_Check(value)) { const StructRNA *base_type = RNA_struct_base_child_of(ptr_type, NULL); @@ -1867,7 +1867,7 @@ static int pyrna_py_to_prop( PointerRNA opptr = RNA_property_pointer_get(ptr, prop); return pyrna_pydict_to_props(&opptr, value, false, error_prefix); } - else if (base_type == &RNA_ManipulatorProperties) { + else if (base_type == &RNA_GizmoProperties) { PointerRNA opptr = RNA_property_pointer_get(ptr, prop); return pyrna_pydict_to_props(&opptr, value, false, error_prefix); } @@ -7738,7 +7738,7 @@ static int bpy_class_call(bContext *C, PointerRNA *ptr, FunctionRNA *func, Param #ifdef USE_PEDANTIC_WRITE const bool is_readonly_init = !(RNA_struct_is_a(ptr->type, &RNA_Operator) || - RNA_struct_is_a(ptr->type, &RNA_Manipulator)); + RNA_struct_is_a(ptr->type, &RNA_Gizmo)); // const char *func_id = RNA_function_identifier(func); /* UNUSED */ /* testing, for correctness, not operator and not draw function */ const bool is_readonly = !(RNA_function_flag(func) & FUNC_ALLOW_WRITE); diff --git a/source/blender/python/intern/bpy_rna_gizmo.c b/source/blender/python/intern/bpy_rna_gizmo.c index 34a4594bdae..e834595114a 100644 --- a/source/blender/python/intern/bpy_rna_gizmo.c +++ b/source/blender/python/intern/bpy_rna_gizmo.c @@ -51,29 +51,29 @@ /* -------------------------------------------------------------------- */ -/** \name Manipulator Target Property Define API +/** \name Gizmo Target Property Define API * \{ */ enum { - BPY_MANIPULATOR_FN_SLOT_GET = 0, - BPY_MANIPULATOR_FN_SLOT_SET, - BPY_MANIPULATOR_FN_SLOT_RANGE_GET, + BPY_GIZMO_FN_SLOT_GET = 0, + BPY_GIZMO_FN_SLOT_SET, + BPY_GIZMO_FN_SLOT_RANGE_GET, }; -#define BPY_MANIPULATOR_FN_SLOT_LEN (BPY_MANIPULATOR_FN_SLOT_RANGE_GET + 1) +#define BPY_GIZMO_FN_SLOT_LEN (BPY_GIZMO_FN_SLOT_RANGE_GET + 1) -struct BPyManipulatorHandlerUserData { +struct BPyGizmoHandlerUserData { - PyObject *fn_slots[BPY_MANIPULATOR_FN_SLOT_LEN]; + PyObject *fn_slots[BPY_GIZMO_FN_SLOT_LEN]; }; -static void py_rna_manipulator_handler_get_cb( - const wmManipulator *UNUSED(mpr), wmManipulatorProperty *mpr_prop, +static void py_rna_gizmo_handler_get_cb( + const wmGizmo *UNUSED(mpr), wmGizmoProperty *mpr_prop, void *value_p) { PyGILState_STATE gilstate = PyGILState_Ensure(); - struct BPyManipulatorHandlerUserData *data = mpr_prop->custom_func.user_data; - PyObject *ret = PyObject_CallObject(data->fn_slots[BPY_MANIPULATOR_FN_SLOT_GET], NULL); + struct BPyGizmoHandlerUserData *data = mpr_prop->custom_func.user_data; + PyObject *ret = PyObject_CallObject(data->fn_slots[BPY_GIZMO_FN_SLOT_GET], NULL); if (ret == NULL) { goto fail; } @@ -87,7 +87,7 @@ static void py_rna_manipulator_handler_get_cb( } else { if (PyC_AsArray(value, ret, mpr_prop->type->array_length, &PyFloat_Type, false, - "Manipulator get callback: ") == -1) + "Gizmo get callback: ") == -1) { goto fail; } @@ -110,13 +110,13 @@ fail: PyGILState_Release(gilstate); } -static void py_rna_manipulator_handler_set_cb( - const wmManipulator *UNUSED(mpr), wmManipulatorProperty *mpr_prop, +static void py_rna_gizmo_handler_set_cb( + const wmGizmo *UNUSED(mpr), wmGizmoProperty *mpr_prop, const void *value_p) { PyGILState_STATE gilstate = PyGILState_Ensure(); - struct BPyManipulatorHandlerUserData *data = mpr_prop->custom_func.user_data; + struct BPyGizmoHandlerUserData *data = mpr_prop->custom_func.user_data; PyObject *args = PyTuple_New(1); @@ -139,7 +139,7 @@ static void py_rna_manipulator_handler_set_cb( goto fail; } - PyObject *ret = PyObject_CallObject(data->fn_slots[BPY_MANIPULATOR_FN_SLOT_SET], args); + PyObject *ret = PyObject_CallObject(data->fn_slots[BPY_GIZMO_FN_SLOT_SET], args); if (ret == NULL) { goto fail; } @@ -157,15 +157,15 @@ fail: PyGILState_Release(gilstate); } -static void py_rna_manipulator_handler_range_get_cb( - const wmManipulator *UNUSED(mpr), wmManipulatorProperty *mpr_prop, +static void py_rna_gizmo_handler_range_get_cb( + const wmGizmo *UNUSED(mpr), wmGizmoProperty *mpr_prop, void *value_p) { - struct BPyManipulatorHandlerUserData *data = mpr_prop->custom_func.user_data; + struct BPyGizmoHandlerUserData *data = mpr_prop->custom_func.user_data; PyGILState_STATE gilstate = PyGILState_Ensure(); - PyObject *ret = PyObject_CallObject(data->fn_slots[BPY_MANIPULATOR_FN_SLOT_RANGE_GET], NULL); + PyObject *ret = PyObject_CallObject(data->fn_slots[BPY_GIZMO_FN_SLOT_RANGE_GET], NULL); if (ret == NULL) { goto fail; } @@ -214,13 +214,13 @@ fail: PyGILState_Release(gilstate); } -static void py_rna_manipulator_handler_free_cb( - const wmManipulator *UNUSED(mpr), wmManipulatorProperty *mpr_prop) +static void py_rna_gizmo_handler_free_cb( + const wmGizmo *UNUSED(mpr), wmGizmoProperty *mpr_prop) { - struct BPyManipulatorHandlerUserData *data = mpr_prop->custom_func.user_data; + struct BPyGizmoHandlerUserData *data = mpr_prop->custom_func.user_data; PyGILState_STATE gilstate = PyGILState_Ensure(); - for (int i = 0; i < BPY_MANIPULATOR_FN_SLOT_LEN; i++) { + for (int i = 0; i < BPY_GIZMO_FN_SLOT_LEN; i++) { Py_XDECREF(data->fn_slots[i]); } PyGILState_Release(gilstate); @@ -229,26 +229,26 @@ static void py_rna_manipulator_handler_free_cb( } -PyDoc_STRVAR(bpy_manipulator_target_set_handler_doc, +PyDoc_STRVAR(bpy_gizmo_target_set_handler_doc, ".. method:: target_set_handler(target, get, set, range=None):\n" "\n" -" Assigns callbacks to a manipulators property.\n" +" Assigns callbacks to a gizmos property.\n" "\n" " :arg get: Function that returns the value for this property (single value or sequence).\n" " :type get: callable\n" " :arg set: Function that takes a single value argument and applies it.\n" " :type set: callable\n" -" :arg range: Function that returns a (min, max) tuple for manipulators that use a range.\n" +" :arg range: Function that returns a (min, max) tuple for gizmos that use a range.\n" " :type range: callable\n" ); -static PyObject *bpy_manipulator_target_set_handler(PyObject *UNUSED(self), PyObject *args, PyObject *kw) +static PyObject *bpy_gizmo_target_set_handler(PyObject *UNUSED(self), PyObject *args, PyObject *kw) { PyGILState_STATE gilstate = PyGILState_Ensure(); struct { PyObject *self; char *target; - PyObject *py_fn_slots[BPY_MANIPULATOR_FN_SLOT_LEN]; + PyObject *py_fn_slots[BPY_GIZMO_FN_SLOT_LEN]; } params = { .self = NULL, .target = NULL, @@ -256,28 +256,28 @@ static PyObject *bpy_manipulator_target_set_handler(PyObject *UNUSED(self), PyOb }; /* Note: this is a counter-part to functions: - * 'Manipulator.target_set_prop & target_set_operator' - * (see: rna_wm_manipulator_api.c). conventions should match. */ + * 'Gizmo.target_set_prop & target_set_operator' + * (see: rna_wm_gizmo_api.c). conventions should match. */ static const char * const _keywords[] = {"self", "target", "get", "set", "range", NULL}; static _PyArg_Parser _parser = {"Os|$OOO:target_set_handler", _keywords, 0}; if (!_PyArg_ParseTupleAndKeywordsFast( args, kw, &_parser, ¶ms.self, ¶ms.target, - ¶ms.py_fn_slots[BPY_MANIPULATOR_FN_SLOT_GET], - ¶ms.py_fn_slots[BPY_MANIPULATOR_FN_SLOT_SET], - ¶ms.py_fn_slots[BPY_MANIPULATOR_FN_SLOT_RANGE_GET])) + ¶ms.py_fn_slots[BPY_GIZMO_FN_SLOT_GET], + ¶ms.py_fn_slots[BPY_GIZMO_FN_SLOT_SET], + ¶ms.py_fn_slots[BPY_GIZMO_FN_SLOT_RANGE_GET])) { goto fail; } - wmManipulator *mpr = ((BPy_StructRNA *)params.self)->ptr.data; + wmGizmo *mpr = ((BPy_StructRNA *)params.self)->ptr.data; - const wmManipulatorPropertyType *mpr_prop_type = - WM_manipulatortype_target_property_find(mpr->type, params.target); + const wmGizmoPropertyType *mpr_prop_type = + WM_gizmotype_target_property_find(mpr->type, params.target); if (mpr_prop_type == NULL) { PyErr_Format(PyExc_ValueError, - "Manipulator target property '%s.%s' not found", + "Gizmo target property '%s.%s' not found", mpr->type->idname, params.target); goto fail; } @@ -285,7 +285,7 @@ static PyObject *bpy_manipulator_target_set_handler(PyObject *UNUSED(self), PyOb { const int slots_required = 2; const int slots_start = 2; - for (int i = 0; i < BPY_MANIPULATOR_FN_SLOT_LEN; i++) { + for (int i = 0; i < BPY_GIZMO_FN_SLOT_LEN; i++) { if (params.py_fn_slots[i] == NULL) { if (i < slots_required) { PyErr_Format(PyExc_ValueError, "Argument '%s' not given", _keywords[slots_start + i]); @@ -299,20 +299,20 @@ static PyObject *bpy_manipulator_target_set_handler(PyObject *UNUSED(self), PyOb } } - struct BPyManipulatorHandlerUserData *data = MEM_callocN(sizeof(*data), __func__); + struct BPyGizmoHandlerUserData *data = MEM_callocN(sizeof(*data), __func__); - for (int i = 0; i < BPY_MANIPULATOR_FN_SLOT_LEN; i++) { + for (int i = 0; i < BPY_GIZMO_FN_SLOT_LEN; i++) { data->fn_slots[i] = params.py_fn_slots[i]; Py_XINCREF(params.py_fn_slots[i]); } - WM_manipulator_target_property_def_func_ptr( + WM_gizmo_target_property_def_func_ptr( mpr, mpr_prop_type, - &(const struct wmManipulatorPropertyFnParams) { - .value_get_fn = py_rna_manipulator_handler_get_cb, - .value_set_fn = py_rna_manipulator_handler_set_cb, - .range_get_fn = py_rna_manipulator_handler_range_get_cb, - .free_fn = py_rna_manipulator_handler_free_cb, + &(const struct wmGizmoPropertyFnParams) { + .value_get_fn = py_rna_gizmo_handler_get_cb, + .value_set_fn = py_rna_gizmo_handler_set_cb, + .range_get_fn = py_rna_gizmo_handler_range_get_cb, + .free_fn = py_rna_gizmo_handler_free_cb, .user_data = data, }); @@ -328,10 +328,10 @@ fail: /** \} */ /* -------------------------------------------------------------------- */ -/** \name Manipulator Target Property Access API +/** \name Gizmo Target Property Access API * \{ */ -PyDoc_STRVAR(bpy_manipulator_target_get_value_doc, +PyDoc_STRVAR(bpy_gizmo_target_get_value_doc, ".. method:: target_get_value(target):\n" "\n" " Get the value of this target property.\n" @@ -341,7 +341,7 @@ PyDoc_STRVAR(bpy_manipulator_target_get_value_doc, " :return: The value of the target property.\n" " :rtype: Single value or array based on the target type\n" ); -static PyObject *bpy_manipulator_target_get_value(PyObject *UNUSED(self), PyObject *args, PyObject *kw) +static PyObject *bpy_gizmo_target_get_value(PyObject *UNUSED(self), PyObject *args, PyObject *kw) { struct { PyObject *self; @@ -361,28 +361,28 @@ static PyObject *bpy_manipulator_target_get_value(PyObject *UNUSED(self), PyObje goto fail; } - wmManipulator *mpr = ((BPy_StructRNA *)params.self)->ptr.data; + wmGizmo *mpr = ((BPy_StructRNA *)params.self)->ptr.data; - wmManipulatorProperty *mpr_prop = - WM_manipulator_target_property_find(mpr, params.target); + wmGizmoProperty *mpr_prop = + WM_gizmo_target_property_find(mpr, params.target); if (mpr_prop == NULL) { PyErr_Format(PyExc_ValueError, - "Manipulator target property '%s.%s' not found", + "Gizmo target property '%s.%s' not found", mpr->type->idname, params.target); goto fail; } - const int array_len = WM_manipulator_target_property_array_length(mpr, mpr_prop); + const int array_len = WM_gizmo_target_property_array_length(mpr, mpr_prop); switch (mpr_prop->type->data_type) { case PROP_FLOAT: { if (array_len != 0) { float *value = BLI_array_alloca(value, array_len); - WM_manipulator_target_property_value_get_array(mpr, mpr_prop, value); + WM_gizmo_target_property_value_get_array(mpr, mpr_prop, value); return PyC_Tuple_PackArray_F32(value, array_len); } else { - float value = WM_manipulator_target_property_value_get(mpr, mpr_prop); + float value = WM_gizmo_target_property_value_get(mpr, mpr_prop); return PyFloat_FromDouble(value); } break; @@ -398,7 +398,7 @@ fail: return NULL; } -PyDoc_STRVAR(bpy_manipulator_target_set_value_doc, +PyDoc_STRVAR(bpy_gizmo_target_set_value_doc, ".. method:: target_set_value(target):\n" "\n" " Set the value of this target property.\n" @@ -406,7 +406,7 @@ PyDoc_STRVAR(bpy_manipulator_target_set_value_doc, " :arg target: Target property name.\n" " :type target: string\n" ); -static PyObject *bpy_manipulator_target_set_value(PyObject *UNUSED(self), PyObject *args, PyObject *kw) +static PyObject *bpy_gizmo_target_set_value(PyObject *UNUSED(self), PyObject *args, PyObject *kw) { struct { PyObject *self; @@ -429,36 +429,36 @@ static PyObject *bpy_manipulator_target_set_value(PyObject *UNUSED(self), PyObje goto fail; } - wmManipulator *mpr = ((BPy_StructRNA *)params.self)->ptr.data; + wmGizmo *mpr = ((BPy_StructRNA *)params.self)->ptr.data; - wmManipulatorProperty *mpr_prop = - WM_manipulator_target_property_find(mpr, params.target); + wmGizmoProperty *mpr_prop = + WM_gizmo_target_property_find(mpr, params.target); if (mpr_prop == NULL) { PyErr_Format(PyExc_ValueError, - "Manipulator target property '%s.%s' not found", + "Gizmo target property '%s.%s' not found", mpr->type->idname, params.target); goto fail; } - const int array_len = WM_manipulator_target_property_array_length(mpr, mpr_prop); + const int array_len = WM_gizmo_target_property_array_length(mpr, mpr_prop); switch (mpr_prop->type->data_type) { case PROP_FLOAT: { if (array_len != 0) { float *value = BLI_array_alloca(value, array_len); if (PyC_AsArray(value, params.value, mpr_prop->type->array_length, &PyFloat_Type, false, - "Manipulator target property array") == -1) + "Gizmo target property array") == -1) { goto fail; } - WM_manipulator_target_property_value_set_array(BPy_GetContext(), mpr, mpr_prop, value); + WM_gizmo_target_property_value_set_array(BPy_GetContext(), mpr, mpr_prop, value); } else { float value; if ((value = PyFloat_AsDouble(params.value)) == -1.0f && PyErr_Occurred()) { goto fail; } - WM_manipulator_target_property_value_set(BPy_GetContext(), mpr, mpr_prop, value); + WM_gizmo_target_property_value_set(BPy_GetContext(), mpr, mpr_prop, value); } Py_RETURN_NONE; } @@ -474,7 +474,7 @@ fail: } -PyDoc_STRVAR(bpy_manipulator_target_get_range_doc, +PyDoc_STRVAR(bpy_gizmo_target_get_range_doc, ".. method:: target_get_range(target):\n" "\n" " Get the range for this target property.\n" @@ -484,7 +484,7 @@ PyDoc_STRVAR(bpy_manipulator_target_get_range_doc, " :return: The range of this property (min, max).\n" " :rtype: tuple pair.\n" ); -static PyObject *bpy_manipulator_target_get_range(PyObject *UNUSED(self), PyObject *args, PyObject *kw) +static PyObject *bpy_gizmo_target_get_range(PyObject *UNUSED(self), PyObject *args, PyObject *kw) { struct { PyObject *self; @@ -504,13 +504,13 @@ static PyObject *bpy_manipulator_target_get_range(PyObject *UNUSED(self), PyObje goto fail; } - wmManipulator *mpr = ((BPy_StructRNA *)params.self)->ptr.data; + wmGizmo *mpr = ((BPy_StructRNA *)params.self)->ptr.data; - wmManipulatorProperty *mpr_prop = - WM_manipulator_target_property_find(mpr, params.target); + wmGizmoProperty *mpr_prop = + WM_gizmo_target_property_find(mpr, params.target); if (mpr_prop == NULL) { PyErr_Format(PyExc_ValueError, - "Manipulator target property '%s.%s' not found", + "Gizmo target property '%s.%s' not found", mpr->type->idname, params.target); goto fail; } @@ -519,7 +519,7 @@ static PyObject *bpy_manipulator_target_get_range(PyObject *UNUSED(self), PyObje case PROP_FLOAT: { float range[2]; - WM_manipulator_target_property_range_get(mpr, mpr_prop, range); + WM_gizmo_target_property_range_get(mpr, mpr_prop, range); return PyC_Tuple_PackArray_F32(range, 2); } default: @@ -535,19 +535,19 @@ fail: /** \} */ -int BPY_rna_manipulator_module(PyObject *mod_par) +int BPY_rna_gizmo_module(PyObject *mod_par) { static PyMethodDef method_def_array[] = { - /* Manipulator Target Property Define API */ - {"target_set_handler", (PyCFunction)bpy_manipulator_target_set_handler, - METH_VARARGS | METH_KEYWORDS, bpy_manipulator_target_set_handler_doc}, - /* Manipulator Target Property Access API */ - {"target_get_value", (PyCFunction)bpy_manipulator_target_get_value, - METH_VARARGS | METH_KEYWORDS, bpy_manipulator_target_get_value_doc}, - {"target_set_value", (PyCFunction)bpy_manipulator_target_set_value, - METH_VARARGS | METH_KEYWORDS, bpy_manipulator_target_set_value_doc}, - {"target_get_range", (PyCFunction)bpy_manipulator_target_get_range, - METH_VARARGS | METH_KEYWORDS, bpy_manipulator_target_get_range_doc}, + /* Gizmo Target Property Define API */ + {"target_set_handler", (PyCFunction)bpy_gizmo_target_set_handler, + METH_VARARGS | METH_KEYWORDS, bpy_gizmo_target_set_handler_doc}, + /* Gizmo Target Property Access API */ + {"target_get_value", (PyCFunction)bpy_gizmo_target_get_value, + METH_VARARGS | METH_KEYWORDS, bpy_gizmo_target_get_value_doc}, + {"target_set_value", (PyCFunction)bpy_gizmo_target_set_value, + METH_VARARGS | METH_KEYWORDS, bpy_gizmo_target_set_value_doc}, + {"target_get_range", (PyCFunction)bpy_gizmo_target_get_range, + METH_VARARGS | METH_KEYWORDS, bpy_gizmo_target_get_range_doc}, /* no sentinel needed. */ }; @@ -556,7 +556,7 @@ int BPY_rna_manipulator_module(PyObject *mod_par) PyObject *func = PyCFunction_New(m, NULL); PyObject *func_inst = PyInstanceMethod_New(func); char name_prefix[128]; - PyOS_snprintf(name_prefix, sizeof(name_prefix), "_rna_manipulator_%s", m->ml_name); + PyOS_snprintf(name_prefix, sizeof(name_prefix), "_rna_gizmo_%s", m->ml_name); /* TODO, return a type that binds nearly to a method. */ PyModule_AddObject(mod_par, name_prefix, func_inst); } diff --git a/source/blender/python/intern/bpy_rna_gizmo.h b/source/blender/python/intern/bpy_rna_gizmo.h index e848fd9800f..68d8c1e052a 100644 --- a/source/blender/python/intern/bpy_rna_gizmo.h +++ b/source/blender/python/intern/bpy_rna_gizmo.h @@ -27,6 +27,6 @@ #ifndef __BPY_RNA_GIZMO_H__ #define __BPY_RNA_GIZMO_H__ -int BPY_rna_manipulator_module(PyObject *); +int BPY_rna_gizmo_module(PyObject *); #endif /* __BPY_RNA_GIZMO_H__ */ diff --git a/source/blender/python/intern/gpu_py_select.c b/source/blender/python/intern/gpu_py_select.c index f570c4cdae2..fcdcce24935 100644 --- a/source/blender/python/intern/gpu_py_select.c +++ b/source/blender/python/intern/gpu_py_select.c @@ -23,7 +23,7 @@ * * This file defines the gpu.select API. * - * \note Currently only used for manipulator selection, + * \note Currently only used for gizmo selection, * will need to add begin/end and a way to access the hits. */ -- cgit v1.2.3