Skip to content

Commit 9587ad9

Browse files
author
root
committed
cleaning code..
1 parent 93d7232 commit 9587ad9

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

python/main.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,13 @@ extern "C"
3131
static PyObject*
3232
pyLoadObj(PyObject* self, PyObject* args)
3333
{
34-
PyObject *rtndict, *pyshapes, *pymaterials;
34+
PyObject *rtndict, *pyshapes, *pymaterials,
35+
*current, *meshobj;
36+
3537
char const* filename;
38+
char *current_name;
39+
vectd vect;
40+
3641
std::vector<tinyobj::shape_t> shapes;
3742
std::vector<tinyobj::material_t> materials;
3843

@@ -48,10 +53,6 @@ pyLoadObj(PyObject* self, PyObject* args)
4853
for (std::vector<tinyobj::shape_t>::iterator shape = shapes.begin() ;
4954
shape != shapes.end(); shape++)
5055
{
51-
PyObject *meshobj, *current;
52-
char *current_name;
53-
vectd vect;
54-
5556
meshobj = PyDict_New();
5657
tinyobj::mesh_t cm = (*shape).mesh;
5758

@@ -62,13 +63,13 @@ pyLoadObj(PyObject* self, PyObject* args)
6263
if (i == 0){
6364
current_name = "positions";
6465
vect = vectd(cm.positions.begin(), cm.positions.end()); }
65-
else if (i==1){
66+
else if (i == 1){
6667
current_name = "normals";
6768
vect = vectd(cm.normals.begin(), cm.normals.end()); }
6869
else if (i == 2) {
6970
current_name = "texcoords";
7071
vect = vectd(cm.texcoords.begin(), cm.texcoords.end()); }
71-
else if (i==3) {
72+
else if (i == 3) {
7273
current_name = "indicies";
7374
vect = vectd(cm.indices.begin(), cm.indices.end()); }
7475
else if (i == 4) {

0 commit comments

Comments
 (0)