Blender
V3.3
|
#include <Python.h>
#include "BLI_utildefines.h"
#include "../mathutils/mathutils.h"
#include "bmesh.h"
#include "bmesh_py_ops_call.h"
#include "bmesh_py_types.h"
#include "../generic/py_capi_utils.h"
#include "../generic/python_utildefines.h"
Go to the source code of this file.
Functions | |
BLI_STATIC_ASSERT (sizeof(PyC_FlagSet)==sizeof(BMO_FlagSet), "size mismatch") | |
static int | bpy_bm_op_as_py_error (BMesh *bm) |
static int | bpy_slot_from_py_elem_check (BPy_BMElem *value, BMesh *bm, const char htype, const char *opname, const char *slot_name, const char *descr) |
Utility function to check BMVert/BMEdge/BMFace's. More... | |
static int | bpy_slot_from_py_elemseq_check (BPy_BMGeneric *value, BMesh *bm, const char htype_py, const char htype_bmo, const char *opname, const char *slot_name, const char *descr) |
Utility function to check BMVertSeq/BMEdgeSeq/BMFaceSeq's. More... | |
static int | bpy_slot_from_py (BMesh *bm, BMOperator *bmop, BMOpSlot *slot, PyObject *value, const char *opname, const char *slot_name) |
static PyObject * | bpy_slot_to_py (BMesh *bm, BMOpSlot *slot) |
PyObject * | BPy_BMO_call (BPy_BMeshOpFunc *self, PyObject *args, PyObject *kw) |
This file provides call aka BPy_BMO_call for the bmesh operator and has been given its own file because argument conversion is involved.
Definition in file bmesh_py_ops_call.c.
BLI_STATIC_ASSERT | ( | sizeof(PyC_FlagSet) | = =sizeof(BMO_FlagSet) , |
"size mismatch" | |||
) |
|
static |
Definition at line 29 of file bmesh_py_ops_call.c.
References bm, BMO_error_clear(), BMO_ERROR_FATAL, BMO_error_get(), BMO_error_occurred_at_level(), and NULL.
Referenced by BPy_BMO_call().
PyObject* BPy_BMO_call | ( | BPy_BMeshOpFunc * | self, |
PyObject * | args, | ||
PyObject * | kw | ||
) |
This is the __call__
for bmesh.ops.xxx()
.
Definition at line 732 of file bmesh_py_ops_call.c.
References BLI_assert, bm, BPy_BMesh::bm, BMO_error_clear(), BMO_FLAG_DEFAULTS, BMO_op_exec(), BMO_op_finish(), BMO_op_init(), BMO_slot_exists(), BMO_slot_get(), BPY_BM_CHECK_OBJ, bpy_bm_op_as_py_error(), BPy_BMesh_Check, bpy_slot_from_py(), bpy_slot_to_py(), MAX_SLOTNAME, NULL, pos, ret, self, BMOpSlot::slot_name, BMOperator::slots_in, BMOperator::slots_out, UNLIKELY, and BMesh::use_toolflags.
|
static |
Use for giving py args to an operator.
Definition at line 142 of file bmesh_py_ops_call.c.
References bm, BM_ALL_NOLOOP, BM_EDGE, BM_FACE, BM_ITER_BPY_BM_SEQ, bm_iter_itype_htype_map, BM_VERT, BMO_OP_SLOT_BOOL, BMO_OP_SLOT_ELEMENT_BUF, BMO_OP_SLOT_FLT, BMO_OP_SLOT_INT, BMO_OP_SLOT_MAPPING, BMO_OP_SLOT_MAT, BMO_OP_SLOT_SUBTYPE_ELEM_IS_SINGLE, BMO_OP_SLOT_SUBTYPE_INT_ENUM, BMO_OP_SLOT_SUBTYPE_INT_FLAG, BMO_OP_SLOT_SUBTYPE_MAP_BOOL, BMO_OP_SLOT_SUBTYPE_MAP_ELEM, BMO_OP_SLOT_SUBTYPE_MAP_EMPTY, BMO_OP_SLOT_SUBTYPE_MAP_FLT, BMO_OP_SLOT_SUBTYPE_MAP_INT, BMO_OP_SLOT_SUBTYPE_MAP_INTERNAL, BMO_OP_SLOT_VEC, BMO_SLOT_AS_BOOL, BMO_SLOT_AS_FLOAT, BMO_SLOT_AS_INT, BMO_SLOT_AS_VECTOR, BMO_slot_buffer_alloc(), BMO_slot_buffer_from_all(), BMO_slot_buffer_from_single(), BMO_slot_map_bool_insert(), BMO_slot_map_elem_insert(), BMO_slot_map_empty_insert(), BMO_slot_map_float_insert(), BMO_slot_map_int_insert(), BMO_slot_mat_set(), BPy_BMEdgeSeq_Check, BPy_BMElem_PySeq_As_Array(), BPy_BMElemSeq_Check, BPy_BMFaceSeq_Check, BPy_BMVertSeq_Check, bpy_slot_from_py_elem_check(), bpy_slot_from_py_elemseq_check(), BMOpSlot::buf, MatrixObject::col_num, BMOpSlot::data, ELEM, eBMOpSlotSubType_Union::elem, BMOpSlot::enum_data, if(), eBMOpSlotSubType_Union::intg, itype, eBMOpSlotSubType_Union::map, mathutils_array_parse(), Matrix_ParseAny(), NULL, PyC_FlagSet_ToBitfield(), PyC_FlagSet_ValueFromID(), PyC_Long_AsBool(), MatrixObject::row_num, size(), BMOpSlot::slot_subtype, BMOpSlot::slot_type, and BMOperator::slots_in.
Referenced by BPy_BMO_call().
|
static |
Utility function to check BMVert/BMEdge/BMFace's.
value | |
bm | Check the value against this. |
htype | Test value matches this type. |
descr | Description text. |
Definition at line 51 of file bmesh_py_ops_call.c.
References bm, BPy_BMElem::bm, BPy_BMElem_Check, BPy_BMElem_StringFromHType(), BPy_BMElem::ele, BMElem::head, BMHeader::htype, and NULL.
Referenced by bpy_slot_from_py().
|
static |
Utility function to check BMVertSeq/BMEdgeSeq/BMFaceSeq's.
value | Caller must check its a BMeshSeq |
bm | Check the value against this. |
htype_py | The type(s) of value. |
htype_bmo | The type(s) supported by the target slot. |
descr | Description text. |
Definition at line 97 of file bmesh_py_ops_call.c.
References bm, BPy_BMGeneric::bm, BPy_BMElem_StringFromHType_ex(), and NULL.
Referenced by bpy_slot_from_py().
Use for getting return values from an operator that's already executed.
Definition at line 588 of file bmesh_py_ops_call.c.
References BLI_assert, BLI_ghash_len(), BLI_ghashIterator_getKey(), BLI_ghashIterator_getValue(), bm, BMO_OP_SLOT_BOOL, BMO_OP_SLOT_ELEMENT_BUF, BMO_OP_SLOT_FLT, BMO_OP_SLOT_INT, BMO_OP_SLOT_MAPPING, BMO_OP_SLOT_MAT, BMO_OP_SLOT_PTR, BMO_OP_SLOT_SUBTYPE_ELEM_IS_SINGLE, BMO_OP_SLOT_SUBTYPE_MAP_BOOL, BMO_OP_SLOT_SUBTYPE_MAP_ELEM, BMO_OP_SLOT_SUBTYPE_MAP_EMPTY, BMO_OP_SLOT_SUBTYPE_MAP_FLT, BMO_OP_SLOT_SUBTYPE_MAP_INT, BMO_OP_SLOT_SUBTYPE_MAP_INTERNAL, BMO_OP_SLOT_VEC, BMO_SLOT_AS_BOOL, BMO_SLOT_AS_BUFFER, BMO_SLOT_AS_FLOAT, BMO_SLOT_AS_GHASH, BMO_SLOT_AS_INT, BMO_SLOT_AS_MATRIX, BMO_SLOT_AS_VECTOR, BMO_slot_buffer_get_single(), BPy_BMElem_CreatePyObject(), buffer, eBMOpSlotSubType_Union::elem, GHASH_ITER, BMOpSlot::len, eBMOpSlotSubType_Union::map, Matrix_CreatePyObject(), NULL, size(), BMOpSlot::slot_subtype, BMOpSlot::slot_type, and Vector_CreatePyObject().
Referenced by BPy_BMO_call().