diff options
author | Benoit Bolsee <benoit.bolsee@online.be> | 2008-05-11 22:45:30 +0400 |
---|---|---|
committer | Benoit Bolsee <benoit.bolsee@online.be> | 2008-05-11 22:45:30 +0400 |
commit | 96486b356f7d035a7abc835adbef850c3f314264 (patch) | |
tree | 29a66d4ec0ef0b8188be7deed6ba818114ff7d39 /source/gameengine/PyDoc/GameLogic.py | |
parent | 6da415d406c5d46852aac65a4920fbf4a89d4fa7 (diff) |
fix BGE bug #8668: Behavior of os.getcwd() is not consistent between operating systems
Add a function GameLogic.expandPath() that works like Blender.sys.expandpath() and is also available in the BlenderPlayer.
Fix the game actuator in the BlenderPlayer to work like in Blender:
- try first to load the .blend from the current working directory
- if not found, try to load from the startup .blend or runtime base directory
Diffstat (limited to 'source/gameengine/PyDoc/GameLogic.py')
-rw-r--r-- | source/gameengine/PyDoc/GameLogic.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source/gameengine/PyDoc/GameLogic.py b/source/gameengine/PyDoc/GameLogic.py index fcfd8bfc4eb..965c0522bd7 100644 --- a/source/gameengine/PyDoc/GameLogic.py +++ b/source/gameengine/PyDoc/GameLogic.py @@ -221,3 +221,18 @@ def setPhysicsTicRate(ticrate): @type ticrate: float """ +def expandPath(path): + """ + Converts a blender internal path into a proper file system path. + + Use / as directory separator in path + You can use '//' at the start of the string to define a relative path; + Blender replaces that string by the directory of the startup .blend or runtime file + to make a full path name (doesn't change during the game, even if you load other .blend). + The function also converts the directory separator to the local file system format. + + @param path: The path string to be converted/expanded. + @type path: string + @return: The converted string + @rtype: string + """ |