diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-04-30 12:01:31 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-04-30 12:01:31 +0400 |
commit | b5b24ee521866637871e7555d4294c0936a0664d (patch) | |
tree | 37634051fe6b01bea895adad4899f75db47187b6 /source/gameengine/Converter/BL_MeshDeformer.cpp | |
parent | 939290b59c52bdd84b9f20083d4dd76ada293ee8 (diff) |
BGE Python sys.path for the blenderplayer and blender
sys.path is the search path for python modules. This is useful so people making games can put all their scripts in a folder and be sure they will always load into the BGE.
for each blend file a scripts directory is added to the path
/home/me/foo.blend
will look for modules in...
/home/me/scripts/*.py
It could also default to look for modules in the same directory as the blend file but I think this is messy.
Added a note in the tooltip about //scripts so its not such a hidden feature.
This works by storing the original sys.path, then adding the paths for the blendfile and all its libs,
when a new blendfile is loaded, the original sys.path is restored before adding the blendfiles paths again so the sys.path wont get junk in it.
One problem with this - when using linked libs the module names must be unique else it will load the wrong module for one of the controllers.
also fixed 2 bugs
- sys.path in the blenderplayer was growing by 1 for every file load in blenderplayer
- the relative path (gp_GamePythonPath), wasnt being set when loading files in the blenderlayer (as I wrongly said in the last commit).
Diffstat (limited to 'source/gameengine/Converter/BL_MeshDeformer.cpp')
0 files changed, 0 insertions, 0 deletions