Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® MotionBuilder® / Python / Creating and Loading Modules
  RSS 2.0 ATOM  

Creating and Loading Modules
Rate this thread
 
32626
 
Permlink of this thread  
avatar
  • Location: Eugene, Oregon
  • Total Posts: 74
  • Joined: 26 August 2006 02:43 AM

i have been trying to import a group of scripts i made as modules in to a UI script. The issue im running in to is that my UI script cant find the scripts i want to import.

The first time i tried it it loaded the script but was missing some of the procedures, when i restarted mobu it no longer loaded it at all.

Is there an extra step that i am missing in order to use external scripts?

All my scripts are in the same folder, and they run fine individually.



Replies: 0
avatar
  • KxL
  • Posted: 30 July 2009 10:02 PM

Probably you put your modules not in any of ‘Python Search Path’. Please read about it here:
http://docs.python.org/install/#modifying-python-s-search-path

Cheers



Replies: 0
avatar

Ah ha looks like any time i create a new file inside a custom folder the os.getcwd path changes. Which explains why sometimes i could load up my modules.

Also i need to run reload(*module name*) whenever i update one of my scripts because it keeps it in the cache somewhere.



Replies: 0
avatar

question is, is there a way to set that path without having to create and save a new file… i am also looking in to just setting the python path, but so far my user variables arent passing in the motionbuilder..



Replies: 0