diff options
Diffstat (limited to 'source/blender/freestyle/intern/python')
25 files changed, 50 insertions, 50 deletions
diff --git a/source/blender/freestyle/intern/python/BPy_Convert.cpp b/source/blender/freestyle/intern/python/BPy_Convert.cpp index 4e1a0a119aa..0ac116b1bd4 100644 --- a/source/blender/freestyle/intern/python/BPy_Convert.cpp +++ b/source/blender/freestyle/intern/python/BPy_Convert.cpp @@ -89,7 +89,7 @@ PyObject *Vector_from_Vec3f(Vec3f& vec) float vec_data[3]; // because vec->_coord is protected vec_data[0] = vec.x(); vec_data[1] = vec.y(); - vec_data[2] = vec.z(); + vec_data[2] = vec.z(); return Vector_CreatePyObject(vec_data, 3, NULL); } @@ -356,7 +356,7 @@ PyObject *BPy_SShape_from_SShape(SShape& ss) PyObject *py_ss = SShape_Type.tp_new(&SShape_Type, 0, 0); ((BPy_SShape *)py_ss)->ss = &ss; ((BPy_SShape *)py_ss)->borrowed = true; - return py_ss; + return py_ss; } PyObject *BPy_ViewShape_from_ViewShape(ViewShape& vs) diff --git a/source/blender/freestyle/intern/python/BPy_Convert.h b/source/blender/freestyle/intern/python/BPy_Convert.h index 35c1e58369c..a0e0b578c10 100644 --- a/source/blender/freestyle/intern/python/BPy_Convert.h +++ b/source/blender/freestyle/intern/python/BPy_Convert.h @@ -40,7 +40,7 @@ using namespace Freestyle::Geometry; #include "../geometry/BBox.h" // FEdge, FEdgeSharp, FEdgeSmooth, SShape, SVertex, FEdgeInternal::SVertexIterator -#include "../view_map/Silhouette.h" +#include "../view_map/Silhouette.h" // Id #include "../system/Id.h" diff --git a/source/blender/freestyle/intern/python/BPy_Freestyle.cpp b/source/blender/freestyle/intern/python/BPy_Freestyle.cpp index 0b09a3c2442..23deb63ce36 100644 --- a/source/blender/freestyle/intern/python/BPy_Freestyle.cpp +++ b/source/blender/freestyle/intern/python/BPy_Freestyle.cpp @@ -486,7 +486,7 @@ static PyModuleDef module_definition = { PyObject *Freestyle_Init(void) { PyObject *module; - + // initialize modules module = PyModule_Create(&module_definition); if (!module) @@ -509,9 +509,9 @@ PyObject *Freestyle_Init(void) else { printf("Freestyle: couldn't find 'scripts/freestyle/modules', Freestyle won't work properly.\n"); } - + // attach its classes (adding the object types to the module) - + // those classes have to be initialized before the others MediumType_Init(module); Nature_Init(module); diff --git a/source/blender/freestyle/intern/python/BPy_IntegrationType.cpp b/source/blender/freestyle/intern/python/BPy_IntegrationType.cpp index 0db25753caa..548ab529f34 100644 --- a/source/blender/freestyle/intern/python/BPy_IntegrationType.cpp +++ b/source/blender/freestyle/intern/python/BPy_IntegrationType.cpp @@ -216,7 +216,7 @@ static PyLongObject _IntegrationType_LAST = { int IntegrationType_Init(PyObject *module) { PyObject *m, *d, *f; - + if (module == NULL) return -1; @@ -230,7 +230,7 @@ int IntegrationType_Init(PyObject *module) PyDict_SetItemString(IntegrationType_Type.tp_dict, "MAX", BPy_IntegrationType_MAX); PyDict_SetItemString(IntegrationType_Type.tp_dict, "FIRST", BPy_IntegrationType_FIRST); PyDict_SetItemString(IntegrationType_Type.tp_dict, "LAST", BPy_IntegrationType_LAST); - + m = PyModule_Create(&module_definition); if (m == NULL) return -1; diff --git a/source/blender/freestyle/intern/python/BPy_Interface0D.cpp b/source/blender/freestyle/intern/python/BPy_Interface0D.cpp index 8f23800fb7a..d592aed749d 100644 --- a/source/blender/freestyle/intern/python/BPy_Interface0D.cpp +++ b/source/blender/freestyle/intern/python/BPy_Interface0D.cpp @@ -59,7 +59,7 @@ int Interface0D_Init(PyObject *module) if (PyType_Ready(&SVertex_Type) < 0) return -1; Py_INCREF(&SVertex_Type); - PyModule_AddObject(module, "SVertex", (PyObject *)&SVertex_Type); + PyModule_AddObject(module, "SVertex", (PyObject *)&SVertex_Type); if (PyType_Ready(&ViewVertex_Type) < 0) return -1; diff --git a/source/blender/freestyle/intern/python/BPy_MediumType.cpp b/source/blender/freestyle/intern/python/BPy_MediumType.cpp index 240f3f2d6e2..ebd9c6822a9 100644 --- a/source/blender/freestyle/intern/python/BPy_MediumType.cpp +++ b/source/blender/freestyle/intern/python/BPy_MediumType.cpp @@ -103,7 +103,7 @@ PyLongObject _BPy_MediumType_OPAQUE_MEDIUM = { //-------------------MODULE INITIALIZATION-------------------------------- int MediumType_Init(PyObject *module) -{ +{ if (module == NULL) return -1; diff --git a/source/blender/freestyle/intern/python/BPy_SShape.cpp b/source/blender/freestyle/intern/python/BPy_SShape.cpp index 9169adf4d9f..cf4880ad3f7 100644 --- a/source/blender/freestyle/intern/python/BPy_SShape.cpp +++ b/source/blender/freestyle/intern/python/BPy_SShape.cpp @@ -232,11 +232,11 @@ static PyObject *SShape_vertices_get(BPy_SShape *self, void *UNUSED(closure)) vector< SVertex * >::iterator it; PyObject *py_vertices = PyList_New(vertices.size()); unsigned int i = 0; - + for (it = vertices.begin(); it != vertices.end(); it++) { PyList_SET_ITEM(py_vertices, i++, BPy_SVertex_from_SVertex(*(*it))); } - + return py_vertices; } @@ -252,11 +252,11 @@ static PyObject *SShape_edges_get(BPy_SShape *self, void *UNUSED(closure)) vector< FEdge * >::iterator it; PyObject *py_edges = PyList_New(edges.size()); unsigned int i = 0; - + for (it = edges.begin(); it != edges.end(); it++) { PyList_SET_ITEM(py_edges, i++, Any_BPy_FEdge_from_FEdge(*(*it))); } - + return py_edges; } diff --git a/source/blender/freestyle/intern/python/BPy_StrokeShader.cpp b/source/blender/freestyle/intern/python/BPy_StrokeShader.cpp index 6b4a1872b61..eee48f19e1b 100644 --- a/source/blender/freestyle/intern/python/BPy_StrokeShader.cpp +++ b/source/blender/freestyle/intern/python/BPy_StrokeShader.cpp @@ -216,7 +216,7 @@ static PyObject *StrokeShader_shade(BPy_StrokeShader *self, PyObject *args, PyOb if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!", (char **)kwlist, &Stroke_Type, &py_s)) return NULL; - + if (typeid(*(self->ss)) == typeid(StrokeShader)) { PyErr_SetString(PyExc_TypeError, "shade method not properly overridden"); return NULL; diff --git a/source/blender/freestyle/intern/python/BPy_UnaryPredicate1D.cpp b/source/blender/freestyle/intern/python/BPy_UnaryPredicate1D.cpp index fc43accabf0..87e5e7505ca 100644 --- a/source/blender/freestyle/intern/python/BPy_UnaryPredicate1D.cpp +++ b/source/blender/freestyle/intern/python/BPy_UnaryPredicate1D.cpp @@ -161,9 +161,9 @@ static PyObject *UnaryPredicate1D___call__(BPy_UnaryPredicate1D *self, PyObject if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!", (char **)kwlist, &Interface1D_Type, &py_if1D)) return NULL; - + Interface1D *if1D = ((BPy_Interface1D *)py_if1D)->if1D; - + if (!if1D) { string class_name(Py_TYPE(self)->tp_name); PyErr_SetString(PyExc_RuntimeError, (class_name + " has no Interface1D").c_str()); diff --git a/source/blender/freestyle/intern/python/BPy_ViewShape.cpp b/source/blender/freestyle/intern/python/BPy_ViewShape.cpp index f2f53159fcf..33c18c3ce80 100644 --- a/source/blender/freestyle/intern/python/BPy_ViewShape.cpp +++ b/source/blender/freestyle/intern/python/BPy_ViewShape.cpp @@ -222,7 +222,7 @@ static int ViewShape_vertices_set(BPy_ViewShape *self, PyObject *value, void *UN { PyObject *item; vector< ViewVertex *> v; - + if (!PyList_Check(value)) { PyErr_SetString(PyExc_TypeError, "value must be a list of ViewVertex objects"); return -1; diff --git a/source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_ViewMapGradientNormBP1D.cpp b/source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_ViewMapGradientNormBP1D.cpp index 2072faa43ef..8d81e508340 100644 --- a/source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_ViewMapGradientNormBP1D.cpp +++ b/source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_ViewMapGradientNormBP1D.cpp @@ -35,7 +35,7 @@ extern "C" { //------------------------INSTANCE METHODS ---------------------------------- -//ViewMapGradientNormBP1D(int level, IntegrationType iType=MEAN, float sampling=2.0) +//ViewMapGradientNormBP1D(int level, IntegrationType iType=MEAN, float sampling=2.0) static char ViewMapGradientNormBP1D___doc__[] = "Class hierarchy: :class:`freestyle.types.BinaryPredicate1D` > :class:`ViewMapGradientNormBP1D`\n" diff --git a/source/blender/freestyle/intern/python/Director.cpp b/source/blender/freestyle/intern/python/Director.cpp index 9f85e84e297..f4f02a7026f 100644 --- a/source/blender/freestyle/intern/python/Director.cpp +++ b/source/blender/freestyle/intern/python/Director.cpp @@ -325,7 +325,7 @@ int Director_BPy_UnaryFunction1D___call__(void *uf1D, void *py_uf1D, Interface1D vec.push_back(b); } ((UnaryFunction1D< vector<ViewShape*> > *)uf1D)->result = vec; - } + } Py_DECREF(result); return 0; } diff --git a/source/blender/freestyle/intern/python/Director.h b/source/blender/freestyle/intern/python/Director.h index 40576c0ec2c..6a0ae7dd704 100644 --- a/source/blender/freestyle/intern/python/Director.h +++ b/source/blender/freestyle/intern/python/Director.h @@ -53,7 +53,7 @@ int Director_BPy_UnaryFunction1D___call__(void *uf1D, void *py_uf1D, Interface1D // UnaryPredicate0D: __call__ int Director_BPy_UnaryPredicate0D___call__(UnaryPredicate0D *up0D, Interface0DIterator& if0D_it); - + // UnaryPredicate1D: __call__ int Director_BPy_UnaryPredicate1D___call__(UnaryPredicate1D *up1D, Interface1D& if1D); diff --git a/source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp b/source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp index 39919b41423..33300ea70b5 100644 --- a/source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp +++ b/source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp @@ -341,7 +341,7 @@ PyDoc_STRVAR(SVertex_normals_doc, static PyObject *SVertex_normals_get(BPy_SVertex *self, void *UNUSED(closure)) { - PyObject *py_normals; + PyObject *py_normals; set< Vec3r > normals = self->sv->normals(); set< Vec3r >::iterator it; py_normals = PyList_New(normals.size()); diff --git a/source/blender/freestyle/intern/python/Interface1D/BPy_Stroke.cpp b/source/blender/freestyle/intern/python/Interface1D/BPy_Stroke.cpp index 5c816bdfea1..9a39db0ee7e 100644 --- a/source/blender/freestyle/intern/python/Interface1D/BPy_Stroke.cpp +++ b/source/blender/freestyle/intern/python/Interface1D/BPy_Stroke.cpp @@ -314,7 +314,7 @@ static PyObject *Stroke_stroke_vertices_size(BPy_Stroke *self) return PyLong_FromLong(self->s->strokeVerticesSize()); } -static PyMethodDef BPy_Stroke_methods[] = { +static PyMethodDef BPy_Stroke_methods[] = { {"compute_sampling", (PyCFunction)Stroke_compute_sampling, METH_VARARGS | METH_KEYWORDS, Stroke_compute_sampling_doc}, {"resample", (PyCFunction)Stroke_resample, METH_VARARGS | METH_KEYWORDS, Stroke_resample_doc}, diff --git a/source/blender/freestyle/intern/python/Interface1D/BPy_ViewEdge.cpp b/source/blender/freestyle/intern/python/Interface1D/BPy_ViewEdge.cpp index bcae5a2c2a4..9119d8f999e 100644 --- a/source/blender/freestyle/intern/python/Interface1D/BPy_ViewEdge.cpp +++ b/source/blender/freestyle/intern/python/Interface1D/BPy_ViewEdge.cpp @@ -182,7 +182,7 @@ PyDoc_STRVAR(ViewEdge_viewshape_doc, ":type: :class:`ViewShape`"); static PyObject *ViewEdge_viewshape_get(BPy_ViewEdge *self, void *UNUSED(closure)) -{ +{ ViewShape *vs = self->ve->viewShape(); if (vs) return BPy_ViewShape_from_ViewShape(*vs); diff --git a/source/blender/freestyle/intern/python/Iterator/BPy_ChainSilhouetteIterator.cpp b/source/blender/freestyle/intern/python/Iterator/BPy_ChainSilhouetteIterator.cpp index 08cfffec860..5a6e838dcc6 100644 --- a/source/blender/freestyle/intern/python/Iterator/BPy_ChainSilhouetteIterator.cpp +++ b/source/blender/freestyle/intern/python/Iterator/BPy_ChainSilhouetteIterator.cpp @@ -98,7 +98,7 @@ static int ChainSilhouetteIterator_init(BPy_ChainSilhouetteIterator *self, PyObj bool restrict_to_selection = (!obj1) ? true : bool_from_PyBool(obj1); ViewEdge *begin = (!obj2 || obj2 == Py_None) ? NULL : ((BPy_ViewEdge *)obj2)->ve; bool orientation = (!obj3) ? true : bool_from_PyBool(obj3); - self->cs_it = new ChainSilhouetteIterator(restrict_to_selection, begin, orientation); + self->cs_it = new ChainSilhouetteIterator(restrict_to_selection, begin, orientation); } else { PyErr_SetString(PyExc_TypeError, "invalid argument(s)"); diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DDouble.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DDouble.cpp index e91c62c7d24..1f5444d7beb 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DDouble.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DDouble.cpp @@ -161,15 +161,15 @@ static int UnaryFunction1DDouble___init__(BPy_UnaryFunction1DDouble *self, PyObj if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O!", (char **)kwlist, &IntegrationType_Type, &obj)) return -1; - + if (!obj) self->uf1D_double = new UnaryFunction1D<double>(); else { self->uf1D_double = new UnaryFunction1D<double>(IntegrationType_from_BPy_IntegrationType(obj)); } - + self->uf1D_double->py_uf1D = (PyObject *)self; - + return 0; } diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DEdgeNature.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DEdgeNature.cpp index abef3b2676f..3f0611dba84 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DEdgeNature.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DEdgeNature.cpp @@ -83,15 +83,15 @@ static int UnaryFunction1DEdgeNature___init__(BPy_UnaryFunction1DEdgeNature *sel if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O!", (char **)kwlist, &IntegrationType_Type, &obj)) return -1; - + if (!obj) self->uf1D_edgenature = new UnaryFunction1D<Nature::EdgeNature>(); else { self->uf1D_edgenature = new UnaryFunction1D<Nature::EdgeNature>(IntegrationType_from_BPy_IntegrationType(obj)); } - + self->uf1D_edgenature->py_uf1D = (PyObject *)self; - + return 0; } diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DFloat.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DFloat.cpp index 13a001c585b..b3b27aabade 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DFloat.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DFloat.cpp @@ -76,15 +76,15 @@ static int UnaryFunction1DFloat___init__(BPy_UnaryFunction1DFloat *self, PyObjec if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O!", (char **)kwlist, &IntegrationType_Type, &obj)) return -1; - + if (!obj) self->uf1D_float = new UnaryFunction1D<float>(); else { self->uf1D_float = new UnaryFunction1D<float>(IntegrationType_from_BPy_IntegrationType(obj)); } - + self->uf1D_float->py_uf1D = (PyObject *)self; - + return 0; } diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DUnsigned.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DUnsigned.cpp index 4e88020b5c8..0814eafb18e 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DUnsigned.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DUnsigned.cpp @@ -83,15 +83,15 @@ static int UnaryFunction1DUnsigned___init__(BPy_UnaryFunction1DUnsigned *self, P if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O!", (char **)kwlist, &IntegrationType_Type, &obj)) return -1; - + if (!obj) self->uf1D_unsigned = new UnaryFunction1D<unsigned int>(); else { self->uf1D_unsigned = new UnaryFunction1D<unsigned int>(IntegrationType_from_BPy_IntegrationType(obj)); } - + self->uf1D_unsigned->py_uf1D = (PyObject *)self; - + return 0; } diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVec2f.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVec2f.cpp index 9a864a3f579..f7f4fea02ae 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVec2f.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVec2f.cpp @@ -89,15 +89,15 @@ static int UnaryFunction1DVec2f___init__(BPy_UnaryFunction1DVec2f *self, PyObjec if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O!", (char **)kwlist, &IntegrationType_Type, &obj)) return -1; - + if (!obj) self->uf1D_vec2f = new UnaryFunction1D<Vec2f>(); else { self->uf1D_vec2f = new UnaryFunction1D<Vec2f>(IntegrationType_from_BPy_IntegrationType(obj)); } - + self->uf1D_vec2f->py_uf1D = (PyObject *)self; - + return 0; } diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVec3f.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVec3f.cpp index 60c581ac845..980df2c2268 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVec3f.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVec3f.cpp @@ -83,15 +83,15 @@ static int UnaryFunction1DVec3f___init__(BPy_UnaryFunction1DVec3f *self, PyObjec if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O!", (char **)kwlist, &IntegrationType_Type, &obj)) return -1; - + if (!obj) self->uf1D_vec3f = new UnaryFunction1D<Vec3f>(); else { self->uf1D_vec3f = new UnaryFunction1D<Vec3f>(IntegrationType_from_BPy_IntegrationType(obj)); } - + self->uf1D_vec3f->py_uf1D = (PyObject *)self; - + return 0; } diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVectorViewShape.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVectorViewShape.cpp index c15d974e771..5eba1573d80 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVectorViewShape.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVectorViewShape.cpp @@ -97,16 +97,16 @@ static int UnaryFunction1DVectorViewShape___init__(BPy_UnaryFunction1DVectorView if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O!", (char **)kwlist, &IntegrationType_Type, &obj)) return -1; - + if (!obj) { self->uf1D_vectorviewshape = new UnaryFunction1D< std::vector<ViewShape*> >(); } else { self->uf1D_vectorviewshape = new UnaryFunction1D< std::vector<ViewShape*> >(IntegrationType_from_BPy_IntegrationType(obj)); } - + self->uf1D_vectorviewshape->py_uf1D = (PyObject *)self; - + return 0; } @@ -149,7 +149,7 @@ static PyObject *UnaryFunction1DVectorViewShape___call__(BPy_UnaryFunction1DVect ViewShape *v = self->uf1D_vectorviewshape->result[i]; PyList_SET_ITEM(list, i, v ? BPy_ViewShape_from_ViewShape(*v) : (Py_INCREF(Py_None), Py_None)); } - + return list; } diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVoid.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVoid.cpp index 4db28c0db95..7a83a49b9d2 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVoid.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVoid.cpp @@ -96,15 +96,15 @@ static int UnaryFunction1DVoid___init__(BPy_UnaryFunction1DVoid *self, PyObject if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O!", (char **)kwlist, &IntegrationType_Type, &obj)) return -1; - + if (!obj) self->uf1D_void = new UnaryFunction1D_void(); else { self->uf1D_void = new UnaryFunction1D_void(IntegrationType_from_BPy_IntegrationType(obj)); } - + self->uf1D_void->py_uf1D = (PyObject *)self; - + return 0; } |