Changeset View
Changeset View
Standalone View
Standalone View
source/blender/python/bmesh/bmesh_py_ops_call.c
| Show First 20 Lines • Show All 249 Lines • ▼ Show 20 Lines | switch (slot->slot_type) { | ||||
| case BMO_OP_SLOT_VEC: | case BMO_OP_SLOT_VEC: | ||||
| { | { | ||||
| /* passing slot name here is a bit non-descriptive */ | /* passing slot name here is a bit non-descriptive */ | ||||
| if (mathutils_array_parse(BMO_SLOT_AS_VECTOR(slot), 3, 3, value, slot_name) == -1) { | if (mathutils_array_parse(BMO_SLOT_AS_VECTOR(slot), 3, 3, value, slot_name) == -1) { | ||||
| return -1; | return -1; | ||||
| } | } | ||||
| break; | break; | ||||
| } | } | ||||
| case BMO_OP_SLOT_PTR: | |||||
| { | |||||
| /* allow none to be passed as the default */ | |||||
| if (value == Py_None) { | |||||
| BMO_SLOT_AS_POINTER(slot) = NULL; | |||||
| break; | |||||
| } | |||||
| BPy_BMesh *py_bm; | |||||
| switch (slot->slot_subtype.ptr) { | |||||
| case BMO_OP_SLOT_SUBTYPE_PTR_BMESH: | |||||
| py_bm = (BPy_BMesh *)value; | |||||
| if (!BPy_BMesh_Check(py_bm)) { | |||||
| PyErr_Format(PyExc_TypeError, | |||||
| "%.200s: keyword \"%.200s\" expected a BMesh", | |||||
| opname, slot_name); | |||||
| return -1; | |||||
| } | |||||
| if (!py_bm->bm->use_toolflags) { | |||||
| PyErr_Format(PyExc_ValueError, | |||||
| "%.200s: keyword \"%.200s\" BMesh must be created with use_operators=True", | |||||
| opname, slot_name); | |||||
| return -1; | |||||
| } | |||||
| /* ensure this bmesh has toolflags */ | |||||
| BM_mesh_elem_toolflags_ensure(py_bm->bm); | |||||
| BMO_SLOT_AS_POINTER(slot) = py_bm->bm; | |||||
| break; | |||||
| default: | |||||
| PyErr_Format(PyExc_NotImplementedError, | |||||
| "%.200s: keyword \"%.200s\" type %d not working yet!", | |||||
| opname, slot_name, slot->slot_type); | |||||
| return -1; | |||||
| break; | |||||
| } | |||||
| break; | |||||
| } | |||||
| case BMO_OP_SLOT_ELEMENT_BUF: | case BMO_OP_SLOT_ELEMENT_BUF: | ||||
| { | { | ||||
| if (slot->slot_subtype.elem & BMO_OP_SLOT_SUBTYPE_ELEM_IS_SINGLE) { | if (slot->slot_subtype.elem & BMO_OP_SLOT_SUBTYPE_ELEM_IS_SINGLE) { | ||||
| if (bpy_slot_from_py_elem_check((BPy_BMElem *)value, bm, (slot->slot_subtype.elem & BM_ALL_NOLOOP), | if (bpy_slot_from_py_elem_check((BPy_BMElem *)value, bm, (slot->slot_subtype.elem & BM_ALL_NOLOOP), | ||||
| opname, slot_name, "single element") == -1) | opname, slot_name, "single element") == -1) | ||||
| { | { | ||||
| return -1; /* error is set in bpy_slot_from_py_elem_check() */ | return -1; /* error is set in bpy_slot_from_py_elem_check() */ | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 548 Lines • Show Last 20 Lines | |||||