EightBit
02-15-2011, 02:19 PM
I work by myself, and I spend a lot of time writing python scripts.
Thus far I have only used self contained scripts, but I think I'd like to start modularizing.
Perhaps this is too much to ask, but could someone show me the code to get started?
There are 2 goals I'd like to accomplish - reuse defs() and reuse UI panels.
defs()
Say I want to be able call a def() that is sitting in a external script.
So in myFunctions.py, I have
def addRotations():
my code...
How do I import addRotations into jointFixer.py?
UI tools:
Say I have a UI panel that I use frequently, so I want to store it in an external script:
In myTools.py I have:
rotationTools = cmds.columnLayout(adj=1, cat = ('left', 1), cal=('left'))
misc layouts elements and controls...
How do import the rotationTools panel into the UI section of jointFixer.py?
Thanks
Thus far I have only used self contained scripts, but I think I'd like to start modularizing.
Perhaps this is too much to ask, but could someone show me the code to get started?
There are 2 goals I'd like to accomplish - reuse defs() and reuse UI panels.
defs()
Say I want to be able call a def() that is sitting in a external script.
So in myFunctions.py, I have
def addRotations():
my code...
How do I import addRotations into jointFixer.py?
UI tools:
Say I have a UI panel that I use frequently, so I want to store it in an external script:
In myTools.py I have:
rotationTools = cmds.columnLayout(adj=1, cat = ('left', 1), cal=('left'))
misc layouts elements and controls...
How do import the rotationTools panel into the UI section of jointFixer.py?
Thanks
