I am having a serious (but no doubt novice type) problem with loading a model (.obj) file using a full directory path.
this works ( FROM THE PROGRAMS DIRECTORY but this is not what I want)
self.environ = self.loader.loadModel(‘\ObjFiles\test.obj’
this doesn’t
self.environ = self.loader.loadModel(
‘C:\Users\richard\Documents\Python\Panda\FirstPersonCamera\ObjFiles\test.obj’)
neither does this
(I thought the IDE splitting the line might be at fault) so …
oFile = ‘C:\Users\richard\Documents\Python\Panda\FirstPersonCamera\ObjFiles\test.obj’
…
self.environ = self.loader.loadModel(oFile)
same error message
errormsg:
OSError: Could not load model file(s): [‘C:\Users\richard\Documents\Python\Panda\FirstPersonCamera\ObjFiles\test.obj’]
oFile = ‘C:\Users\richard\Documents\Python\Panda\FirstPersonCamera\ObjFiles\test.obj’
----------------------------------------------------------------------------------------------------------------
Having pulled my hair out trying different combinations of // \ '\c 'C:\ etc I tried a simple file read (in same directory…
oFile = ‘C:\Users\richard\Documents\Python\Panda\FirstPersonCamera\ObjFiles\test.obj’
def main():
f = open(oFile, “r”)
print(f.read())
if name == ‘main’:
main()
works fine … HELP HELP PLEASE…
[Apologies if this is not in the forum’s expected style but have no idea how to drop bits of code etc…
thanks for any help - Richard