Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-06-17 12:50:56 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-06-17 12:50:56 +0300
commit2f1e34cfcc06a3fa49dc1b7c99e78cecdc509bf9 (patch)
treefb120177e2026413ac46e6ae1660258cfaf33b3f /source/blender/python/bmesh
parent36e82b775933c511bb3f4dac9f3d572bf6fe0672 (diff)
Cleanup: use clamp_* from BLI_math (replace macro)
Diffstat (limited to 'source/blender/python/bmesh')
-rw-r--r--source/blender/python/bmesh/bmesh_py_types.c2
-rw-r--r--source/blender/python/bmesh/bmesh_py_types_customdata.c4
-rw-r--r--source/blender/python/bmesh/bmesh_py_types_meshdata.c3
-rw-r--r--source/blender/python/bmesh/bmesh_py_utils.c5
4 files changed, 8 insertions, 6 deletions
diff --git a/source/blender/python/bmesh/bmesh_py_types.c b/source/blender/python/bmesh/bmesh_py_types.c
index 07c255c4abe..2c5fd4e7bf7 100644
--- a/source/blender/python/bmesh/bmesh_py_types.c
+++ b/source/blender/python/bmesh/bmesh_py_types.c
@@ -1399,7 +1399,7 @@ static PyObject *bpy_bmvert_copy_from_vert_interp(BPy_BMVert *self, PyObject *ar
return NULL;
}
- BM_data_interp_from_verts(bm, vert_array[0], vert_array[1], self->v, CLAMPIS(fac, 0.0f, 1.0f));
+ BM_data_interp_from_verts(bm, vert_array[0], vert_array[1], self->v, clamp_f(fac, 0.0f, 1.0f));
PyMem_FREE(vert_array);
Py_RETURN_NONE;
diff --git a/source/blender/python/bmesh/bmesh_py_types_customdata.c b/source/blender/python/bmesh/bmesh_py_types_customdata.c
index cb95ded4f0d..aee9d6405d0 100644
--- a/source/blender/python/bmesh/bmesh_py_types_customdata.c
+++ b/source/blender/python/bmesh/bmesh_py_types_customdata.c
@@ -1136,7 +1136,7 @@ int BPy_BMLayerItem_SetItem(BPy_BMElem *py_ele, BPy_BMLayerItem *py_layer, PyObj
ret = -1;
}
else {
- *(float *)value = CLAMPIS(tmp_val, 0.0f, 1.0f);
+ *(float *)value = clamp_f(tmp_val, 0.0f, 1.0f);
}
break;
}
@@ -1148,7 +1148,7 @@ int BPy_BMLayerItem_SetItem(BPy_BMElem *py_ele, BPy_BMLayerItem *py_layer, PyObj
ret = -1;
}
else {
- *(float *)value = CLAMPIS(tmp_val, 0.0f, 1.0f);
+ *(float *)value = clamp_f(tmp_val, 0.0f, 1.0f);
}
break;
}
diff --git a/source/blender/python/bmesh/bmesh_py_types_meshdata.c b/source/blender/python/bmesh/bmesh_py_types_meshdata.c
index 7984f625d96..4c44c104037 100644
--- a/source/blender/python/bmesh/bmesh_py_types_meshdata.c
+++ b/source/blender/python/bmesh/bmesh_py_types_meshdata.c
@@ -38,6 +38,7 @@
#include "DNA_meshdata_types.h"
#include "BLI_utildefines.h"
+#include "BLI_math_base.h"
#include "BLI_math_vector.h"
#include "BKE_deform.h"
@@ -555,7 +556,7 @@ static int bpy_bmdeformvert_ass_subscript(BPy_BMDeformVert *self, PyObject *key,
return -1;
}
- dw->weight = CLAMPIS(f, 0.0f, 1.0f);
+ dw->weight = clamp_f(f, 0.0f, 1.0f);
}
}
else {
diff --git a/source/blender/python/bmesh/bmesh_py_utils.c b/source/blender/python/bmesh/bmesh_py_utils.c
index 224c8295a9b..ca34de219b8 100644
--- a/source/blender/python/bmesh/bmesh_py_utils.c
+++ b/source/blender/python/bmesh/bmesh_py_utils.c
@@ -33,6 +33,7 @@
#include <Python.h>
#include "BLI_utildefines.h"
+#include "BLI_math_base.h"
#include "MEM_guardedalloc.h"
@@ -159,7 +160,7 @@ static PyObject *bpy_bm_utils_vert_collapse_faces(PyObject *UNUSED(self), PyObje
bm = py_edge->bm;
- e_new = BM_vert_collapse_faces(bm, py_edge->e, py_vert->v, CLAMPIS(fac, 0.0f, 1.0f), true, do_join_faces, true);
+ e_new = BM_vert_collapse_faces(bm, py_edge->e, py_vert->v, clamp_f(fac, 0.0f, 1.0f), true, do_join_faces, true);
if (e_new) {
return BPy_BMEdge_CreatePyObject(bm, e_new);
@@ -365,7 +366,7 @@ static PyObject *bpy_bm_utils_edge_split(PyObject *UNUSED(self), PyObject *args)
bm = py_edge->bm;
- v_new = BM_edge_split(bm, py_edge->e, py_vert->v, &e_new, CLAMPIS(fac, 0.0f, 1.0f));
+ v_new = BM_edge_split(bm, py_edge->e, py_vert->v, &e_new, clamp_f(fac, 0.0f, 1.0f));
if (v_new && e_new) {
PyObject *ret = PyTuple_New(2);