Skip to content

Instantly share code, notes, and snippets.

@ongamex
Created March 24, 2021 14:50
Show Gist options
  • Save ongamex/291f84017512ef01fda33e46bbd409c3 to your computer and use it in GitHub Desktop.
Save ongamex/291f84017512ef01fda33e46bbd409c3 to your computer and use it in GitHub Desktop.
// <?php PHP for syntax, but the language is actually MEL
proc exportSceneToFBX()
{
string $sceneFilename = `file -q -sn`;
string $buffer[];
tokenize $sceneFilename "." $buffer;
string $outFilename = $buffer[0];
for($i = 1; $i < (size($buffer) - 1); $i++) {
$outFilename = $outFilename + "." + $buffer[$i];
}
$outFilename = $outFilename + ".fbx";
// For settings look here. https://knowledge.autodesk.com/support/maya/learn-explore/caas/CloudHelp/cloudhelp/2016/ENU/Maya/files/GUID-6CCE943A-2ED4-4CEE-96D4-9CB19C28F4E0-htm.html
FBXExportTangents -v true;
FBXExportEmbeddedTextures -v false;
FBXExport -f ($outFilename);
}
exportSceneToFBX();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment