Changeset View
Changeset View
Standalone View
Standalone View
source/blender/python/bmesh/bmesh_py_ops_call.c
| Show First 20 Lines • Show All 271 Lines • ▼ Show 20 Lines | case BMO_OP_SLOT_ELEMENT_BUF: | ||||
| * this way the operator takes every item. | * this way the operator takes every item. | ||||
| * - `TODO` a plain python sequence (list) of elements. | * - `TODO` a plain python sequence (list) of elements. | ||||
| * - `TODO` an iterator. eg. | * - `TODO` an iterator. eg. | ||||
| * face.verts | * face.verts | ||||
| * - `TODO` (type, flag) pair, eg. | * - `TODO` (type, flag) pair, eg. | ||||
| * ('VERT', {'TAG'}) | * ('VERT', {'TAG'}) | ||||
| */ | */ | ||||
| if (BPy_BMVertSeq_Check(value)) { | if (PySet_Check(value)) { | ||||
| int flags; | |||||
| if (PyC_FlagSet_ToBitfield(bpy_bm_htype_vert_edge_face_flags, value, &flags, slot_name) == -1) { | |||||
| return -1; | |||||
| } | |||||
| BMO_slot_buffer_from_all(bm, bmop, bmop->slots_in, slot_name, flags); | |||||
| } | |||||
| else if (PyDict_Check(value)) { | |||||
| int htype, flags; | |||||
| PyObject *item, *key; | |||||
| Py_ssize_t pos = 0; | |||||
| while (PyDict_Next(value, &pos, &key, &item)) { | |||||
| const char *key_str = _PyUnicode_AsString(key); | |||||
| if (PyC_FlagSet_ValueFromID(bpy_bm_htype_vert_edge_face_flags, key_str, &htype, slot_name) == -1) { | |||||
| return -1; | |||||
| } | |||||
| if (PyC_FlagSet_ToBitfield(bpy_bm_hflag_all_flags, item, &flags, slot_name) == -1) { | |||||
| return -1; | |||||
| } | |||||
| BMO_slot_buffer_from_enabled_hflag_extend(bm, bmop, bmop->slots_in, slot_name, htype, flags); | |||||
| } | |||||
| } | |||||
| else if (BPy_BMVertSeq_Check(value)) { | |||||
| if (bpy_slot_from_py_elemseq_check((BPy_BMGeneric *)value, bm, | if (bpy_slot_from_py_elemseq_check((BPy_BMGeneric *)value, bm, | ||||
| BM_VERT, (slot->slot_subtype.elem & BM_ALL_NOLOOP), | BM_VERT, (slot->slot_subtype.elem & BM_ALL_NOLOOP), | ||||
| opname, slot_name, "element buffer") == -1) | opname, slot_name, "element buffer") == -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() */ | ||||
| } | } | ||||
| BMO_slot_buffer_from_all(bm, bmop, bmop->slots_in, slot_name, BM_VERT); | BMO_slot_buffer_from_all(bm, bmop, bmop->slots_in, slot_name, BM_VERT); | ||||
| ▲ Show 20 Lines • Show All 525 Lines • Show Last 20 Lines | |||||