|
Hi all,
I posted this a while ago but it posted it rather vaguely so i figured i put a slightly more descriptive question:
I am having issues trying to load some of our proprietary modules inside motion Builder. I have found several places that work but none consistantly.
There is a python startup folder path that i have set, that doesnt seem to do anything, and there is a USER.Python.txt that saves the last opened filepath inside the python
editor.
So far only editing the txt file will allow me access to the modules, the downside to doing that is as soon as i open a new file that is outside that path it changes the “Last
Path” string inside the txt file. I would think that the path inside preferences should be the correct way to do this but i have been unlucky so far.
Is there something i am missing?
|
|
|
|
What I have done is to create a file in the PythonStartup folder called “userStartup.py”. This file loads all the external modules. To do so, place the following
lines in it:
import sys
sys.path.append( "c:/Path/to/your/external/module" )
This will add the module to your PYTHONPATH, so assuming you have a valid module there, it will find it. If you need to run a def from this module at startup, this file is
the place to do that as well.
You could alternatively add a “PYTHONPATH” environment variable with a value of “c:\path\to\your\external\module;” to your machine Start, Settings, Control Panel, System,
Advanced Tab, Environment Variables
-csa
|
|
|
|
Awesome! that is just what i needed to know!
Thanks!
|
|
|