I'm trying to launch a export selection dialog box, but I'd like to grab my selected objects name and store that in a variable and then have that auto pasted when the dialog appears. I can't find this in the docs, is it possible. This is what I have so far, all the options are set, but I also want to set a name so the user doesn't have to type it.
Spoke too soon, that hard codes the file directory as well as the name, I want the dialogue to remember the last export location and just use my provided name. Any help with that?
Its probably easier to store the last export directory (either as a custom attribute on the mesh or in a variable. Depends how you want to handle different maya sessions) and then use that to generate the directory path.
EDIT: You can query it with $currentDir = `optionVar -q $gDirRetainingOptionVar`; That will get you the last export location.
// Result: C:/Users/abraz/Desktop/DeleteMe //
Can reference C:\Program Files\Autodesk\Maya2015\scripts\others\setWorkingDirectory.mel.
Might want to check it exists first before quering it
Replies
FBXProperty Export|IncludeGrp|Geometry|SmoothingGroups -v false;
FBXProperty Export|IncludeGrp|Geometry|expHardEdges -v false;
FBXProperty Export|IncludeGrp|Geometry|TangentsandBinormals -v false;
FBXProperty Export|IncludeGrp|Geometry|SmoothMesh -v false;
FBXProperty Export|IncludeGrp|Geometry|SelectionSet -v false;
FBXProperty Export|IncludeGrp|Geometry|BlindData -v false;
FBXProperty Export|IncludeGrp|Geometry|AnimationOnly -v false;
FBXProperty Export|IncludeGrp|Geometry|Instances -v false;
FBXProperty Export|IncludeGrp|Geometry|ContainerObjects -v false;
FBXProperty Export|IncludeGrp|Geometry|Triangulate -v false;
FBXProperty Export|AdvOptGrp|Fbx|AsciiFbx -v "Binary";
FBXExport -f test $tbSaveLocation -s;
EDIT: You can query it with $currentDir = `optionVar -q $gDirRetainingOptionVar`; That will get you the last export location.
// Result: C:/Users/abraz/Desktop/DeleteMe //
Can reference C:\Program Files\Autodesk\Maya2015\scripts\others\setWorkingDirectory.mel.
Might want to check it exists first before quering it
if (`optionVar -exists $gDirRetainingOptionVar`) {
$currentDir = `optionVar -q $gDirRetainingOptionVar`;
//Do Stuff
}