Game Logic: expandPath

expandPath(include)
  • Expands the path to include the specified directory.

include:

  • Type:  string
Note:
  • By default, the Blender Game Engine will only look for files in the directory of the blend that is running.
     
  • "//" = the directory of the blend that is currently running
     
  • Use / as directory separator in path.
     
  • You can include subdirectories in the path by using ("//" + "subdir_name\\")
Sample Code

################## expand the path to include more directories
  

# import bge
import bge

# expand path to include subdirectory named "Levels"
bge.logic.expandPath("//" + "Levels\\")