PDA

View Full Version : PyMel: FileDialog2 wierdness


ndeboar
10-19-2010, 02:46 AM
Hey,

This is from the docs:

import pymel.core.system as pm
multipleFilters = "Maya Files (*.ma *.mb);;Maya ASCII (*.ma);;Maya Binary (*.mb);;All Files (*.*)"
pm.fileDialog2(fileFilter=multipleFilters, dialogStyle=2)


Which works fine, but I want an open dialouge, not a save. Acording to the docs, I just need to add an accept mode:

import pymel.core.system as pm
multipleFilters = "Maya Files (*.ma *.mb);;Maya ASCII (*.ma);;Maya Binary (*.mb);;All Files (*.*)"
pm.fileDialog2(fileFilter=multipleFilters, dialogStyle=2,am=0)


Which does nothing, no window appears.

Any idea how to get an open file dialouge in pyMel?

goleafsgo
10-19-2010, 02:19 PM
Is that in pyMel doc's or Maya's docs? There is no acceptMode flag for that command. You need to use the fileMode flag.

e.g.

multipleFilters = "Maya Files (*.ma *.mb);;Maya ASCII (*.ma);;Maya Binary (*.mb);;All Files (*.*)" pm.fileDialog2(fileFilter=multipleFilters, dialogStyle=2, fileMode=1)

ndeboar
10-23-2010, 01:31 AM
Is that in pyMel doc's or Maya's docs?

It's form the pyMel docs, check it out:
http://www.luma-pictures.com/tools/pymel/docs/1.0/generated/functions/pymel.core.system/pymel.core.system.fileDialog2.html?highlight=filedialog2#pymel.core.system.fileDialog2

I'll give your idea shot when im back at work though, cheers.

CGTalk Moderation
10-23-2010, 01:31 AM
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.