Right now Events are created on controls when they are first attached. If you want to parameterize them you need to get them from the Callbacks dictionary:
with gui.Window('main') as example:
with gui.VerticalForm('form'):
for item in cmds.ls(type='transform'):
b = gui.Button('b_' + item, label = item)
b.command += move_down
b.Callbacks['command'].Data['target'] = item
It would be great to be able to explicitly create a paramterized event:
with gui.Window('main') as example:
with gui.VerticalForm('form'):
for item in cmds.ls(type='transform'):
b = gui.Button('b_' + item, label = item)
b.command = MayaEvent(target = item)
but this won't work with the current setup. How to fix...?
Right now Events are created on controls when they are first attached. If you want to parameterize them you need to get them from the Callbacks dictionary:
It would be great to be able to explicitly create a paramterized event:
but this won't work with the current setup. How to fix...?