From 9587ad9aee5b5801ab1b3eb244bbc06ed38b891a Mon Sep 17 00:00:00 2001 From: root Date: Sun, 16 Nov 2014 23:53:21 +0100 Subject: [PATCH] cleaning code.. --- python/main.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/python/main.cpp b/python/main.cpp index 8999563..81f7476 100644 --- a/python/main.cpp +++ b/python/main.cpp @@ -31,8 +31,13 @@ extern "C" static PyObject* pyLoadObj(PyObject* self, PyObject* args) { - PyObject *rtndict, *pyshapes, *pymaterials; + PyObject *rtndict, *pyshapes, *pymaterials, + *current, *meshobj; + char const* filename; + char *current_name; + vectd vect; + std::vector shapes; std::vector materials; @@ -48,10 +53,6 @@ pyLoadObj(PyObject* self, PyObject* args) for (std::vector::iterator shape = shapes.begin() ; shape != shapes.end(); shape++) { - PyObject *meshobj, *current; - char *current_name; - vectd vect; - meshobj = PyDict_New(); tinyobj::mesh_t cm = (*shape).mesh; @@ -62,13 +63,13 @@ pyLoadObj(PyObject* self, PyObject* args) if (i == 0){ current_name = "positions"; vect = vectd(cm.positions.begin(), cm.positions.end()); } - else if (i==1){ + else if (i == 1){ current_name = "normals"; vect = vectd(cm.normals.begin(), cm.normals.end()); } else if (i == 2) { current_name = "texcoords"; vect = vectd(cm.texcoords.begin(), cm.texcoords.end()); } - else if (i==3) { + else if (i == 3) { current_name = "indicies"; vect = vectd(cm.indices.begin(), cm.indices.end()); } else if (i == 4) {