Merged changes in the trunk up to revision 44436.

This commit is contained in:
2012-02-25 21:11:29 +00:00
102 changed files with 796 additions and 575 deletions

View File

@@ -708,6 +708,9 @@ PyDoc_STRVAR(bpy_bmvert_calc_edge_angle_doc,
".. method:: calc_edge_angle()\n"
"\n"
" Return the angle between 2 connected edges.\n"
"\n"
" :return: The angle between both edges in radians.\n"
" :rtype: float\n"
);
static PyObject *bpy_bmvert_calc_edge_angle(BPy_BMVert *self)
{
@@ -809,6 +812,43 @@ static PyObject *bpy_bmedge_normal_update(BPy_BMEdge *self)
/* Face
* ---- */
PyDoc_STRVAR(bpy_bmface_copy_from_face_interp_doc,
".. method:: copy_from_face_interp(face)\n"
"\n"
" Interpolate the customdata from another face onto this one (faces should overlap).\n"
"\n"
" :arg face: The face to interpolate data from.\n"
" :type face: :class:`BMFace`\n"
);
static PyObject *bpy_bmface_copy_from_face_interp(BPy_BMFace *self, PyObject *args)
{
BPy_BMFace *py_face = NULL;
BPY_BM_CHECK_OBJ(self);
if (!PyArg_ParseTuple(args, "O!:BMFace.copy_from_face_interp",
&BPy_BMFace_Type, &py_face))
{
return NULL;
}
else {
BMesh *bm = self->bm;
BPY_BM_CHECK_OBJ(py_face);
if (py_face->bm != bm) {
PyErr_SetString(PyExc_ValueError,
"BMFace.copy_from_face_interp(face): face is from another mesh");
return NULL;
}
BM_face_interp_from_face(bm, self->f, py_face->f);
Py_RETURN_NONE;
}
}
PyDoc_STRVAR(bpy_bmface_copy_doc,
".. method:: copy(verts=True, edges=True)\n"
"\n"
@@ -922,6 +962,50 @@ static PyObject *bpy_bmface_normal_update(BPy_BMFace *self)
/* Loop
* ---- */
PyDoc_STRVAR(bpy_bmloop_copy_from_face_interp_doc,
".. method:: copy_from_face_interp(face, vert=True, multires=True)\n"
"\n"
" Interpolate the customdata from a face onto this loop (the loops vert should overlap the face).\n"
"\n"
" :arg face: The face to interpolate data from.\n"
" :type face: :class:`BMFace`\n"
" :arg vert: When enabled, interpolate the loops vertex data.\n"
" :type vert: boolean\n"
" :arg multires: When enabled, interpolate the loops multires data.\n"
" :type multires: boolean\n"
);
static PyObject *bpy_bmloop_copy_from_face_interp(BPy_BMLoop *self, PyObject *args)
{
BPy_BMFace *py_face = NULL;
int do_vertex = TRUE;
int do_multires = TRUE;
BPY_BM_CHECK_OBJ(self);
if (!PyArg_ParseTuple(args, "O!|ii:BMLoop.copy_from_face_interp",
&BPy_BMFace_Type, &py_face,
&do_vertex, &do_multires))
{
return NULL;
}
else {
BMesh *bm = self->bm;
BPY_BM_CHECK_OBJ(py_face);
if (py_face->bm != bm) {
PyErr_SetString(PyExc_ValueError,
"BMLoop.copy_from_face_interp(face): face is from another mesh");
return NULL;
}
BM_loop_interp_from_face(bm, self->l, py_face->f, do_vertex, do_multires);
Py_RETURN_NONE;
}
}
PyDoc_STRVAR(bpy_bmloop_calc_face_angle_doc,
".. method:: calc_face_angle()\n"
"\n"
@@ -950,7 +1034,8 @@ static PyObject *bpy_bmvertseq_new(BPy_BMElemSeq *self, PyObject *args)
if (!PyArg_ParseTuple(args, "|OO!:verts.new",
py_co,
&BPy_BMVert_Type, &py_vert_example)) {
&BPy_BMVert_Type, &py_vert_example))
{
return NULL;
}
else {
@@ -1053,7 +1138,8 @@ static PyObject *bpy_bmfaceseq_new(BPy_BMElemSeq *self, PyObject *args)
if (!PyArg_ParseTuple(args, "O|O!:faces.new",
&vert_seq,
&BPy_BMFace_Type, &py_face_example)) {
&BPy_BMFace_Type, &py_face_example))
{
return NULL;
}
else {
@@ -1185,7 +1271,7 @@ static PyObject *bpy_bmvertseq_remove(BPy_BMElemSeq *self, BPy_BMVert *value)
BPY_BM_CHECK_OBJ(value);
if (value->bm != bm) {
PyErr_SetString(PyExc_TypeError,
PyErr_SetString(PyExc_ValueError,
"faces.remove(vert): vertex is from another mesh");
return NULL;
}
@@ -1193,7 +1279,7 @@ static PyObject *bpy_bmvertseq_remove(BPy_BMElemSeq *self, BPy_BMVert *value)
BM_vert_kill(bm, value->v);
bpy_bm_generic_invalidate((BPy_BMGeneric *)value);
Py_RETURN_NONE;;
Py_RETURN_NONE;
}
}
@@ -1210,7 +1296,7 @@ static PyObject *bpy_bmedgeseq_remove(BPy_BMElemSeq *self, BPy_BMEdge *value)
BPY_BM_CHECK_OBJ(value);
if (value->bm != bm) {
PyErr_SetString(PyExc_TypeError,
PyErr_SetString(PyExc_ValueError,
"faces.remove(vert): vertex is from another mesh");
return NULL;
}
@@ -1218,7 +1304,7 @@ static PyObject *bpy_bmedgeseq_remove(BPy_BMElemSeq *self, BPy_BMEdge *value)
BM_edge_kill(bm, value->e);
bpy_bm_generic_invalidate((BPy_BMGeneric *)value);
Py_RETURN_NONE;;
Py_RETURN_NONE;
}
}
@@ -1235,7 +1321,7 @@ static PyObject *bpy_bmfaceseq_remove(BPy_BMElemSeq *self, BPy_BMFace *value)
BPY_BM_CHECK_OBJ(value);
if (value->bm != bm) {
PyErr_SetString(PyExc_TypeError,
PyErr_SetString(PyExc_ValueError,
"faces.remove(vert): vertex is from another mesh");
return NULL;
}
@@ -1243,7 +1329,7 @@ static PyObject *bpy_bmfaceseq_remove(BPy_BMElemSeq *self, BPy_BMFace *value)
BM_face_kill(bm, value->f);
bpy_bm_generic_invalidate((BPy_BMGeneric *)value);
Py_RETURN_NONE;;
Py_RETURN_NONE;
}
}
@@ -1471,7 +1557,9 @@ static struct PyMethodDef bpy_bmedge_methods[] = {
static struct PyMethodDef bpy_bmface_methods[] = {
{"select_set", (PyCFunction)bpy_bm_elem_select_set, METH_O, bpy_bm_elem_select_set_doc},
{"copy_from", (PyCFunction)bpy_bm_elem_copy_from, METH_O, bpy_bm_elem_copy_from_doc},
{"copy_from_face_interp", (PyCFunction)bpy_bmface_copy_from_face_interp, METH_O, bpy_bmface_copy_from_face_interp_doc},
{"copy", (PyCFunction)bpy_bmface_copy, METH_VARARGS|METH_KEYWORDS, bpy_bmface_copy_doc},
@@ -1486,6 +1574,7 @@ static struct PyMethodDef bpy_bmface_methods[] = {
static struct PyMethodDef bpy_bmloop_methods[] = {
{"copy_from", (PyCFunction)bpy_bm_elem_copy_from, METH_O, bpy_bm_elem_copy_from_doc},
{"copy_from_face_interp", (PyCFunction)bpy_bmloop_copy_from_face_interp, METH_O, bpy_bmloop_copy_from_face_interp_doc},
{"calc_angle", (PyCFunction)bpy_bmloop_calc_face_angle, METH_NOARGS, bpy_bmloop_calc_face_angle_doc},
{NULL, NULL, 0, NULL}

View File

@@ -327,7 +327,7 @@ static PyObject *bpy_bm_utils_face_split(PyObject *UNUSED(self), PyObject *args)
BMFace *f_new = NULL;
BMLoop *l_new = NULL;
if (!PyArg_ParseTuple(args, "O!O!|O!:face_split",
if (!PyArg_ParseTuple(args, "O!O!O!|O!:face_split",
&BPy_BMFace_Type, &py_face,
&BPy_BMVert_Type, &py_vert_a,
&BPy_BMVert_Type, &py_vert_b,
@@ -362,7 +362,7 @@ static PyObject *bpy_bm_utils_face_split(PyObject *UNUSED(self), PyObject *args)
bm = py_face->bm;
f_new = BM_face_split(bm, py_face->f,
py_vert_a->v, py_vert_a->v,
py_vert_a->v, py_vert_b->v,
&l_new, py_edge_example ? py_edge_example->e : NULL);
if (f_new && l_new) {

View File

@@ -228,7 +228,7 @@ PyObject *PyC_Object_GetAttrStringArgs(PyObject *o, Py_ssize_t n, ...)
/* similar to PyErr_Format(),
*
* implimentation - we cant actually preprend the existing exception,
* implementation - we cant actually preprend the existing exception,
* because it could have _any_ argiments given to it, so instead we get its
* __str__ output and raise our own exception including it.
*/

View File

@@ -6857,7 +6857,7 @@ static int bpy_class_call(bContext *C, PointerRNA *ptr, FunctionRNA *func, Param
#if 1
/* Skip the code below and call init directly on the allocated 'py_srna'
* otherwise __init__() always needs to take a second self argument, see pyrna_struct_new().
* Although this is annoying to have to impliment a part of pythons typeobject.c:type_call().
* Although this is annoying to have to implement a part of pythons typeobject.c:type_call().
*/
if (py_class->tp_init) {
#ifdef USE_PEDANTIC_WRITE

View File

@@ -796,7 +796,7 @@ static PyObject *M_Noise_cell_vector(PyObject *UNUSED(self), PyObject *args)
return NULL;
cellNoiseV(vec[0], vec[1], vec[2], r_vec);
return Vector_CreatePyObject(NULL, 3, Py_NEW, NULL);;
return Vector_CreatePyObject(NULL, 3, Py_NEW, NULL);
}
static PyMethodDef M_Noise_methods[] = {