Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UPBGE: Add all libraries path for python component import.
UPBGE and BFBGE are setting in sys.path the path to all the libraries (blend files) used. blender bpy python doesn't do that. As python component construction should behave like in UPBGE as they will be used in UPBGE, the path of the current library was added in sys.path. But in case where the python component script comes from an other library the construction failed. To solve this issue we follow exactly UPBGE/BFBGE behaviour about sys.path but for the python component construction. This behaviour consists in iterating over all the libraries contained in main->library, then translate the path and insert it to sys.path. When the python component construction is finished or interrupted, the libraries are again iterated and we look for index item of the library path in sys.path, if these index are valid the items are removed safely. Fix issue #307.
- Loading branch information