diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-03-20 00:01:59 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-03-20 00:01:59 +0400 |
commit | 9c642781a6f13d3c1a1d7ddc7b6be97e06ee39c6 (patch) | |
tree | b533b7d6da031182304126a94643608bebd5a936 /source | |
parent | 4fa92f1e5f51b67e20fdfeebcd4255e2e556f8f9 (diff) |
style cleanup: minor change to bmesh py repr + comment on loop radial next/prev to avoid confusion.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/bmesh/bmesh_class.h | 2 | ||||
-rw-r--r-- | source/blender/python/bmesh/bmesh_py_types.c | 24 |
2 files changed, 16 insertions, 10 deletions
diff --git a/source/blender/bmesh/bmesh_class.h b/source/blender/bmesh/bmesh_class.h index ae1f0e04dae..5dc93bfad88 100644 --- a/source/blender/bmesh/bmesh_class.h +++ b/source/blender/bmesh/bmesh_class.h @@ -110,6 +110,8 @@ typedef struct BMLoop { struct BMEdge *e; /* edge, using verts (v, next->v) */ struct BMFace *f; + /* circular linked list of loops which all use the same edge as this one '->e', + * but not necessarily the same vertex (can be either v1 or v2 of our own '->e') */ struct BMLoop *radial_next, *radial_prev; /* these were originally commented as private but are used all over the code */ diff --git a/source/blender/python/bmesh/bmesh_py_types.c b/source/blender/python/bmesh/bmesh_py_types.c index 1c4b52d4f42..982a58edeb9 100644 --- a/source/blender/python/bmesh/bmesh_py_types.c +++ b/source/blender/python/bmesh/bmesh_py_types.c @@ -2519,8 +2519,9 @@ static PyObject *bpy_bmvert_repr(BPy_BMVert *self) BMesh *bm = self->bm; if (bm) { + BMVert *v = self->v; return PyUnicode_FromFormat("<BMVert(%p), index=%d>", - self->v, BM_elem_index_get(self->v)); + v, BM_elem_index_get(v)); } else { return PyUnicode_FromFormat("<BMVert dead at %p>", self); @@ -2532,10 +2533,11 @@ static PyObject *bpy_bmedge_repr(BPy_BMEdge *self) BMesh *bm = self->bm; if (bm) { + BMEdge *e = self->e; return PyUnicode_FromFormat("<BMEdge(%p), index=%d, verts=(%p/%d, %p/%d)>", - self->e, BM_elem_index_get(self->e), - self->e->v1, BM_elem_index_get(self->e->v1), - self->e->v2, BM_elem_index_get(self->e->v2)); + e, BM_elem_index_get(e), + e->v1, BM_elem_index_get(e->v1), + e->v2, BM_elem_index_get(e->v2)); } else { return PyUnicode_FromFormat("<BMEdge dead at %p>", self); @@ -2547,9 +2549,10 @@ static PyObject *bpy_bmface_repr(BPy_BMFace *self) BMesh *bm = self->bm; if (bm) { + BMFace *f = self->f; return PyUnicode_FromFormat("<BMFace(%p), index=%d, totverts=%d>", - self->f, BM_elem_index_get(self->f), - self->f->len); + f, BM_elem_index_get(f), + f->len); } else { return PyUnicode_FromFormat("<BMFace dead at %p>", self); @@ -2561,11 +2564,12 @@ static PyObject *bpy_bmloop_repr(BPy_BMLoop *self) BMesh *bm = self->bm; if (bm) { + BMLoop *l = self->l; return PyUnicode_FromFormat("<BMLoop(%p), index=%d, vert=%p/%d, edge=%p/%d, face=%p/%d>", - self->l, BM_elem_index_get(self->l), - self->l->v, BM_elem_index_get(self->l->v), - self->l->e, BM_elem_index_get(self->l->e), - self->l->f, BM_elem_index_get(self->l->f)); + l, BM_elem_index_get(l), + l->v, BM_elem_index_get(l->v), + l->e, BM_elem_index_get(l->e), + l->f, BM_elem_index_get(l->f)); } else { return PyUnicode_FromFormat("<BMLoop dead at %p>", self); |