There's error in OBJFILELOADER.py file from the link - https://www.pygame.org/wiki/OBJFileLoader . I think there's python2 to python3 version error, however I tried changing the raise ValueError thing and used obj as obj=(filename)
But still there's lots of errors.
I took the .obj file from blender, I don't think that's the issue. Can anyone tell me the exact objfileloader for Python3
Error -
Traceback (most recent call last):
File "/home/warted/anaconda3/lib/python3.6/site-packages/OpenGL/latebind.py", line 41, in __call__
return self._finalCall( *args, **named )
TypeError: 'NoneType' object is not callable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "run.py", line 28, in <module>
obj = OBJ('robotbase.obj')
File "/home/warted/COMMAND CENTRE/SEDS/GUI/Simulate/objloader.py", line 97, in __init__
glNormal3fv(self.normals[normals[i] - 1])
File "/home/warted/anaconda3/lib/python3.6/site-packages/OpenGL/latebind.py", line 45, in __call__
return self._finalCall( *args, **named )
File "/home/warted/anaconda3/lib/python3.6/site-packages/OpenGL/wrapper.py", line 677, in wrapperCall
pyArgs = tuple( calculate_pyArgs( args ))
File "/home/warted/anaconda3/lib/python3.6/site-packages/OpenGL/wrapper.py", line 438, in calculate_pyArgs
yield converter(args[index], self, args)
File "/home/warted/anaconda3/lib/python3.6/site-packages/OpenGL/arrays/arrayhelpers.py", line 112, in asArraySize
handler = typ.getHandler( incoming )
File "/home/warted/anaconda3/lib/python3.6/site-packages/OpenGL/arrays/arraydatatype.py", line 53, in __call__
typ.__module__, type.__name__, repr(value)[:50]
TypeError: ('No array-type handler for type builtins.type (value: <map object at 0x7f6bf0f8f4a8>) registered', <function asArrayTypeSize.<locals>.asArraySize at 0x7f6c01d6a620>)
You just seem to assign the filename to the variable
obj
.Instead you have to create an instance of the
OBJ
class and pass the file/path name:To port the script to Python 3 check out the linked answer.
Try this updated version: