diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-04-05 19:42:31 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-04-05 19:42:31 +0400 |
commit | 89926a0598a794043ed9b702f32d119fed888c04 (patch) | |
tree | 9d6dae64adcd31e738e32141fa9c15219c6cb981 /source/blender/python/bmesh | |
parent | 83fff218cca47147183c1177de9db1381cfa48e6 (diff) | |
parent | 12981b004891aa6dbd2334a4c732ba38c1b0c349 (diff) |
svn merge ^/trunk/blender -r55776:55813
Diffstat (limited to 'source/blender/python/bmesh')
-rw-r--r-- | source/blender/python/bmesh/bmesh_py_types.c | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/source/blender/python/bmesh/bmesh_py_types.c b/source/blender/python/bmesh/bmesh_py_types.c index a591b41db98..6aaa58f0ed4 100644 --- a/source/blender/python/bmesh/bmesh_py_types.c +++ b/source/blender/python/bmesh/bmesh_py_types.c @@ -423,6 +423,15 @@ static PyObject *bpy_bmedge_is_contiguous_get(BPy_BMEdge *self) return PyBool_FromLong(BM_edge_is_contiguous(self->e)); } +PyDoc_STRVAR(bpy_bmedge_is_convex_doc, +"True when this edge joins 2 convex faces, depends on a valid face normal (read-only).\n\n:type: boolean" +); +static PyObject *bpy_bmedge_is_convex_get(BPy_BMEdge *self) +{ + BPY_BM_CHECK_OBJ(self); + return PyBool_FromLong(BM_edge_is_convex(self->e)); +} + PyDoc_STRVAR(bpy_bmedge_is_wire_doc, "True when this edge is not connected to any faces (read-only).\n\n:type: boolean" ); @@ -652,10 +661,10 @@ static PyObject *bpy_bmloop_link_loop_radial_prev_get(BPy_BMLoop *self) return BPy_BMLoop_CreatePyObject(self->bm, self->l->radial_prev); } -PyDoc_STRVAR(bpy_bm_is_convex_doc, -"True when this loop is at the convex corner of a face, depends on a valid face normal (read-only).\n\n:type: :class:`BMLoop`" +PyDoc_STRVAR(bpy_bmloop_is_convex_doc, +"True when this loop is at the convex corner of a face, depends on a valid face normal (read-only).\n\n:type: boolean" ); -static PyObject *bpy_bm_is_convex_get(BPy_BMLoop *self) +static PyObject *bpy_bmloop_is_convex_get(BPy_BMLoop *self) { BPY_BM_CHECK_OBJ(self); return PyBool_FromLong(BM_loop_is_convex(self->l)); @@ -777,6 +786,7 @@ static PyGetSetDef bpy_bmedge_getseters[] = { /* readonly checks */ {(char *)"is_manifold", (getter)bpy_bmedge_is_manifold_get, (setter)NULL, (char *)bpy_bmedge_is_manifold_doc, NULL}, {(char *)"is_contiguous", (getter)bpy_bmedge_is_contiguous_get, (setter)NULL, (char *)bpy_bmedge_is_contiguous_doc, NULL}, + {(char *)"is_convex", (getter)bpy_bmedge_is_convex_get, (setter)NULL, (char *)bpy_bmedge_is_convex_doc, NULL}, {(char *)"is_wire", (getter)bpy_bmedge_is_wire_get, (setter)NULL, (char *)bpy_bmedge_is_wire_doc, NULL}, {(char *)"is_boundary", (getter)bpy_bmedge_is_boundary_get, (setter)NULL, (char *)bpy_bmedge_is_boundary_doc, NULL}, {(char *)"is_valid", (getter)bpy_bm_is_valid_get, (setter)NULL, (char *)bpy_bm_is_valid_doc, NULL}, @@ -832,8 +842,8 @@ static PyGetSetDef bpy_bmloop_getseters[] = { {(char *)"link_loop_radial_prev", (getter)bpy_bmloop_link_loop_radial_prev_get, (setter)NULL, (char *)bpy_bmloop_link_loop_radial_prev_doc, NULL}, /* readonly checks */ - {(char *)"is_convex", (getter)bpy_bm_is_convex_get, (setter)NULL, (char *)bpy_bm_is_convex_doc, NULL}, - {(char *)"is_valid", (getter)bpy_bm_is_valid_get, (setter)NULL, (char *)bpy_bm_is_valid_doc, NULL}, + {(char *)"is_convex", (getter)bpy_bmloop_is_convex_get, (setter)NULL, (char *)bpy_bmloop_is_convex_doc, NULL}, + {(char *)"is_valid", (getter)bpy_bm_is_valid_get, (setter)NULL, (char *)bpy_bm_is_valid_doc, NULL}, {NULL, NULL, NULL, NULL, NULL} /* Sentinel */ }; @@ -1489,6 +1499,18 @@ static PyObject *bpy_bmedge_calc_face_angle(BPy_BMEdge *self) return PyFloat_FromDouble(BM_edge_calc_face_angle(self->e)); } +PyDoc_STRVAR(bpy_bmedge_calc_face_angle_signed_doc, +".. method:: calc_face_angle_signed()\n" +"\n" +" :return: The angle between 2 connected faces in radians (negative for concave join).\n" +" :rtype: float\n" +); +static PyObject *bpy_bmedge_calc_face_angle_signed(BPy_BMEdge *self) +{ + BPY_BM_CHECK_OBJ(self); + return PyFloat_FromDouble(BM_edge_calc_face_angle_signed(self->e)); +} + PyDoc_STRVAR(bpy_bmedge_calc_tangent_doc, ".. method:: calc_tangent(loop)\n" "\n" @@ -2531,6 +2553,7 @@ static struct PyMethodDef bpy_bmedge_methods[] = { {"calc_length", (PyCFunction)bpy_bmedge_calc_length, METH_NOARGS, bpy_bmedge_calc_length_doc}, {"calc_face_angle", (PyCFunction)bpy_bmedge_calc_face_angle, METH_NOARGS, bpy_bmedge_calc_face_angle_doc}, + {"calc_face_angle_signed", (PyCFunction)bpy_bmedge_calc_face_angle_signed, METH_NOARGS, bpy_bmedge_calc_face_angle_signed_doc}, {"calc_tangent", (PyCFunction)bpy_bmedge_calc_tangent, METH_VARARGS, bpy_bmedge_calc_tangent_doc}, {"normal_update", (PyCFunction)bpy_bmedge_normal_update, METH_NOARGS, bpy_bmedge_normal_update_doc}, @@ -3711,7 +3734,8 @@ char *BPy_BMElem_StringFromHType_ex(const char htype, char ret[32]) if (htype & BM_FACE) ret_ptr += sprintf(ret_ptr, "/%s", BPy_BMFace_Type.tp_name); if (htype & BM_LOOP) ret_ptr += sprintf(ret_ptr, "/%s", BPy_BMLoop_Type.tp_name); ret[0] = '('; - *ret_ptr = ')'; + *ret_ptr++ = ')'; + *ret_ptr = '\0'; return ret; } char *BPy_BMElem_StringFromHType(const char htype) |