Hi,
It seems to be a simple task but whatever I tried it didn’t work.
So how can I go a folder back?
this does not work:
bge.logic.expandPath('..\\//buildings\\libfile.blend')
Thanks in advance
Hi,
It seems to be a simple task but whatever I tried it didn’t work.
So how can I go a folder back?
this does not work:
bge.logic.expandPath('..\\//buildings\\libfile.blend')
Thanks in advance
This might work (as usual, at work so can’t test it):
import os
cwd = os.getcwd()
backOne = os.path.dirname(cwd)
bge.logic.expandPath(backOne)
### Just for checking! ###
print cwd
print backOne
Check out the os.path module for more details on exploring directory structures
Hope this helps!
Give this a try:
bge.logic.expandPath('//../buildings/libfile.blend')
The “//” to start with denotes a relative path. Also, to keep things more portable and cross-platform use ‘/’ as the directory separator.