Announcements

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

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

Anonymous

[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
Reply
Accepted solutions (1)
1,601 Views
2 Replies
Replies (2)

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

 

Anonymous
Not applicable

So simple!

Thanks a lot!!

0 Likes