Changeset View
Changeset View
Standalone View
Standalone View
source/blender/python/bmesh/bmesh_py_types.c
| Show First 20 Lines • Show All 2,447 Lines • ▼ Show 20 Lines | |||||
| " .. code-block:: python\n" | " .. code-block:: python\n" | ||||
| "\n" | "\n" | ||||
| " for index, ele in enumerate(sequence):\n" | " for index, ele in enumerate(sequence):\n" | ||||
| " ele.index = index\n" | " ele.index = index\n" | ||||
| "\n" | "\n" | ||||
| " .. note::\n" | " .. note::\n" | ||||
| "\n" | "\n" | ||||
| " Running this on sequences besides :class:`BMesh.verts`, :class:`BMesh.edges`, :class:`BMesh.faces`\n" | " Running this on sequences besides :class:`BMesh.verts`, :class:`BMesh.edges`, :class:`BMesh.faces`\n" | ||||
| " works but wont result in each element having a valid index, insted its order in the sequence will be set.\n" | " works but won't result in each element having a valid index, insted its order in the sequence will be set.\n" | ||||
| ); | ); | ||||
| static PyObject *bpy_bmelemseq_index_update(BPy_BMElemSeq *self) | static PyObject *bpy_bmelemseq_index_update(BPy_BMElemSeq *self) | ||||
| { | { | ||||
| BMesh *bm = self->bm; | BMesh *bm = self->bm; | ||||
| BPY_BM_CHECK_OBJ(self); | BPY_BM_CHECK_OBJ(self); | ||||
| switch ((BMIterType)self->itype) { | switch ((BMIterType)self->itype) { | ||||
| ▲ Show 20 Lines • Show All 1,580 Lines • ▼ Show 20 Lines | return (((htype & BM_VERT) && (type == &BPy_BMVert_Type)) || | ||||
| ((htype & BM_EDGE) && (type == &BPy_BMEdge_Type)) || | ((htype & BM_EDGE) && (type == &BPy_BMEdge_Type)) || | ||||
| ((htype & BM_FACE) && (type == &BPy_BMFace_Type)) || | ((htype & BM_FACE) && (type == &BPy_BMFace_Type)) || | ||||
| ((htype & BM_LOOP) && (type == &BPy_BMLoop_Type))); | ((htype & BM_LOOP) && (type == &BPy_BMLoop_Type))); | ||||
| } | } | ||||
| /** | /** | ||||
| * Use for error strings only, not thread safe, | * Use for error strings only, not thread safe, | ||||
| * | * | ||||
| * \return a sting like '(BMVert/BMEdge/BMFace/BMLoop)' | * \return a string like '(BMVert/BMEdge/BMFace/BMLoop)' | ||||
| */ | */ | ||||
| char *BPy_BMElem_StringFromHType_ex(const char htype, char ret[32]) | char *BPy_BMElem_StringFromHType_ex(const char htype, char ret[32]) | ||||
| { | { | ||||
| /* zero to ensure string is always NULL terminated */ | /* zero to ensure string is always NULL terminated */ | ||||
| char *ret_ptr = ret; | char *ret_ptr = ret; | ||||
| if (htype & BM_VERT) ret_ptr += sprintf(ret_ptr, "/%s", BPy_BMVert_Type.tp_name); | if (htype & BM_VERT) ret_ptr += sprintf(ret_ptr, "/%s", BPy_BMVert_Type.tp_name); | ||||
| if (htype & BM_EDGE) ret_ptr += sprintf(ret_ptr, "/%s", BPy_BMEdge_Type.tp_name); | if (htype & BM_EDGE) ret_ptr += sprintf(ret_ptr, "/%s", BPy_BMEdge_Type.tp_name); | ||||
| if (htype & BM_FACE) ret_ptr += sprintf(ret_ptr, "/%s", BPy_BMFace_Type.tp_name); | if (htype & BM_FACE) ret_ptr += sprintf(ret_ptr, "/%s", BPy_BMFace_Type.tp_name); | ||||
| Show All 24 Lines | |||||