ND I modified it so that you could either enter an export path or use the current workspace by passing a empty string of the export path. Is there some form of method overloading in mel such that I could simply make a batchExportOBJ() and batchExportOBJ(string path)? Is that something I'd have to write in python for method overloading?
Code:
global proc batchExportOBJ(string $exportPath)
{
string $sel[] = `ls -sl`;
if ($exportPath == "")
$exportPath = `workspace -q -fullName`;
for ($obj in $sel)
{
print("Exporting: " + $obj + " to " + $exportPath + "/" + $obj + ".obj\n");
select $obj;
file -force -options "groups=1;ptgroups=1;materials=1;smoothing=1;normals=1" -typ "OBJexport" -pr -es ($exportPath + "/" + $obj + ".obj");
}
select -r $sel;
}
"If I have seen further it is by standing on the shoulders of giants." Sir Isaac Newton, 1675
Last edited by ctbram; 08-05-2012 at 03:05 AM.