Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

How do I set the file type for a string attribute?

How do I set the file type for a string attribute?

Anonymous
Not applicable
774 Views
2 Replies
Message 1 of 3

How do I set the file type for a string attribute?

Anonymous
Not applicable

I have a custom node with a string attribute which I have set to be treated as a filename by calling MFnAttribute::setUsedAsFilename(true).

 

When the Attribute Editor displays the attribute it provides a folder icon that brings up a file dialog. However, the 'Files of type' field at the bottom of the dialog is always set to 'Image Files'. My attribute is not for image files so I would prefer to have the browser come up with that field set to 'All Files'.

 

Does anyone know of a way to do that?

0 Likes
775 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable

I am facing this exact issue. I see nobody answered this? is this not possible to do in the Maya API?

0 Likes
Message 3 of 3

Abdulla-Qaladzay
Collaborator
Collaborator

Hi @Anonymous  @Anonymous 

if you want to filter file formats in fileDialog the flag is  -fileFilter 

example :

string $ipUi_[] = `fileDialog2 -fileFilter "Maya Binary (*.mb);;Maya ASCII (*.ma);;All Files (*.*);;customFiletype (*.custom)"`;

 

resault:

customFormatFilter.png

0 Likes