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:
Diffstat (limited to 'source/blender/python/bmesh')
-rw-r--r--source/blender/python/bmesh/bmesh_py_api.c2
-rw-r--r--source/blender/python/bmesh/bmesh_py_types.c65
-rw-r--r--source/blender/python/bmesh/bmesh_py_types.h27
-rw-r--r--source/blender/python/bmesh/bmesh_py_types_customdata.h9
-rw-r--r--source/blender/python/bmesh/bmesh_py_types_meshdata.c9
-rw-r--r--source/blender/python/bmesh/bmesh_py_types_meshdata.h3
-rw-r--r--source/blender/python/bmesh/bmesh_py_types_select.h6
-rw-r--r--source/blender/python/bmesh/bmesh_py_utils.c6
8 files changed, 63 insertions, 64 deletions
diff --git a/source/blender/python/bmesh/bmesh_py_api.c b/source/blender/python/bmesh/bmesh_py_api.c
index 6dcf8bc5f1c..906f8ab702f 100644
--- a/source/blender/python/bmesh/bmesh_py_api.c
+++ b/source/blender/python/bmesh/bmesh_py_api.c
@@ -125,7 +125,7 @@ static PyObject *bpy_bm_update_edit_mesh(PyObject *UNUSED(self), PyObject *args,
if (!PyArg_ParseTupleAndKeywords(args,
kw,
- "O|O&O&:update_edit_mesh",
+ "O|$O&O&:update_edit_mesh",
(char **)kwlist,
&py_me,
PyC_ParseBool,
diff --git a/source/blender/python/bmesh/bmesh_py_types.c b/source/blender/python/bmesh/bmesh_py_types.c
index 563a76ac824..638975f8fba 100644
--- a/source/blender/python/bmesh/bmesh_py_types.c
+++ b/source/blender/python/bmesh/bmesh_py_types.c
@@ -1065,29 +1065,21 @@ static PyObject *bpy_bmesh_to_mesh(BPy_BMesh *self, PyObject *args)
Py_RETURN_NONE;
}
-PyDoc_STRVAR(
- bpy_bmesh_from_object_doc,
- ".. method:: from_object(object, depsgraph, deform=True, cage=False, face_normals=True)\n"
- "\n"
- " Initialize this bmesh from existing object datablock (currently only meshes are "
- "supported).\n"
- "\n"
- " :arg object: The object data to load.\n"
- " :type object: :class:`Object`\n"
- " :arg deform: Apply deformation modifiers.\n"
- " :type deform: boolean\n"
- " :arg cage: Get the mesh as a deformed cage.\n"
- " :type cage: boolean\n"
- " :arg face_normals: Calculate face normals.\n"
- " :type face_normals: boolean\n"
- "\n"
- " .. deprecated:: 2.93\n"
- "\n"
- " The deform parameter is deprecated, assumed to be True, and will be removed in version "
- "3.0.\n");
+PyDoc_STRVAR(bpy_bmesh_from_object_doc,
+ ".. method:: from_object(object, depsgraph, cage=False, face_normals=True)\n"
+ "\n"
+ " Initialize this bmesh from existing object data-block (only meshes are currently "
+ "supported).\n"
+ "\n"
+ " :arg object: The object data to load.\n"
+ " :type object: :class:`Object`\n"
+ " :arg cage: Get the mesh as a deformed cage.\n"
+ " :type cage: boolean\n"
+ " :arg face_normals: Calculate face normals.\n"
+ " :type face_normals: boolean\n");
static PyObject *bpy_bmesh_from_object(BPy_BMesh *self, PyObject *args, PyObject *kw)
{
- static const char *kwlist[] = {"object", "depsgraph", "deform", "cage", "face_normals", NULL};
+ static const char *kwlist[] = {"object", "depsgraph", "cage", "face_normals", NULL};
PyObject *py_object;
PyObject *py_depsgraph;
Object *ob, *ob_eval;
@@ -1095,7 +1087,6 @@ static PyObject *bpy_bmesh_from_object(BPy_BMesh *self, PyObject *args, PyObject
struct Scene *scene_eval;
Mesh *me_eval;
BMesh *bm;
- bool use_deform = true;
bool use_cage = false;
bool use_fnorm = true;
const CustomData_MeshMasks data_masks = CD_MASK_BMESH;
@@ -1104,13 +1095,11 @@ static PyObject *bpy_bmesh_from_object(BPy_BMesh *self, PyObject *args, PyObject
if (!PyArg_ParseTupleAndKeywords(args,
kw,
- "OO|O&O&O&:from_object",
+ "OO|$O&O&:from_object",
(char **)kwlist,
&py_object,
&py_depsgraph,
PyC_ParseBool,
- &use_deform,
- PyC_ParseBool,
&use_cage,
PyC_ParseBool,
&use_fnorm) ||
@@ -1125,13 +1114,6 @@ static PyObject *bpy_bmesh_from_object(BPy_BMesh *self, PyObject *args, PyObject
return NULL;
}
- if (use_deform == false) {
- PyErr_WarnEx(PyExc_FutureWarning,
- "from_object(...): the deform parameter is deprecated, assumed to be True, and "
- "will be removed in version 3.0",
- 1);
- }
-
const bool use_render = DEG_get_mode(depsgraph) == DAG_EVAL_RENDER;
scene_eval = DEG_get_evaluated_scene(depsgraph);
ob_eval = DEG_get_evaluated_object(depsgraph, ob);
@@ -1146,7 +1128,7 @@ static PyObject *bpy_bmesh_from_object(BPy_BMesh *self, PyObject *args, PyObject
return NULL;
}
- me_eval = BKE_mesh_new_from_object(depsgraph, ob_eval, true);
+ me_eval = BKE_mesh_new_from_object(depsgraph, ob_eval, true, false);
need_free = true;
}
else {
@@ -1214,7 +1196,7 @@ static PyObject *bpy_bmesh_from_mesh(BPy_BMesh *self, PyObject *args, PyObject *
if (!PyArg_ParseTupleAndKeywords(args,
kw,
- "O|O&O&i:from_mesh",
+ "O|$O&O&i:from_mesh",
(char **)kwlist,
&py_mesh,
PyC_ParseBool,
@@ -1314,7 +1296,7 @@ static PyObject *bpy_bmesh_transform(BPy_BMElem *self, PyObject *args, PyObject
if (!PyArg_ParseTupleAndKeywords(args,
kw,
- "O!|O!:transform",
+ "O!|$O!:transform",
(char **)kwlist,
&matrix_Type,
&mat,
@@ -1376,7 +1358,7 @@ static PyObject *bpy_bmesh_calc_volume(BPy_BMElem *self, PyObject *args, PyObjec
BPY_BM_CHECK_OBJ(self);
if (!PyArg_ParseTupleAndKeywords(
- args, kw, "|O!:calc_volume", (char **)kwlist, &PyBool_Type, &is_signed)) {
+ args, kw, "|$O!:calc_volume", (char **)kwlist, &PyBool_Type, &is_signed)) {
return NULL;
}
@@ -1395,7 +1377,6 @@ static PyObject *bpy_bmesh_calc_loop_triangles(BPy_BMElem *self)
BMesh *bm;
int looptris_tot;
- int tottri;
BMLoop *(*looptris)[3];
PyObject *ret;
@@ -1408,10 +1389,10 @@ static PyObject *bpy_bmesh_calc_loop_triangles(BPy_BMElem *self)
looptris_tot = poly_to_tri_count(bm->totface, bm->totloop);
looptris = PyMem_MALLOC(sizeof(*looptris) * looptris_tot);
- BM_mesh_calc_tessellation(bm, looptris, &tottri);
+ BM_mesh_calc_tessellation(bm, looptris);
- ret = PyList_New(tottri);
- for (i = 0; i < tottri; i++) {
+ ret = PyList_New(looptris_tot);
+ for (i = 0; i < looptris_tot; i++) {
PyList_SET_ITEM(ret, i, BPy_BMLoop_Array_As_Tuple(bm, looptris[i], 3));
}
@@ -1869,7 +1850,7 @@ static PyObject *bpy_bmface_copy(BPy_BMFace *self, PyObject *args, PyObject *kw)
if (!PyArg_ParseTupleAndKeywords(args,
kw,
- "|O&O&:BMFace.copy",
+ "|$O&O&:BMFace.copy",
(char **)kwlist,
PyC_ParseBool,
&do_verts,
@@ -2665,7 +2646,7 @@ static PyObject *bpy_bmelemseq_sort(BPy_BMElemSeq *self, PyObject *args, PyObjec
if (args != NULL) {
if (!PyArg_ParseTupleAndKeywords(args,
kw,
- "|OO&:BMElemSeq.sort",
+ "|$OO&:BMElemSeq.sort",
(char **)kwlist,
&keyfunc,
PyC_ParseBool,
diff --git a/source/blender/python/bmesh/bmesh_py_types.h b/source/blender/python/bmesh/bmesh_py_types.h
index ce894760eff..ed307ce59a0 100644
--- a/source/blender/python/bmesh/bmesh_py_types.h
+++ b/source/blender/python/bmesh/bmesh_py_types.h
@@ -53,38 +53,45 @@ extern PyTypeObject BPy_BMIter_Type;
/* cast from _any_ bmesh type - they all have BMesh first */
typedef struct BPy_BMGeneric {
- PyObject_VAR_HEAD struct BMesh *bm; /* keep first */
+ PyObject_VAR_HEAD
+ struct BMesh *bm; /* keep first */
} BPy_BMGeneric;
/* BPy_BMVert/BPy_BMEdge/BPy_BMFace/BPy_BMLoop can cast to this */
typedef struct BPy_BMElem {
- PyObject_VAR_HEAD struct BMesh *bm; /* keep first */
+ PyObject_VAR_HEAD
+ struct BMesh *bm; /* keep first */
struct BMElem *ele;
} BPy_BMElem;
typedef struct BPy_BMesh {
- PyObject_VAR_HEAD struct BMesh *bm; /* keep first */
+ PyObject_VAR_HEAD
+ struct BMesh *bm; /* keep first */
int flag;
} BPy_BMesh;
/* element types */
typedef struct BPy_BMVert {
- PyObject_VAR_HEAD struct BMesh *bm; /* keep first */
+ PyObject_VAR_HEAD
+ struct BMesh *bm; /* keep first */
struct BMVert *v;
} BPy_BMVert;
typedef struct BPy_BMEdge {
- PyObject_VAR_HEAD struct BMesh *bm; /* keep first */
+ PyObject_VAR_HEAD
+ struct BMesh *bm; /* keep first */
struct BMEdge *e;
} BPy_BMEdge;
typedef struct BPy_BMFace {
- PyObject_VAR_HEAD struct BMesh *bm; /* keep first */
+ PyObject_VAR_HEAD
+ struct BMesh *bm; /* keep first */
struct BMFace *f;
} BPy_BMFace;
typedef struct BPy_BMLoop {
- PyObject_VAR_HEAD struct BMesh *bm; /* keep first */
+ PyObject_VAR_HEAD
+ struct BMesh *bm; /* keep first */
struct BMLoop *l;
} BPy_BMLoop;
@@ -98,7 +105,8 @@ typedef struct BPy_BMLoop {
* - BPy_BMLoopSeq_Type
*/
typedef struct BPy_BMElemSeq {
- PyObject_VAR_HEAD struct BMesh *bm; /* keep first */
+ PyObject_VAR_HEAD
+ struct BMesh *bm; /* keep first */
/* if this is a sequence on an existing element,
* loops of faces for eg.
@@ -114,7 +122,8 @@ typedef struct BPy_BMElemSeq {
} BPy_BMElemSeq;
typedef struct BPy_BMIter {
- PyObject_VAR_HEAD struct BMesh *bm; /* keep first */
+ PyObject_VAR_HEAD
+ struct BMesh *bm; /* keep first */
BMIter iter;
} BPy_BMIter;
diff --git a/source/blender/python/bmesh/bmesh_py_types_customdata.h b/source/blender/python/bmesh/bmesh_py_types_customdata.h
index 3173813a912..8552942f73a 100644
--- a/source/blender/python/bmesh/bmesh_py_types_customdata.h
+++ b/source/blender/python/bmesh/bmesh_py_types_customdata.h
@@ -38,20 +38,23 @@ extern PyTypeObject BPy_BMLayerItem_Type;
/* all layers for vert/edge/face/loop */
typedef struct BPy_BMLayerAccess {
- PyObject_VAR_HEAD struct BMesh *bm; /* keep first */
+ PyObject_VAR_HEAD
+ struct BMesh *bm; /* keep first */
char htype;
} BPy_BMLayerAccess;
/* access different layer types deform/uv/vertexcolor */
typedef struct BPy_BMLayerCollection {
- PyObject_VAR_HEAD struct BMesh *bm; /* keep first */
+ PyObject_VAR_HEAD
+ struct BMesh *bm; /* keep first */
char htype;
int type; /* customdata type - CD_XXX */
} BPy_BMLayerCollection;
/* access a specific layer directly */
typedef struct BPy_BMLayerItem {
- PyObject_VAR_HEAD struct BMesh *bm; /* keep first */
+ PyObject_VAR_HEAD
+ struct BMesh *bm; /* keep first */
char htype;
int type; /* customdata type - CD_XXX */
int index; /* index of this layer type */
diff --git a/source/blender/python/bmesh/bmesh_py_types_meshdata.c b/source/blender/python/bmesh/bmesh_py_types_meshdata.c
index 127ce7db503..84267a83a44 100644
--- a/source/blender/python/bmesh/bmesh_py_types_meshdata.c
+++ b/source/blender/python/bmesh/bmesh_py_types_meshdata.c
@@ -48,7 +48,8 @@
#define BPy_BMLoopUV_Check(v) (Py_TYPE(v) == &BPy_BMLoopUV_Type)
typedef struct BPy_BMLoopUV {
- PyObject_VAR_HEAD MLoopUV *data;
+ PyObject_VAR_HEAD
+ MLoopUV *data;
} BPy_BMLoopUV;
PyDoc_STRVAR(bpy_bmloopuv_uv_doc,
@@ -155,7 +156,8 @@ PyObject *BPy_BMLoopUV_CreatePyObject(struct MLoopUV *mloopuv)
#define BPy_BMVertSkin_Check(v) (Py_TYPE(v) == &BPy_BMVertSkin_Type)
typedef struct BPy_BMVertSkin {
- PyObject_VAR_HEAD MVertSkin *data;
+ PyObject_VAR_HEAD
+ MVertSkin *data;
} BPy_BMVertSkin;
PyDoc_STRVAR(bpy_bmvertskin_radius_doc,
@@ -392,7 +394,8 @@ PyObject *BPy_BMLoopColor_CreatePyObject(struct MLoopCol *mloopcol)
#define BPy_BMDeformVert_Check(v) (Py_TYPE(v) == &BPy_BMDeformVert_Type)
typedef struct BPy_BMDeformVert {
- PyObject_VAR_HEAD MDeformVert *data;
+ PyObject_VAR_HEAD
+ MDeformVert *data;
} BPy_BMDeformVert;
/* Mapping Protocols
diff --git a/source/blender/python/bmesh/bmesh_py_types_meshdata.h b/source/blender/python/bmesh/bmesh_py_types_meshdata.h
index b7699b387e5..426bfcef6a0 100644
--- a/source/blender/python/bmesh/bmesh_py_types_meshdata.h
+++ b/source/blender/python/bmesh/bmesh_py_types_meshdata.h
@@ -29,7 +29,8 @@ extern PyTypeObject BPy_BMDeformVert_Type;
#define BPy_BMLoopUV_Check(v) (Py_TYPE(v) == &BPy_BMLoopUV_Type)
typedef struct BPy_BMGenericMeshData {
- PyObject_VAR_HEAD void *data;
+ PyObject_VAR_HEAD
+ void *data;
} BPy_BMGenericMeshData;
struct MDeformVert;
diff --git a/source/blender/python/bmesh/bmesh_py_types_select.h b/source/blender/python/bmesh/bmesh_py_types_select.h
index c33aa3675c5..34ca162dd09 100644
--- a/source/blender/python/bmesh/bmesh_py_types_select.h
+++ b/source/blender/python/bmesh/bmesh_py_types_select.h
@@ -32,11 +32,13 @@ extern PyTypeObject BPy_BMEditSelIter_Type;
#define BPy_BMSelectHistoryIter_Check(v) (Py_TYPE(v) == &BPy_BMEditSelIter_Type)
typedef struct BPy_BMEditSelSeq {
- PyObject_VAR_HEAD struct BMesh *bm; /* keep first */
+ PyObject_VAR_HEAD
+ struct BMesh *bm; /* keep first */
} BPy_BMEditSelSeq;
typedef struct BPy_BMEditSelIter {
- PyObject_VAR_HEAD struct BMesh *bm; /* keep first */
+ PyObject_VAR_HEAD
+ struct BMesh *bm; /* keep first */
struct BMEditSelection *ese;
} BPy_BMEditSelIter;
diff --git a/source/blender/python/bmesh/bmesh_py_utils.c b/source/blender/python/bmesh/bmesh_py_utils.c
index 22c141e0958..c1e28182c53 100644
--- a/source/blender/python/bmesh/bmesh_py_utils.c
+++ b/source/blender/python/bmesh/bmesh_py_utils.c
@@ -86,7 +86,7 @@ static PyObject *bpy_bm_utils_vert_collapse_edge(PyObject *UNUSED(self), PyObjec
bm = py_edge->bm;
- e_new = BM_vert_collapse_edge(bm, py_edge->e, py_vert->v, true, true);
+ e_new = BM_vert_collapse_edge(bm, py_edge->e, py_vert->v, true, true, true);
if (e_new) {
return BPy_BMEdge_CreatePyObject(bm, e_new);
@@ -155,7 +155,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, clamp_f(fac, 0.0f, 1.0f), true, do_join_faces, true);
+ bm, py_edge->e, py_vert->v, clamp_f(fac, 0.0f, 1.0f), true, do_join_faces, true, true);
if (e_new) {
return BPy_BMEdge_CreatePyObject(bm, e_new);
@@ -450,7 +450,7 @@ static PyObject *bpy_bm_utils_face_split(PyObject *UNUSED(self), PyObject *args,
if (!PyArg_ParseTupleAndKeywords(args,
kw,
- "O!O!O!|OO&O!:face_split",
+ "O!O!O!|$OO&O!:face_split",
(char **)kwlist,
&BPy_BMFace_Type,
&py_face,