[Python] How to set up a default file name in fileDialog2

[Python] How to set up a default file name in fileDialog2

Anonymous
Not applicable
1,816 Views
2 Replies
Message 1 of 3

[Python] How to set up a default file name in fileDialog2

Anonymous
Not applicable

Hello,

 

I would like to know how to set up a default file name in the FileDialog2?

THanks!

0 Likes
Accepted solutions (1)
1,817 Views
2 Replies
Replies (2)
Message 2 of 3

ACOLTEL
Contributor
Contributor
Accepted solution

Hi,

you can use the parameter "startingDirectory" to set the save directory AND the default file name.

Just set the full path of your file.

 

Example (in python):

 

multipleFilters = "Maya Files (*.ma *.mb);;Maya ASCII (*.ma);;Maya Binary (*.mb);;All Files (*.*)"
cmds.fileDialog2(fileFilter=multipleFilters, dialogStyle=2, startingDirectory="e:/toto.ma")

I hope this will help,

Anthony

 

Message 3 of 3

Anonymous
Not applicable

So simple!

Thanks a lot!!

0 Likes