I am writing a script to help speed up our export process, but i am at an impass. Basically, you open a file and run this script. The script should export the file to the user defined folder, and save that file with the same name as the mesh name. i.e. if the mesh is called brick01, the exported file would be called brick01.ext.
////////////////////////////////select mesh and pick folder//////////////////////////////////////////////
global string $exportList[];
global proc selectGeos()
{
global string $exportList[];
SelectAllGeometry;
$exportList = `ls -sl`;
for( $exportSelectd in $exportList )
if( size($exportList) > 1 )
{
// report error
error "There is more than ONE mesh in this scene! EXPORT MANUALLY";
print "There is more than ONE mesh in this scene! EXPORT MANUALLY";
}
else {
fileBrowser( "onYes", "ExportSCO", "Graphite Scene/Mesh", 4 );
}
}
//////////////////////////////////////////////////////////////////////////////
proc onYes(string $exDirpath,string $type)
{
global string $exportList[];
print($exDirpath+"\n");
print($exportList);
file -op "" -typ "Graphite Scene/Mesh" -ea $exportList;
}
selectGeos;
this code will export the files i need, but it will not name them correctly. I end up with just ".ext" no filename.
now if i change the last line to this:
file -op "" -typ "Graphite Scene/Mesh" -ea "vomit.";
it will spit out files named Vomit.ext
and lastly, if i remove the "." from that last line, maya crashes
file -op "" -typ "Graphite Scene/Mesh" -ea "vomit";
i cant seem to find any useful information on using the file command. I have gone thru many websites and the provided maya help files, but what they describe is very vague.
Can anyone help me get this script working?
much appreciated!
BUDLoNG