[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [45794] trunk/blender/source/blender/ python/bmesh/bmesh_py_types.c: bmesh py api: expose BMVert. calc_shell_factor()
Campbell Barton
ideasman42 at gmail.com
Thu Apr 19 21:13:57 CEST 2012
Revision: 45794
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=45794
Author: campbellbarton
Date: 2012-04-19 19:13:57 +0000 (Thu, 19 Apr 2012)
Log Message:
-----------
bmesh py api: expose BMVert.calc_shell_factor()
Modified Paths:
--------------
trunk/blender/source/blender/python/bmesh/bmesh_py_types.c
Modified: trunk/blender/source/blender/python/bmesh/bmesh_py_types.c
===================================================================
--- trunk/blender/source/blender/python/bmesh/bmesh_py_types.c 2012-04-19 19:03:35 UTC (rev 45793)
+++ trunk/blender/source/blender/python/bmesh/bmesh_py_types.c 2012-04-19 19:13:57 UTC (rev 45794)
@@ -1189,9 +1189,9 @@
PyDoc_STRVAR(bpy_bmvert_calc_edge_angle_doc,
".. method:: calc_edge_angle()\n"
"\n"
-" Return the angle between 2 connected edges.\n"
+" Return the angle between this verts 2 connected edges.\n"
"\n"
-" :return: The angle between both edges in radians.\n"
+" :return: Angle between edges in radians.\n"
" :rtype: float\n"
);
static PyObject *bpy_bmvert_calc_edge_angle(BPy_BMVert *self)
@@ -1200,6 +1200,21 @@
return PyFloat_FromDouble(BM_vert_edge_angle(self->v));
}
+PyDoc_STRVAR(bpy_bmvert_calc_shell_factor_doc,
+".. method:: calc_shell_factor()\n"
+"\n"
+" Return a multiplier calculated based on the sharpness of the vertex.\n"
+" Where a flat surface gives 1.0, and higher values sharper edges.\n"
+" This is used to maintain shell thickness when offsetting verts along their normals.\n"
+"\n"
+" :return: offset multiplier\n"
+" :rtype: float\n"
+);
+static PyObject *bpy_bmvert_calc_shell_factor(BPy_BMVert *self)
+{
+ BPY_BM_CHECK_OBJ(self);
+ return PyFloat_FromDouble(BM_vert_shell_factor(self->v));
+}
PyDoc_STRVAR(bpy_bmvert_normal_update_doc,
".. method:: normal_update()\n"
@@ -2094,7 +2109,8 @@
{"copy_from_face_interp", (PyCFunction)bpy_bmvert_copy_from_face_interp, METH_VARARGS, bpy_bmvert_copy_from_face_interp_doc},
{"copy_from_vert_interp", (PyCFunction)bpy_bmvert_copy_from_vert_interp, METH_VARARGS, bpy_bmvert_copy_from_vert_interp_doc},
- {"calc_vert_angle", (PyCFunction)bpy_bmvert_calc_edge_angle, METH_NOARGS, bpy_bmvert_calc_edge_angle_doc},
+ {"calc_vert_angle", (PyCFunction)bpy_bmvert_calc_edge_angle, METH_NOARGS, bpy_bmvert_calc_edge_angle_doc},
+ {"calc_shell_factor", (PyCFunction)bpy_bmvert_calc_shell_factor, METH_NOARGS, bpy_bmvert_calc_shell_factor_doc},
{"normal_update", (PyCFunction)bpy_bmvert_normal_update, METH_NOARGS, bpy_bmvert_normal_update_doc},
More information about the Bf-blender-cvs
mailing list