- Code: Select all
string $currentSceneName = `file -q -sn -shn`;
file -force -options "(groups=1;ptgroups=1;materials=1;smoothing=0;normals=1"
-typ "OBJexport" -pr
-es (("/Volumes/HOME_RAID/temps/GoO/" + $currentSceneName) + (".obj"));
Change the path "/Volumes/HOME_RAID/temps/GoO/" to wherever you want the OBJ files stored and you've got a MEL script that exports all selected geometry to the directory with your scene name, with materials.
Windows users, use Unix style path settings (/, not \ for slashes)