trying a slightly different way.
by specifically calling the buttons individually.
I can get 2 buttons to work well, but not 3.
attached is the latest code
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
import maya.cmds as mc
from functools import partial
def launchCopyAnimationUI(*args):
WINDOW = 'CopyAnimation'
# Check to see if the WINDOW exists, create WINDOW
if mc.window(WINDOW, query=True, exists=True): mc.deleteUI(WINDOW)
mc.window(WINDOW, title='CopyAnimation', width=200, sizeable=True)
# Menu Bar
menuBarLayout = mc.menuBarLayout()
helpMenu = mc.menu( label='help', tearOff=False )
#howToHelp = mc.menuItem( label='How to use', command=loadHelp)
masterForm = mc.formLayout()
separatorTop = mc.separator(height=5, style='in')
'''
This is the problem element
how to get it to attach to both sides of the form?
how to get even spacing between all the buttons?
how to get this to work with an adjustable window?
'''
radioCollection = mc.radioCollection()
button1 = mc.radioButton( label='One' )
button2 = mc.radioButton( label='Two' )
button3= mc.radioButton( label='Three' )
#button4 = mc.radioButton( label='Four' )
separatorBottom = mc.separator(height=5, style='in')
# Position the controls
mc.formLayout(masterForm, edit=True, # attach to the form
attachForm=[(separatorTop, 'top', 3),
(separatorTop, 'right', 3),
(separatorTop, 'left', 3),
#(button1, 'right',3),
(button1, 'left',3),
#(button2, 'right',3),
(button3, 'right',3),
(separatorBottom, 'right', 3),
(separatorBottom, 'left', 3),
(separatorBottom, 'bottom', 3),
],
# Attach controls position
attachPosition=[#(button1, 'right',2,50),
(button1, 'left',2,50),
#(button2, 'right',2,50),
(button3, 'right',2,50),
#(button2, 'left',2,50),
],
# Attach Controls
attachControl=[(button1, 'top', 3, separatorTop),
(button2, 'top', 3, separatorTop),
(button3, 'top', 3, separatorTop),
(button2, 'right', 3, button1),
(button2, 'left', 3, button3),
(button3, 'right', 3, button2),
(button1, 'bottom', 3, separatorBottom),
(button2, 'bottom', 3, separatorBottom),
(button3, 'bottom', 3, separatorBottom),
])
mc.showWindow(WINDOW)
launchCopyAnimationUI()