Tell us what you think of the site.
Hi
Is there a way to automatically import custom made module in motion builder.
Thanks
What you call by module ?
well im in a Python forum so im talking about a python script in which there are defs that i can call to simplify the python commands
ex:
in my script (module) defs.py
from pyfbsdk import FBModelList,FBGetSelectedModels
def selection():
modelList = FBModelList()
FBGetSelectedModels( modelList )
if len(modelList) == 0:
return None
else:
return modelList
if i type in the python console
from defs import *
i can then type selection() and get what is selected
The weird thing about motion builder is that it DOES import my “defs” module at startup but it doesnt keep it in the globals() of the python shell.
any solution to that
well I like to be sure before I answer. Hope it didn’t offend you.
I have check and it looks like that import is hard coded in MB python console.
Cheers
so in other words there is nothing i can do…
Same problem here…
I want to transfer a shelf-like UI tool to Motionbuilder 2012. Every tab is a separate module, but I run in the same problem as Pierre-Marc.
By the way, I got the code from an example by Naiqi Weng last week during an Autodesk class, so there must be a way to make that work.
Well, it seems Mobu 2012 wants us to put our modules here:
C:\Program Files (x86)\Autodesk\MotionBuilder 2012 (32-bit)\bin\config\Python
instead of
C:\Users\jsimard\Documents\MB\2012\config\Python
It works now.
Damned refresh…