From 9b298109126bd77b5ee219d5e456cdbb96cc6bb9 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 22 Aug 2008 06:02:01 +0000 Subject: BGE Python API - GameLogic.getBlendFileList(path='//') to return a list of blend's in the current directory. Needed for creating a level selector that lists all files in the level directory. CMakeFile include path to compile with recent changes. --- source/gameengine/PyDoc/GameLogic.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'source/gameengine/PyDoc/GameLogic.py') diff --git a/source/gameengine/PyDoc/GameLogic.py b/source/gameengine/PyDoc/GameLogic.py index c911ce8ec60..b65bc0f3ce8 100644 --- a/source/gameengine/PyDoc/GameLogic.py +++ b/source/gameengine/PyDoc/GameLogic.py @@ -14,8 +14,7 @@ Documentation for the GameLogic Module. Examples:: # To get a controller: - import GameLogic - co = GameLogic.getCurrentController() + co = GameLogic.getCurrentController() # GameLogic is automatically imported # To get the game object associated with this controller: obj = co.getOwner() @@ -237,3 +236,13 @@ def expandPath(path): @return: The converted string @rtype: string """ + +def getBlendFileList(path = "//"): + """ + Returns a list of blend files in the same directory as the open blend file, or from using the option argument. + + @param path: Optional directory argument, will be expanded (like expandPath) into the full path. + @type path: string + @return: A list of filenames, with no directory prefix + @rtype: list + """ \ No newline at end of file -- cgit v1.2.3