Sebastian,
Import is a runtime command as you can see by typing
whatIs Import;
It executes the projectViewer command as you can find out by typing
runTimeCommand -q -command Import;
You can look into the projectViewer script that resides here:
whatIs projectViewer;
The Import portion of this script can be configured only by setting the defaultFileImportType option variable
and by setting the working directory.
But the projectViewer script configures the fileDialog2 itself.
So the most flexible approach is to configure fileDialog2, too, like projectViewer does but with your own values.
After calling the dialog you have to run the same lines of code like in projectViewer.mel.
In the end your custom import script might look like this:
preCheckColorManagement();
string $myImportFolder = "/my/predefined/import/folder";
string $file[] = `fileDialog2 -returnFilter 1 -caption "Import" -fileMode 1 -okCaption "Import"
-optionsUICreate "fileOperationsOptionsUISetup Import"
-optionsUIInit "fileOperationsOptionsUIInitValues Import"
-selectionChanged "fileOperationsSelectionChangedCallback Import"
-optionsUICommit2 "fileOperationsOptionsUICallback Import"
-fileTypeChanged "setCurrentFileTypeOption Import"
-fileFilter "Maya Scenes (*.ma *.mb)"
-selectFileFilter "Maya Scenes"
-startingDirectory $myImportFolder
-optionsUICancel "fileOptionsCancel"`;
int $len = size($file);
if( $len > 0 && $file[0] != "" )
{
string $path = fromNativePath($file[0]);
string $type = filterDescriptionToFileType($file[$len-1]);
eval ("performFileAction \"" + $path + "\" Import \"" + $type + "\"");
}
checkForUnknownNodes();
checkColorManagementMissingColorSpaces();All best wishes
Clemens