diff --git a/punyverse/_model.c b/punyverse/_model.c index 586cfa4..1c8674c 100644 --- a/punyverse/_model.c +++ b/punyverse/_model.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.18 on Tue Oct 29 17:52:33 2013 */ +/* Generated by Cython 0.18 on Wed Oct 30 18:45:04 2013 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -1012,7 +1012,7 @@ enum { __pyx_e_9punyverse_6_model_FACE_QUADS }; -/* "punyverse\_model.pyx":280 +/* "punyverse\_model.pyx":288 * glVertex3f(x * sx, y * sy, z * sz) * * cpdef int model_list(WavefrontObject model, float sx=1, float sy=1, float sz=1, object rotation=(0, 0, 0)): # <<<<<<<<<<<<<< @@ -1543,6 +1543,7 @@ static char __pyx_k__rb[] = "rb"; static char __pyx_k__sx[] = "sx"; static char __pyx_k__sy[] = "sy"; static char __pyx_k__sz[] = "sz"; +static char __pyx_k__sys[] = "sys"; static char __pyx_k__join[] = "join"; static char __pyx_k__mbcs[] = "mbcs"; static char __pyx_k__name[] = "name"; @@ -1551,6 +1552,7 @@ static char __pyx_k__path[] = "path"; static char __pyx_k__texs[] = "texs"; static char __pyx_k__type[] = "type"; static char __pyx_k__uuid[] = "uuid"; +static char __pyx_k__isabs[] = "isabs"; static char __pyx_k__model[] = "model"; static char __pyx_k__norms[] = "norms"; static char __pyx_k__range[] = "range"; @@ -1559,6 +1561,7 @@ static char __pyx_k__uuid4[] = "uuid4"; static char __pyx_k__verts[] = "verts"; static char __pyx_k__assets[] = "assets"; static char __pyx_k__decode[] = "decode"; +static char __pyx_k__frozen[] = "frozen"; static char __pyx_k__map_Kd[] = "map_Kd"; static char __pyx_k__models[] = "models"; static char __pyx_k__mtllib[] = "mtllib"; @@ -1579,7 +1582,9 @@ static char __pyx_k__textures[] = "textures"; static char __pyx_k__vertices[] = "vertices"; static char __pyx_k__iteritems[] = "iteritems"; static char __pyx_k__shininess[] = "shininess"; +static char __pyx_k__executable[] = "executable"; static char __pyx_k__load_model[] = "load_model"; +static char __pyx_k__model_base[] = "model_base"; static char __pyx_k__load_texture[] = "load_texture"; static char __pyx_k__AttributeError[] = "AttributeError"; static PyObject *__pyx_n_s_12; @@ -1602,12 +1607,16 @@ static PyObject *__pyx_n_s__abspath; static PyObject *__pyx_n_s__assets; static PyObject *__pyx_n_s__decode; static PyObject *__pyx_n_s__dirname; +static PyObject *__pyx_n_s__executable; +static PyObject *__pyx_n_s__frozen; +static PyObject *__pyx_n_s__isabs; static PyObject *__pyx_n_s__iteritems; static PyObject *__pyx_n_s__join; static PyObject *__pyx_n_s__load_model; static PyObject *__pyx_n_s__load_texture; static PyObject *__pyx_n_s__mbcs; static PyObject *__pyx_n_s__model; +static PyObject *__pyx_n_s__model_base; static PyObject *__pyx_n_s__models; static PyObject *__pyx_n_s__name; static PyObject *__pyx_n_s__normals; @@ -1621,6 +1630,7 @@ static PyObject *__pyx_n_s__shininess; static PyObject *__pyx_n_s__split; static PyObject *__pyx_n_s__sx; static PyObject *__pyx_n_s__sy; +static PyObject *__pyx_n_s__sys; static PyObject *__pyx_n_s__sz; static PyObject *__pyx_n_s__texs; static PyObject *__pyx_n_s__texture; @@ -7282,7 +7292,7 @@ static CYTHON_INLINE void __pyx_f_9punyverse_6_model_15WavefrontObject_perform_i * free(buf) * fclose(cfile) # <<<<<<<<<<<<<< * - * def load_model(path): + * import sys */ fclose(__pyx_v_cfile); @@ -7765,12 +7775,12 @@ static PyObject *__pyx_pw_9punyverse_6_model_1load_model(PyObject *__pyx_self, P return __pyx_r; } -/* "punyverse\_model.pyx":260 - * fclose(cfile) +/* "punyverse\_model.pyx":267 + * del sys * * def load_model(path): # <<<<<<<<<<<<<< - * path = os.path.join(os.path.dirname(__file__), 'assets', 'models', path) - * if not isinstance(path, unicode): + * if not os.path.isabs(path): + * path = os.path.join(model_base, path) */ static PyObject *__pyx_pf_9punyverse_6_model_load_model(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path) { @@ -7779,102 +7789,110 @@ static PyObject *__pyx_pf_9punyverse_6_model_load_model(CYTHON_UNUSED PyObject * PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; + int __pyx_t_4; int __pyx_t_5; - int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("load_model", 0); __Pyx_INCREF(__pyx_v_path); - /* "punyverse\_model.pyx":261 + /* "punyverse\_model.pyx":268 * * def load_model(path): - * path = os.path.join(os.path.dirname(__file__), 'assets', 'models', path) # <<<<<<<<<<<<<< + * if not os.path.isabs(path): # <<<<<<<<<<<<<< + * path = os.path.join(model_base, path) + * if not isinstance(path, unicode): + */ + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__path); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__isabs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_path); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_path); + __Pyx_GIVEREF(__pyx_v_path); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = (!__pyx_t_4); + if (__pyx_t_5) { + + /* "punyverse\_model.pyx":269 + * def load_model(path): + * if not os.path.isabs(path): + * path = os.path.join(model_base, path) # <<<<<<<<<<<<<< * if not isinstance(path, unicode): * path = path.decode('mbcs') */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__path); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__path); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__dirname); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s____file__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __Pyx_INCREF(((PyObject *)__pyx_n_s__assets)); - PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_n_s__assets)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__assets)); - __Pyx_INCREF(((PyObject *)__pyx_n_s__models)); - PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_n_s__models)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__models)); - __Pyx_INCREF(__pyx_v_path); - PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_path); - __Pyx_GIVEREF(__pyx_v_path); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_v_path); - __pyx_v_path = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__path); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__join); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__model_base); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_path); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_path); + __Pyx_GIVEREF(__pyx_v_path); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_v_path); + __pyx_v_path = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L3; + } + __pyx_L3:; - /* "punyverse\_model.pyx":262 - * def load_model(path): - * path = os.path.join(os.path.dirname(__file__), 'assets', 'models', path) + /* "punyverse\_model.pyx":270 + * if not os.path.isabs(path): + * path = os.path.join(model_base, path) * if not isinstance(path, unicode): # <<<<<<<<<<<<<< * path = path.decode('mbcs') * return WavefrontObject(path) */ __pyx_t_5 = PyUnicode_Check(__pyx_v_path); - __pyx_t_6 = (!__pyx_t_5); - if (__pyx_t_6) { + __pyx_t_4 = (!__pyx_t_5); + if (__pyx_t_4) { - /* "punyverse\_model.pyx":263 - * path = os.path.join(os.path.dirname(__file__), 'assets', 'models', path) + /* "punyverse\_model.pyx":271 + * path = os.path.join(model_base, path) * if not isinstance(path, unicode): * path = path.decode('mbcs') # <<<<<<<<<<<<<< * return WavefrontObject(path) * */ - __pyx_t_3 = PyObject_GetAttr(__pyx_v_path, __pyx_n_s__decode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_9), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_v_path, __pyx_n_s__decode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_9), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_v_path); - __pyx_v_path = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L3; + __pyx_v_path = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L4; } - __pyx_L3:; + __pyx_L4:; - /* "punyverse\_model.pyx":264 + /* "punyverse\_model.pyx":272 * if not isinstance(path, unicode): * path = path.decode('mbcs') * return WavefrontObject(path) # <<<<<<<<<<<<<< @@ -7882,16 +7900,16 @@ static PyObject *__pyx_pf_9punyverse_6_model_load_model(CYTHON_UNUSED PyObject * * @cython.nonecheck(False) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_path); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_path); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_path); __Pyx_GIVEREF(__pyx_v_path); - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_9punyverse_6_model_WavefrontObject)), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_9punyverse_6_model_WavefrontObject)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -7900,7 +7918,6 @@ static PyObject *__pyx_pf_9punyverse_6_model_load_model(CYTHON_UNUSED PyObject * __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("punyverse._model.load_model", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -7910,7 +7927,7 @@ static PyObject *__pyx_pf_9punyverse_6_model_load_model(CYTHON_UNUSED PyObject * return __pyx_r; } -/* "punyverse\_model.pyx":267 +/* "punyverse\_model.pyx":275 * * @cython.nonecheck(False) * cdef inline void point(Face f, WavefrontObject m, int tex_id, float sx, float sy, float sz, int n): # <<<<<<<<<<<<<< @@ -7943,7 +7960,7 @@ static CYTHON_INLINE void __pyx_f_9punyverse_6_model_point(struct __pyx_obj_9pun int __pyx_clineno = 0; __Pyx_RefNannySetupContext("point", 0); - /* "punyverse\_model.pyx":270 + /* "punyverse\_model.pyx":278 * cdef float x, y, z * cdef tuple normal, texture * if f.norms: # <<<<<<<<<<<<<< @@ -7953,7 +7970,7 @@ static CYTHON_INLINE void __pyx_f_9punyverse_6_model_point(struct __pyx_obj_9pun __pyx_t_1 = (((PyObject *)__pyx_v_f->norms) != Py_None) && (PyList_GET_SIZE(((PyObject *)__pyx_v_f->norms)) != 0); if (__pyx_t_1) { - /* "punyverse\_model.pyx":271 + /* "punyverse\_model.pyx":279 * cdef tuple normal, texture * if f.norms: * normal = m.normals[f.norms[n]] # <<<<<<<<<<<<<< @@ -7962,22 +7979,22 @@ static CYTHON_INLINE void __pyx_f_9punyverse_6_model_point(struct __pyx_obj_9pun */ if (unlikely(((PyObject *)__pyx_v_m->normals) == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } if (unlikely(((PyObject *)__pyx_v_f->norms) == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_f->norms), __pyx_v_n, sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_f->norms), __pyx_v_n, sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_m->normals), __pyx_t_2); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_m->normals), __pyx_t_2); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_normal = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "punyverse\_model.pyx":272 + /* "punyverse\_model.pyx":280 * if f.norms: * normal = m.normals[f.norms[n]] * glNormal3f(normal[0], normal[1], normal[2]) # <<<<<<<<<<<<<< @@ -7986,34 +8003,34 @@ static CYTHON_INLINE void __pyx_f_9punyverse_6_model_point(struct __pyx_obj_9pun */ if (unlikely(((PyObject *)__pyx_v_normal) == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_3 = __Pyx_GetItemInt_Tuple(((PyObject *)__pyx_v_normal), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt_Tuple(((PyObject *)__pyx_v_normal), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_4 == (GLfloat)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_4 == (GLfloat)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(((PyObject *)__pyx_v_normal) == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_3 = __Pyx_GetItemInt_Tuple(((PyObject *)__pyx_v_normal), 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt_Tuple(((PyObject *)__pyx_v_normal), 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_5 == (GLfloat)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_5 == (GLfloat)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(((PyObject *)__pyx_v_normal) == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_3 = __Pyx_GetItemInt_Tuple(((PyObject *)__pyx_v_normal), 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt_Tuple(((PyObject *)__pyx_v_normal), 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_6 == (GLfloat)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_6 == (GLfloat)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; glNormal3f(__pyx_t_4, __pyx_t_5, __pyx_t_6); goto __pyx_L3; } __pyx_L3:; - /* "punyverse\_model.pyx":273 + /* "punyverse\_model.pyx":281 * normal = m.normals[f.norms[n]] * glNormal3f(normal[0], normal[1], normal[2]) * if tex_id: # <<<<<<<<<<<<<< @@ -8022,7 +8039,7 @@ static CYTHON_INLINE void __pyx_f_9punyverse_6_model_point(struct __pyx_obj_9pun */ if (__pyx_v_tex_id) { - /* "punyverse\_model.pyx":274 + /* "punyverse\_model.pyx":282 * glNormal3f(normal[0], normal[1], normal[2]) * if tex_id: * texture = m.textures[f.texs[n]] # <<<<<<<<<<<<<< @@ -8031,22 +8048,22 @@ static CYTHON_INLINE void __pyx_f_9punyverse_6_model_point(struct __pyx_obj_9pun */ if (unlikely(((PyObject *)__pyx_v_m->textures) == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } if (unlikely(((PyObject *)__pyx_v_f->texs) == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_3 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_f->texs), __pyx_v_n, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_f->texs), __pyx_v_n, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_m->textures), __pyx_t_3); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_m->textures), __pyx_t_3); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_texture = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "punyverse\_model.pyx":275 + /* "punyverse\_model.pyx":283 * if tex_id: * texture = m.textures[f.texs[n]] * glTexCoord2f(texture[0], texture[1]) # <<<<<<<<<<<<<< @@ -8055,26 +8072,26 @@ static CYTHON_INLINE void __pyx_f_9punyverse_6_model_point(struct __pyx_obj_9pun */ if (unlikely(((PyObject *)__pyx_v_texture) == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_2 = __Pyx_GetItemInt_Tuple(((PyObject *)__pyx_v_texture), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt_Tuple(((PyObject *)__pyx_v_texture), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_6 == (GLfloat)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_6 == (GLfloat)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(((PyObject *)__pyx_v_texture) == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_2 = __Pyx_GetItemInt_Tuple(((PyObject *)__pyx_v_texture), 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt_Tuple(((PyObject *)__pyx_v_texture), 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_5 == (GLfloat)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_5 == (GLfloat)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; glTexCoord2f(__pyx_t_6, __pyx_t_5); goto __pyx_L4; } __pyx_L4:; - /* "punyverse\_model.pyx":277 + /* "punyverse\_model.pyx":285 * glTexCoord2f(texture[0], texture[1]) * * x, y, z = m.vertices[f.verts[n]] # <<<<<<<<<<<<<< @@ -8083,15 +8100,15 @@ static CYTHON_INLINE void __pyx_f_9punyverse_6_model_point(struct __pyx_obj_9pun */ if (unlikely(((PyObject *)__pyx_v_m->vertices) == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } if (unlikely(((PyObject *)__pyx_v_f->verts) == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_f->verts), __pyx_v_n, sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_f->verts), __pyx_v_n, sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_m->vertices), __pyx_t_2); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_m->vertices), __pyx_t_2); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { @@ -8104,7 +8121,7 @@ static CYTHON_INLINE void __pyx_f_9punyverse_6_model_point(struct __pyx_obj_9pun if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { @@ -8120,18 +8137,18 @@ static CYTHON_INLINE void __pyx_f_9punyverse_6_model_point(struct __pyx_obj_9pun __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; - __pyx_t_9 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext; @@ -8141,7 +8158,7 @@ static CYTHON_INLINE void __pyx_f_9punyverse_6_model_point(struct __pyx_obj_9pun __Pyx_GOTREF(__pyx_t_7); index = 2; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L6_unpacking_done; @@ -8149,20 +8166,20 @@ static CYTHON_INLINE void __pyx_f_9punyverse_6_model_point(struct __pyx_obj_9pun __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L6_unpacking_done:; } - __pyx_t_11 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_11 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_11 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_12 = __pyx_PyFloat_AsFloat(__pyx_t_7); if (unlikely((__pyx_t_12 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __pyx_PyFloat_AsFloat(__pyx_t_7); if (unlikely((__pyx_t_12 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_13 = __pyx_PyFloat_AsFloat(__pyx_t_8); if (unlikely((__pyx_t_13 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __pyx_PyFloat_AsFloat(__pyx_t_8); if (unlikely((__pyx_t_13 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_x = __pyx_t_11; __pyx_v_y = __pyx_t_12; __pyx_v_z = __pyx_t_13; - /* "punyverse\_model.pyx":278 + /* "punyverse\_model.pyx":286 * * x, y, z = m.vertices[f.verts[n]] * glVertex3f(x * sx, y * sy, z * sz) # <<<<<<<<<<<<<< @@ -8185,7 +8202,7 @@ static CYTHON_INLINE void __pyx_f_9punyverse_6_model_point(struct __pyx_obj_9pun __Pyx_RefNannyFinishContext(); } -/* "punyverse\_model.pyx":280 +/* "punyverse\_model.pyx":288 * glVertex3f(x * sx, y * sy, z * sz) * * cpdef int model_list(WavefrontObject model, float sx=1, float sy=1, float sz=1, object rotation=(0, 0, 0)): # <<<<<<<<<<<<<< @@ -8252,7 +8269,7 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m } } - /* "punyverse\_model.pyx":281 + /* "punyverse\_model.pyx":289 * * cpdef int model_list(WavefrontObject model, float sx=1, float sy=1, float sz=1, object rotation=(0, 0, 0)): * for m, text in model.materials.iteritems(): # <<<<<<<<<<<<<< @@ -8262,9 +8279,9 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m __pyx_t_2 = 0; if (unlikely(((PyObject *)__pyx_v_model->materials) == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_5 = __Pyx_dict_iterator(((PyObject *)__pyx_v_model->materials), 1, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_dict_iterator(((PyObject *)__pyx_v_model->materials), 1, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_5; @@ -8272,7 +8289,7 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m while (1) { __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4); if (unlikely(__pyx_t_7 == 0)) break; - if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF(__pyx_v_m); @@ -8282,39 +8299,39 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m __pyx_v_text = __pyx_t_6; __pyx_t_6 = 0; - /* "punyverse\_model.pyx":282 + /* "punyverse\_model.pyx":290 * cpdef int model_list(WavefrontObject model, float sx=1, float sy=1, float sz=1, object rotation=(0, 0, 0)): * for m, text in model.materials.iteritems(): * if text.texture: # <<<<<<<<<<<<<< * load_texture(os.path.join(model.root, text.texture)) * */ - __pyx_t_6 = PyObject_GetAttr(__pyx_v_text, __pyx_n_s__texture); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_GetAttr(__pyx_v_text, __pyx_n_s__texture); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_8) { - /* "punyverse\_model.pyx":283 + /* "punyverse\_model.pyx":291 * for m, text in model.materials.iteritems(): * if text.texture: * load_texture(os.path.join(model.root, text.texture)) # <<<<<<<<<<<<<< * * cdef int display = glGenLists(1) */ - __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__load_texture); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__load_texture); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__path); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__path); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__join); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__join); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyObject_GetAttr(__pyx_v_text, __pyx_n_s__texture); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_GetAttr(__pyx_v_text, __pyx_n_s__texture); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(((PyObject *)__pyx_v_model->root)); PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_v_model->root)); @@ -8322,16 +8339,16 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; @@ -8342,7 +8359,7 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "punyverse\_model.pyx":285 + /* "punyverse\_model.pyx":293 * load_texture(os.path.join(model.root, text.texture)) * * cdef int display = glGenLists(1) # <<<<<<<<<<<<<< @@ -8351,7 +8368,7 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m */ __pyx_v_display = glGenLists(1); - /* "punyverse\_model.pyx":287 + /* "punyverse\_model.pyx":295 * cdef int display = glGenLists(1) * * glNewList(display, GL_COMPILE) # <<<<<<<<<<<<<< @@ -8360,7 +8377,7 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m */ glNewList(__pyx_v_display, __pyx_e_9punyverse_6_model_GL_COMPILE); - /* "punyverse\_model.pyx":288 + /* "punyverse\_model.pyx":296 * * glNewList(display, GL_COMPILE) * glPushMatrix() # <<<<<<<<<<<<<< @@ -8369,7 +8386,7 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m */ glPushMatrix(); - /* "punyverse\_model.pyx":289 + /* "punyverse\_model.pyx":297 * glNewList(display, GL_COMPILE) * glPushMatrix() * glPushAttrib(GL_CURRENT_BIT) # <<<<<<<<<<<<<< @@ -8378,7 +8395,7 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m */ glPushAttrib(__pyx_e_9punyverse_6_model_GL_CURRENT_BIT); - /* "punyverse\_model.pyx":294 + /* "punyverse\_model.pyx":302 * cdef float kx, ky, kz * * pitch, yaw, roll = rotation # <<<<<<<<<<<<<< @@ -8395,7 +8412,7 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { @@ -8411,17 +8428,17 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_10); #else - __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); #endif } else { Py_ssize_t index = -1; - __pyx_t_6 = PyObject_GetIter(__pyx_v_rotation); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_GetIter(__pyx_v_rotation); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_11 = Py_TYPE(__pyx_t_6)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_11(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L6_unpacking_failed; @@ -8430,7 +8447,7 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m __Pyx_GOTREF(__pyx_t_9); index = 2; __pyx_t_10 = __pyx_t_11(__pyx_t_6); if (unlikely(!__pyx_t_10)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_10); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_6), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_6), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L7_unpacking_done; @@ -8438,20 +8455,20 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L7_unpacking_done:; } - __pyx_t_12 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_12 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_12 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_13 = __pyx_PyFloat_AsFloat(__pyx_t_9); if (unlikely((__pyx_t_13 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __pyx_PyFloat_AsFloat(__pyx_t_9); if (unlikely((__pyx_t_13 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_14 = __pyx_PyFloat_AsFloat(__pyx_t_10); if (unlikely((__pyx_t_14 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __pyx_PyFloat_AsFloat(__pyx_t_10); if (unlikely((__pyx_t_14 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_v_pitch = __pyx_t_12; __pyx_v_yaw = __pyx_t_13; __pyx_v_roll = __pyx_t_14; - /* "punyverse\_model.pyx":295 + /* "punyverse\_model.pyx":303 * * pitch, yaw, roll = rotation * glPushAttrib(GL_TRANSFORM_BIT) # <<<<<<<<<<<<<< @@ -8460,7 +8477,7 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m */ glPushAttrib(__pyx_e_9punyverse_6_model_GL_TRANSFORM_BIT); - /* "punyverse\_model.pyx":296 + /* "punyverse\_model.pyx":304 * pitch, yaw, roll = rotation * glPushAttrib(GL_TRANSFORM_BIT) * glRotatef(pitch, 1, 0, 0) # <<<<<<<<<<<<<< @@ -8469,7 +8486,7 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m */ glRotatef(__pyx_v_pitch, 1.0, 0.0, 0.0); - /* "punyverse\_model.pyx":297 + /* "punyverse\_model.pyx":305 * glPushAttrib(GL_TRANSFORM_BIT) * glRotatef(pitch, 1, 0, 0) * glRotatef(yaw, 0, 1, 0) # <<<<<<<<<<<<<< @@ -8478,7 +8495,7 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m */ glRotatef(__pyx_v_yaw, 0.0, 1.0, 0.0); - /* "punyverse\_model.pyx":298 + /* "punyverse\_model.pyx":306 * glRotatef(pitch, 1, 0, 0) * glRotatef(yaw, 0, 1, 0) * glRotatef(roll, 0, 0, 1) # <<<<<<<<<<<<<< @@ -8487,7 +8504,7 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m */ glRotatef(__pyx_v_roll, 0.0, 0.0, 1.0); - /* "punyverse\_model.pyx":299 + /* "punyverse\_model.pyx":307 * glRotatef(yaw, 0, 1, 0) * glRotatef(roll, 0, 0, 1) * glPopAttrib() # <<<<<<<<<<<<<< @@ -8496,7 +8513,7 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m */ glPopAttrib(); - /* "punyverse\_model.pyx":305 + /* "punyverse\_model.pyx":313 * cdef int tex_id * * for g in model.groups: # <<<<<<<<<<<<<< @@ -8505,47 +8522,47 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m */ if (unlikely(((PyObject *)__pyx_v_model->groups) == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_10 = ((PyObject *)__pyx_v_model->groups); __Pyx_INCREF(__pyx_t_10); __pyx_t_3 = 0; for (;;) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_10)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_9 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_3); __Pyx_INCREF(__pyx_t_9); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_3); __Pyx_INCREF(__pyx_t_9); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_10, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PySequence_ITEM(__pyx_t_10, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif - if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_9punyverse_6_model_Group))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_9punyverse_6_model_Group))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_XDECREF(((PyObject *)__pyx_v_g)); __pyx_v_g = ((struct __pyx_obj_9punyverse_6_model_Group *)__pyx_t_9); __pyx_t_9 = 0; - /* "punyverse\_model.pyx":306 + /* "punyverse\_model.pyx":314 * * for g in model.groups: * tex_id = load_texture(os.path.join(model.root, g.material.texture)) if (g.material and g.material.texture) else 0 # <<<<<<<<<<<<<< * * if tex_id: */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_g->material)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_g->material)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_8) { - __pyx_t_15 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_g->material->texture)); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_g->material->texture)); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_16 = __pyx_t_15; } else { __pyx_t_16 = __pyx_t_8; } if (__pyx_t_16) { - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__load_texture); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__load_texture); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__join); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__join); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_v_model->root)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_model->root)); @@ -8553,16 +8570,16 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m __Pyx_INCREF(((PyObject *)__pyx_v_g->material->texture)); PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_g->material->texture)); __Pyx_GIVEREF(((PyObject *)__pyx_v_g->material->texture)); - __pyx_t_17 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_17); __Pyx_GIVEREF(__pyx_t_17); __pyx_t_17 = 0; - __pyx_t_17 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; @@ -8572,11 +8589,11 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m __Pyx_INCREF(__pyx_int_0); __pyx_t_9 = __pyx_int_0; } - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_9); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_9); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_tex_id = __pyx_t_4; - /* "punyverse\_model.pyx":308 + /* "punyverse\_model.pyx":316 * tex_id = load_texture(os.path.join(model.root, g.material.texture)) if (g.material and g.material.texture) else 0 * * if tex_id: # <<<<<<<<<<<<<< @@ -8585,7 +8602,7 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m */ if (__pyx_v_tex_id) { - /* "punyverse\_model.pyx":309 + /* "punyverse\_model.pyx":317 * * if tex_id: * glEnable(GL_TEXTURE_2D) # <<<<<<<<<<<<<< @@ -8594,7 +8611,7 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m */ glEnable(__pyx_e_9punyverse_6_model_GL_TEXTURE_2D); - /* "punyverse\_model.pyx":310 + /* "punyverse\_model.pyx":318 * if tex_id: * glEnable(GL_TEXTURE_2D) * glBindTexture(GL_TEXTURE_2D, tex_id) # <<<<<<<<<<<<<< @@ -8606,7 +8623,7 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m } /*else*/ { - /* "punyverse\_model.pyx":312 + /* "punyverse\_model.pyx":320 * glBindTexture(GL_TEXTURE_2D, tex_id) * else: * glBindTexture(GL_TEXTURE_2D, 0) # <<<<<<<<<<<<<< @@ -8615,7 +8632,7 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m */ glBindTexture(__pyx_e_9punyverse_6_model_GL_TEXTURE_2D, 0); - /* "punyverse\_model.pyx":313 + /* "punyverse\_model.pyx":321 * else: * glBindTexture(GL_TEXTURE_2D, 0) * glDisable(GL_TEXTURE_2D) # <<<<<<<<<<<<<< @@ -8626,7 +8643,7 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m } __pyx_L10:; - /* "punyverse\_model.pyx":315 + /* "punyverse\_model.pyx":323 * glDisable(GL_TEXTURE_2D) * * if g.material is not None: # <<<<<<<<<<<<<< @@ -8636,7 +8653,7 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m __pyx_t_16 = (((PyObject *)__pyx_v_g->material) != Py_None); if (__pyx_t_16) { - /* "punyverse\_model.pyx":316 + /* "punyverse\_model.pyx":324 * * if g.material is not None: * if g.material.texture is not None: # <<<<<<<<<<<<<< @@ -8646,24 +8663,24 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m __pyx_t_16 = (__pyx_v_g->material->texture != ((PyObject*)Py_None)); if (__pyx_t_16) { - /* "punyverse\_model.pyx":317 + /* "punyverse\_model.pyx":325 * if g.material is not None: * if g.material.texture is not None: * tex_id = load_texture(os.path.join(model.root, g.material.texture)) # <<<<<<<<<<<<<< * if g.material.Ka: * kx, ky, kz = g.material.Ka */ - __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__load_texture); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__load_texture); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_17 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_17, __pyx_n_s__path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_t_17, __pyx_n_s__path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - __pyx_t_17 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__join); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__join); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_v_model->root)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_model->root)); @@ -8671,27 +8688,27 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m __Pyx_INCREF(((PyObject *)__pyx_v_g->material->texture)); PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_g->material->texture)); __Pyx_GIVEREF(((PyObject *)__pyx_v_g->material->texture)); - __pyx_t_1 = PyObject_Call(__pyx_t_17, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_17, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_tex_id = __pyx_t_4; goto __pyx_L12; } __pyx_L12:; - /* "punyverse\_model.pyx":318 + /* "punyverse\_model.pyx":326 * if g.material.texture is not None: * tex_id = load_texture(os.path.join(model.root, g.material.texture)) * if g.material.Ka: # <<<<<<<<<<<<<< @@ -8701,7 +8718,7 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m __pyx_t_16 = (((PyObject *)__pyx_v_g->material->Ka) != Py_None) && (PyTuple_GET_SIZE(((PyObject *)__pyx_v_g->material->Ka)) != 0); if (__pyx_t_16) { - /* "punyverse\_model.pyx":319 + /* "punyverse\_model.pyx":327 * tex_id = load_texture(os.path.join(model.root, g.material.texture)) * if g.material.Ka: * kx, ky, kz = g.material.Ka # <<<<<<<<<<<<<< @@ -8720,7 +8737,7 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); @@ -8730,20 +8747,20 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_17); #else - __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_17 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else if (1) { - __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else { Py_ssize_t index = -1; - __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_11 = Py_TYPE(__pyx_t_6)->tp_iternext; @@ -8753,7 +8770,7 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m __Pyx_GOTREF(__pyx_t_9); index = 2; __pyx_t_17 = __pyx_t_11(__pyx_t_6); if (unlikely(!__pyx_t_17)) goto __pyx_L14_unpacking_failed; __Pyx_GOTREF(__pyx_t_17); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_6), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_6), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L15_unpacking_done; @@ -8761,20 +8778,20 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L15_unpacking_done:; } - __pyx_t_14 = __pyx_PyFloat_AsFloat(__pyx_t_5); if (unlikely((__pyx_t_14 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __pyx_PyFloat_AsFloat(__pyx_t_5); if (unlikely((__pyx_t_14 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_13 = __pyx_PyFloat_AsFloat(__pyx_t_9); if (unlikely((__pyx_t_13 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __pyx_PyFloat_AsFloat(__pyx_t_9); if (unlikely((__pyx_t_13 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_12 = __pyx_PyFloat_AsFloat(__pyx_t_17); if (unlikely((__pyx_t_12 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __pyx_PyFloat_AsFloat(__pyx_t_17); if (unlikely((__pyx_t_12 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __pyx_v_kx = __pyx_t_14; __pyx_v_ky = __pyx_t_13; __pyx_v_kz = __pyx_t_12; - /* "punyverse\_model.pyx":320 + /* "punyverse\_model.pyx":328 * if g.material.Ka: * kx, ky, kz = g.material.Ka * glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, [kx, ky, kz, 1]) # <<<<<<<<<<<<<< @@ -8790,7 +8807,7 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m } __pyx_L13:; - /* "punyverse\_model.pyx":321 + /* "punyverse\_model.pyx":329 * kx, ky, kz = g.material.Ka * glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, [kx, ky, kz, 1]) * if g.material.Kd: # <<<<<<<<<<<<<< @@ -8800,7 +8817,7 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m __pyx_t_16 = (((PyObject *)__pyx_v_g->material->Kd) != Py_None) && (PyTuple_GET_SIZE(((PyObject *)__pyx_v_g->material->Kd)) != 0); if (__pyx_t_16) { - /* "punyverse\_model.pyx":322 + /* "punyverse\_model.pyx":330 * glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, [kx, ky, kz, 1]) * if g.material.Kd: * kx, ky, kz = g.material.Kd # <<<<<<<<<<<<<< @@ -8819,7 +8836,7 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_17 = PyTuple_GET_ITEM(sequence, 0); @@ -8829,20 +8846,20 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_5); #else - __pyx_t_17 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); - __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else if (1) { - __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else { Py_ssize_t index = -1; - __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_11 = Py_TYPE(__pyx_t_6)->tp_iternext; @@ -8852,7 +8869,7 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m __Pyx_GOTREF(__pyx_t_9); index = 2; __pyx_t_5 = __pyx_t_11(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L17_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_6), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_6), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L18_unpacking_done; @@ -8860,20 +8877,20 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L18_unpacking_done:; } - __pyx_t_12 = __pyx_PyFloat_AsFloat(__pyx_t_17); if (unlikely((__pyx_t_12 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __pyx_PyFloat_AsFloat(__pyx_t_17); if (unlikely((__pyx_t_12 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - __pyx_t_13 = __pyx_PyFloat_AsFloat(__pyx_t_9); if (unlikely((__pyx_t_13 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __pyx_PyFloat_AsFloat(__pyx_t_9); if (unlikely((__pyx_t_13 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_14 = __pyx_PyFloat_AsFloat(__pyx_t_5); if (unlikely((__pyx_t_14 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __pyx_PyFloat_AsFloat(__pyx_t_5); if (unlikely((__pyx_t_14 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_kx = __pyx_t_12; __pyx_v_ky = __pyx_t_13; __pyx_v_kz = __pyx_t_14; - /* "punyverse\_model.pyx":323 + /* "punyverse\_model.pyx":331 * if g.material.Kd: * kx, ky, kz = g.material.Kd * glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, [kx, ky, kz, 1]) # <<<<<<<<<<<<<< @@ -8889,7 +8906,7 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m } __pyx_L16:; - /* "punyverse\_model.pyx":324 + /* "punyverse\_model.pyx":332 * kx, ky, kz = g.material.Kd * glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, [kx, ky, kz, 1]) * if g.material.Ks: # <<<<<<<<<<<<<< @@ -8899,7 +8916,7 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m __pyx_t_16 = (((PyObject *)__pyx_v_g->material->Ks) != Py_None) && (PyTuple_GET_SIZE(((PyObject *)__pyx_v_g->material->Ks)) != 0); if (__pyx_t_16) { - /* "punyverse\_model.pyx":325 + /* "punyverse\_model.pyx":333 * glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, [kx, ky, kz, 1]) * if g.material.Ks: * kx, ky, kz = g.material.Ks # <<<<<<<<<<<<<< @@ -8918,7 +8935,7 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); @@ -8928,20 +8945,20 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_17); #else - __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_17 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_17); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else if (1) { - __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else { Py_ssize_t index = -1; - __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_11 = Py_TYPE(__pyx_t_6)->tp_iternext; @@ -8951,7 +8968,7 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m __Pyx_GOTREF(__pyx_t_9); index = 2; __pyx_t_17 = __pyx_t_11(__pyx_t_6); if (unlikely(!__pyx_t_17)) goto __pyx_L20_unpacking_failed; __Pyx_GOTREF(__pyx_t_17); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_6), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_6), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L21_unpacking_done; @@ -8959,20 +8976,20 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L21_unpacking_done:; } - __pyx_t_14 = __pyx_PyFloat_AsFloat(__pyx_t_5); if (unlikely((__pyx_t_14 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __pyx_PyFloat_AsFloat(__pyx_t_5); if (unlikely((__pyx_t_14 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_13 = __pyx_PyFloat_AsFloat(__pyx_t_9); if (unlikely((__pyx_t_13 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = __pyx_PyFloat_AsFloat(__pyx_t_9); if (unlikely((__pyx_t_13 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_12 = __pyx_PyFloat_AsFloat(__pyx_t_17); if (unlikely((__pyx_t_12 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __pyx_PyFloat_AsFloat(__pyx_t_17); if (unlikely((__pyx_t_12 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __pyx_v_kx = __pyx_t_14; __pyx_v_ky = __pyx_t_13; __pyx_v_kz = __pyx_t_12; - /* "punyverse\_model.pyx":326 + /* "punyverse\_model.pyx":334 * if g.material.Ks: * kx, ky, kz = g.material.Ks * glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, [kx, ky, kz, 1]) # <<<<<<<<<<<<<< @@ -8988,7 +9005,7 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m } __pyx_L19:; - /* "punyverse\_model.pyx":327 + /* "punyverse\_model.pyx":335 * kx, ky, kz = g.material.Ks * glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, [kx, ky, kz, 1]) * glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, g.material.shininess) # <<<<<<<<<<<<<< @@ -9000,7 +9017,7 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m } __pyx_L11:; - /* "punyverse\_model.pyx":329 + /* "punyverse\_model.pyx":337 * glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, g.material.shininess) * * glBegin(GL_TRIANGLES) # <<<<<<<<<<<<<< @@ -9009,7 +9026,7 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m */ glBegin(__pyx_e_9punyverse_6_model_GL_TRIANGLES); - /* "punyverse\_model.pyx":330 + /* "punyverse\_model.pyx":338 * * glBegin(GL_TRIANGLES) * for f in g.faces: # <<<<<<<<<<<<<< @@ -9018,22 +9035,22 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m */ if (unlikely(((PyObject *)__pyx_v_g->faces) == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_1 = ((PyObject *)__pyx_v_g->faces); __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_17 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_17); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_17); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_t_17 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif - if (!(likely(((__pyx_t_17) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_17, __pyx_ptype_9punyverse_6_model_Face))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_17) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_17, __pyx_ptype_9punyverse_6_model_Face))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_XDECREF(((PyObject *)__pyx_v_f)); __pyx_v_f = ((struct __pyx_obj_9punyverse_6_model_Face *)__pyx_t_17); __pyx_t_17 = 0; - /* "punyverse\_model.pyx":331 + /* "punyverse\_model.pyx":339 * glBegin(GL_TRIANGLES) * for f in g.faces: * point(f, model, tex_id, sx, sy, sz, 0) # <<<<<<<<<<<<<< @@ -9042,7 +9059,7 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m */ __pyx_f_9punyverse_6_model_point(__pyx_v_f, __pyx_v_model, __pyx_v_tex_id, __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, 0); - /* "punyverse\_model.pyx":332 + /* "punyverse\_model.pyx":340 * for f in g.faces: * point(f, model, tex_id, sx, sy, sz, 0) * point(f, model, tex_id, sx, sy, sz, 1) # <<<<<<<<<<<<<< @@ -9051,7 +9068,7 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m */ __pyx_f_9punyverse_6_model_point(__pyx_v_f, __pyx_v_model, __pyx_v_tex_id, __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, 1); - /* "punyverse\_model.pyx":333 + /* "punyverse\_model.pyx":341 * point(f, model, tex_id, sx, sy, sz, 0) * point(f, model, tex_id, sx, sy, sz, 1) * point(f, model, tex_id, sx, sy, sz, 2) # <<<<<<<<<<<<<< @@ -9060,7 +9077,7 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m */ __pyx_f_9punyverse_6_model_point(__pyx_v_f, __pyx_v_model, __pyx_v_tex_id, __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, 2); - /* "punyverse\_model.pyx":335 + /* "punyverse\_model.pyx":343 * point(f, model, tex_id, sx, sy, sz, 2) * * if f.type == FACE_QUADS: # <<<<<<<<<<<<<< @@ -9070,7 +9087,7 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m __pyx_t_16 = (__pyx_v_f->type == __pyx_e_9punyverse_6_model_FACE_QUADS); if (__pyx_t_16) { - /* "punyverse\_model.pyx":336 + /* "punyverse\_model.pyx":344 * * if f.type == FACE_QUADS: * point(f, model, tex_id, sx, sy, sz, 2) # <<<<<<<<<<<<<< @@ -9079,7 +9096,7 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m */ __pyx_f_9punyverse_6_model_point(__pyx_v_f, __pyx_v_model, __pyx_v_tex_id, __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, 2); - /* "punyverse\_model.pyx":337 + /* "punyverse\_model.pyx":345 * if f.type == FACE_QUADS: * point(f, model, tex_id, sx, sy, sz, 2) * point(f, model, tex_id, sx, sy, sz, 3) # <<<<<<<<<<<<<< @@ -9088,7 +9105,7 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m */ __pyx_f_9punyverse_6_model_point(__pyx_v_f, __pyx_v_model, __pyx_v_tex_id, __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, 3); - /* "punyverse\_model.pyx":338 + /* "punyverse\_model.pyx":346 * point(f, model, tex_id, sx, sy, sz, 2) * point(f, model, tex_id, sx, sy, sz, 3) * point(f, model, tex_id, sx, sy, sz, 0) # <<<<<<<<<<<<<< @@ -9102,7 +9119,7 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "punyverse\_model.pyx":339 + /* "punyverse\_model.pyx":347 * point(f, model, tex_id, sx, sy, sz, 3) * point(f, model, tex_id, sx, sy, sz, 0) * glEnd() # <<<<<<<<<<<<<< @@ -9111,7 +9128,7 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m */ glEnd(); - /* "punyverse\_model.pyx":341 + /* "punyverse\_model.pyx":349 * glEnd() * * if tex_id: # <<<<<<<<<<<<<< @@ -9120,7 +9137,7 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m */ if (__pyx_v_tex_id) { - /* "punyverse\_model.pyx":342 + /* "punyverse\_model.pyx":350 * * if tex_id: * glBindTexture(GL_TEXTURE_2D, 0) # <<<<<<<<<<<<<< @@ -9129,7 +9146,7 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m */ glBindTexture(__pyx_e_9punyverse_6_model_GL_TEXTURE_2D, 0); - /* "punyverse\_model.pyx":343 + /* "punyverse\_model.pyx":351 * if tex_id: * glBindTexture(GL_TEXTURE_2D, 0) * glDisable(GL_TEXTURE_2D) # <<<<<<<<<<<<<< @@ -9143,7 +9160,7 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "punyverse\_model.pyx":345 + /* "punyverse\_model.pyx":353 * glDisable(GL_TEXTURE_2D) * * glPopAttrib() # <<<<<<<<<<<<<< @@ -9152,7 +9169,7 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m */ glPopAttrib(); - /* "punyverse\_model.pyx":346 + /* "punyverse\_model.pyx":354 * * glPopAttrib() * glPopMatrix() # <<<<<<<<<<<<<< @@ -9161,7 +9178,7 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m */ glPopMatrix(); - /* "punyverse\_model.pyx":348 + /* "punyverse\_model.pyx":356 * glPopMatrix() * * glEndList() # <<<<<<<<<<<<<< @@ -9169,7 +9186,7 @@ static int __pyx_f_9punyverse_6_model_model_list(struct __pyx_obj_9punyverse_6_m */ glEndList(); - /* "punyverse\_model.pyx":349 + /* "punyverse\_model.pyx":357 * * glEndList() * return display # <<<<<<<<<<<<<< @@ -9212,7 +9229,7 @@ static PyObject *__pyx_pw_9punyverse_6_model_3model_list(PyObject *__pyx_self, P static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__model,&__pyx_n_s__sx,&__pyx_n_s__sy,&__pyx_n_s__sz,&__pyx_n_s__rotation,0}; PyObject* values[5] = {0,0,0,0,0}; - /* "punyverse\_model.pyx":280 + /* "punyverse\_model.pyx":288 * glVertex3f(x * sx, y * sy, z * sz) * * cpdef int model_list(WavefrontObject model, float sx=1, float sy=1, float sz=1, object rotation=(0, 0, 0)): # <<<<<<<<<<<<<< @@ -9259,7 +9276,7 @@ static PyObject *__pyx_pw_9punyverse_6_model_3model_list(PyObject *__pyx_self, P } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "model_list") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "model_list") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -9274,17 +9291,17 @@ static PyObject *__pyx_pw_9punyverse_6_model_3model_list(PyObject *__pyx_self, P } __pyx_v_model = ((struct __pyx_obj_9punyverse_6_model_WavefrontObject *)values[0]); if (values[1]) { - __pyx_v_sx = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_sx == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_sx = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_sx == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_sx = ((float)1.0); } if (values[2]) { - __pyx_v_sy = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_sy == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_sy = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_sy == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_sy = ((float)1.0); } if (values[3]) { - __pyx_v_sz = __pyx_PyFloat_AsFloat(values[3]); if (unlikely((__pyx_v_sz == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_sz = __pyx_PyFloat_AsFloat(values[3]); if (unlikely((__pyx_v_sz == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_sz = ((float)1.0); } @@ -9292,13 +9309,13 @@ static PyObject *__pyx_pw_9punyverse_6_model_3model_list(PyObject *__pyx_self, P } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("model_list", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("model_list", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("punyverse._model.model_list", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_model), __pyx_ptype_9punyverse_6_model_WavefrontObject, 1, "model", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_model), __pyx_ptype_9punyverse_6_model_WavefrontObject, 1, "model", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_9punyverse_6_model_2model_list(__pyx_self, __pyx_v_model, __pyx_v_sx, __pyx_v_sy, __pyx_v_sz, __pyx_v_rotation); goto __pyx_L0; __pyx_L1_error:; @@ -9325,7 +9342,7 @@ static PyObject *__pyx_pf_9punyverse_6_model_2model_list(CYTHON_UNUSED PyObject __pyx_t_2.sz = __pyx_v_sz; __pyx_t_2.rotation = __pyx_v_rotation; __pyx_t_1 = __pyx_f_9punyverse_6_model_model_list(__pyx_v_model, 0, &__pyx_t_2); - __pyx_t_3 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -10751,12 +10768,16 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s__assets, __pyx_k__assets, sizeof(__pyx_k__assets), 0, 0, 1, 1}, {&__pyx_n_s__decode, __pyx_k__decode, sizeof(__pyx_k__decode), 0, 0, 1, 1}, {&__pyx_n_s__dirname, __pyx_k__dirname, sizeof(__pyx_k__dirname), 0, 0, 1, 1}, + {&__pyx_n_s__executable, __pyx_k__executable, sizeof(__pyx_k__executable), 0, 0, 1, 1}, + {&__pyx_n_s__frozen, __pyx_k__frozen, sizeof(__pyx_k__frozen), 0, 0, 1, 1}, + {&__pyx_n_s__isabs, __pyx_k__isabs, sizeof(__pyx_k__isabs), 0, 0, 1, 1}, {&__pyx_n_s__iteritems, __pyx_k__iteritems, sizeof(__pyx_k__iteritems), 0, 0, 1, 1}, {&__pyx_n_s__join, __pyx_k__join, sizeof(__pyx_k__join), 0, 0, 1, 1}, {&__pyx_n_s__load_model, __pyx_k__load_model, sizeof(__pyx_k__load_model), 0, 0, 1, 1}, {&__pyx_n_s__load_texture, __pyx_k__load_texture, sizeof(__pyx_k__load_texture), 0, 0, 1, 1}, {&__pyx_n_s__mbcs, __pyx_k__mbcs, sizeof(__pyx_k__mbcs), 0, 0, 1, 1}, {&__pyx_n_s__model, __pyx_k__model, sizeof(__pyx_k__model), 0, 0, 1, 1}, + {&__pyx_n_s__model_base, __pyx_k__model_base, sizeof(__pyx_k__model_base), 0, 0, 1, 1}, {&__pyx_n_s__models, __pyx_k__models, sizeof(__pyx_k__models), 0, 0, 1, 1}, {&__pyx_n_s__name, __pyx_k__name, sizeof(__pyx_k__name), 0, 0, 1, 1}, {&__pyx_n_s__normals, __pyx_k__normals, sizeof(__pyx_k__normals), 0, 0, 1, 1}, @@ -10770,6 +10791,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s__split, __pyx_k__split, sizeof(__pyx_k__split), 0, 0, 1, 1}, {&__pyx_n_s__sx, __pyx_k__sx, sizeof(__pyx_k__sx), 0, 0, 1, 1}, {&__pyx_n_s__sy, __pyx_k__sy, sizeof(__pyx_k__sy), 0, 0, 1, 1}, + {&__pyx_n_s__sys, __pyx_k__sys, sizeof(__pyx_k__sys), 0, 0, 1, 1}, {&__pyx_n_s__sz, __pyx_k__sz, sizeof(__pyx_k__sz), 0, 0, 1, 1}, {&__pyx_n_s__texs, __pyx_k__texs, sizeof(__pyx_k__texs), 0, 0, 1, 1}, {&__pyx_n_s__texture, __pyx_k__texture, sizeof(__pyx_k__texture), 0, 0, 1, 1}, @@ -10836,42 +10858,42 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_k_tuple_5); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_5)); - /* "punyverse\_model.pyx":263 - * path = os.path.join(os.path.dirname(__file__), 'assets', 'models', path) + /* "punyverse\_model.pyx":271 + * path = os.path.join(model_base, path) * if not isinstance(path, unicode): * path = path.decode('mbcs') # <<<<<<<<<<<<<< * return WavefrontObject(path) * */ - __pyx_k_tuple_9 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__mbcs)); if (unlikely(!__pyx_k_tuple_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_9 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__mbcs)); if (unlikely(!__pyx_k_tuple_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_9); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_9)); - /* "punyverse\_model.pyx":280 + /* "punyverse\_model.pyx":288 * glVertex3f(x * sx, y * sy, z * sz) * * cpdef int model_list(WavefrontObject model, float sx=1, float sy=1, float sz=1, object rotation=(0, 0, 0)): # <<<<<<<<<<<<<< * for m, text in model.materials.iteritems(): * if text.texture: */ - __pyx_k_tuple_10 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_k_tuple_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_10 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_k_tuple_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_10); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_10)); - __pyx_k_tuple_11 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_k_tuple_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_11 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_k_tuple_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_11); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_11)); - /* "punyverse\_model.pyx":260 - * fclose(cfile) + /* "punyverse\_model.pyx":267 + * del sys * * def load_model(path): # <<<<<<<<<<<<<< - * path = os.path.join(os.path.dirname(__file__), 'assets', 'models', path) - * if not isinstance(path, unicode): + * if not os.path.isabs(path): + * path = os.path.join(model_base, path) */ - __pyx_k_tuple_13 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__path)); if (unlikely(!__pyx_k_tuple_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_13 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__path)); if (unlikely(!__pyx_k_tuple_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_13); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_13)); - __pyx_k_codeobj_14 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_15, __pyx_n_s__load_model, 260, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_codeobj_14 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_15, __pyx_n_s__load_model, 267, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -10900,6 +10922,9 @@ PyMODINIT_FUNC PyInit__model(void) { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); @@ -11068,13 +11093,136 @@ PyMODINIT_FUNC PyInit__model(void) /* "punyverse\_model.pyx":260 * fclose(cfile) * - * def load_model(path): # <<<<<<<<<<<<<< - * path = os.path.join(os.path.dirname(__file__), 'assets', 'models', path) - * if not isinstance(path, unicode): + * import sys # <<<<<<<<<<<<<< + * if hasattr(sys, 'frozen'): + * model_base = os.path.dirname(sys.executable) */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9punyverse_6_model_1load_model, NULL, __pyx_n_s_16); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__sys), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__load_model, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "punyverse\_model.pyx":261 + * + * import sys + * if hasattr(sys, 'frozen'): # <<<<<<<<<<<<<< + * model_base = os.path.dirname(sys.executable) + * else: + */ + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyObject_HasAttr(__pyx_t_1, ((PyObject *)__pyx_n_s__frozen)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_3) { + + /* "punyverse\_model.pyx":262 + * import sys + * if hasattr(sys, 'frozen'): + * model_base = os.path.dirname(sys.executable) # <<<<<<<<<<<<<< + * else: + * model_base = os.path.join(os.path.dirname(__file__), 'assets', 'models') + */ + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__path); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__dirname); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__executable); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__model_base, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L2; + } + /*else*/ { + + /* "punyverse\_model.pyx":264 + * model_base = os.path.dirname(sys.executable) + * else: + * model_base = os.path.join(os.path.dirname(__file__), 'assets', 'models') # <<<<<<<<<<<<<< + * del sys + * + */ + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__path); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__join); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__path); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__dirname); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s____file__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_n_s__assets)); + PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_n_s__assets)); + __Pyx_GIVEREF(((PyObject *)__pyx_n_s__assets)); + __Pyx_INCREF(((PyObject *)__pyx_n_s__models)); + PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_n_s__models)); + __Pyx_GIVEREF(((PyObject *)__pyx_n_s__models)); + __pyx_t_1 = 0; + __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__model_base, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L2:; + + /* "punyverse\_model.pyx":265 + * else: + * model_base = os.path.join(os.path.dirname(__file__), 'assets', 'models') + * del sys # <<<<<<<<<<<<<< + * + * def load_model(path): + */ + if (__Pyx_DelAttrString(__pyx_m, "sys") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "punyverse\_model.pyx":267 + * del sys + * + * def load_model(path): # <<<<<<<<<<<<<< + * if not os.path.isabs(path): + * path = os.path.join(model_base, path) + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9punyverse_6_model_1load_model, NULL, __pyx_n_s_16); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__load_model, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "punyverse\_model.pyx":1 @@ -11090,6 +11238,8 @@ PyMODINIT_FUNC PyInit__model(void) __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); if (__pyx_m) { __Pyx_AddTraceback("init punyverse._model", __pyx_clineno, __pyx_lineno, __pyx_filename); Py_DECREF(__pyx_m); __pyx_m = 0; diff --git a/punyverse/_model.pyx b/punyverse/_model.pyx index f218400..d02de60 100644 --- a/punyverse/_model.pyx +++ b/punyverse/_model.pyx @@ -257,8 +257,16 @@ cdef class WavefrontObject(object): free(buf) fclose(cfile) +import sys +if hasattr(sys, 'frozen'): + model_base = os.path.dirname(sys.executable) +else: + model_base = os.path.join(os.path.dirname(__file__), 'assets', 'models') +del sys + def load_model(path): - path = os.path.join(os.path.dirname(__file__), 'assets', 'models', path) + if not os.path.isabs(path): + path = os.path.join(model_base, path) if not isinstance(path, unicode): path = path.decode('mbcs') return WavefrontObject(path)