Distinguish between import and export in a file translator's option script

Distinguish between import and export in a file translator's option script

jsfunit
Participant Participant
527 Views
1 Reply
Message 1 of 2

Distinguish between import and export in a file translator's option script

jsfunit
Participant
Participant

I am writing a file translator that does both importing and exporting but am I unsure how to distinguish between an import dialog and an export dialog in my option script. Specifically, I want to show one set of options for importing and one set of options for exporting. Is there a way to determine whether the import or export dialog is showing in the options script? I tried logging all the parameters ($parent, $action, $resultCallback, etc.) but they seemed to be the same regardless of which dialog is showing.

 

Also, is there any documentation for the options script function? The only reference I have found so far is Rob the Bloke's article. The API documentation mentions the options script in the description for MFnPlugin::registerFileTranslator but doesn't go into detail. (Logging the arguments, for instance, I noticed there was a "fileselected" action when I select a file or folder in the dialog, but I don't think that's much use to me.)

 

Is the standard way to just show all the import and export options in the same dialog at once? Or do I need to build two separate translator plugins, one for importing and one for exporting?

 

Thank you in advance.

0 Likes
Accepted solutions (1)
528 Views
1 Reply
Reply (1)
Message 2 of 2

jsfunit
Participant
Participant
Accepted solution

The solution I ended up using was to split up my MPxFileTranslator-derived class into two separate classes, one for reading and one for writing. I then called registerFileTranslator twice with a different optionsScriptName for each class. I don't know if that's the optimal solution but it seems to do the job.

0 Likes