PDA

View Full Version : LayoutDialog with arguments


kevinsallee
12-08-2011, 04:59 PM
one quick stupid question: can i pass parameters to a layoutDialog?
i have something like this:
def chooseSavePath(l):
print l
form = cmds.setParent(q=True)
cmds.formLayout(form, e=True, width=500)


which i call with this:
cmds.layoutDialog(ui=chooseSavePath("lalala"))

the line : cmds.formLayout(form, e=True, width=500)

generates the following error:

Error: RuntimeError: file <maya console> line 6: Object 'MayaWindow|MainAttributeEditorLayout|formLayout2|AEmenuBarLayout' not found.

If i get rid of the argument it works... How should i do it in order for it to work?

Azrail
12-08-2011, 06:26 PM
unintentional, sorry...

kevinsallee
12-08-2011, 06:43 PM
i found the solution:
result = cmds.layoutDialog(ui = 'csGetShotChooseSavePathUI('+str(userVersions)+')')

and the function csGetShotChooseSavePathUI can't belong to a class.

:)

CGTalk Moderation
12-08-2011, 06:43 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.