-
Notifications
You must be signed in to change notification settings - Fork 1
/
mightyFBX_export.mel
70 lines (49 loc) · 2.27 KB
/
mightyFBX_export.mel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// myghtyFBX_export.mel
// v 1 This version.
// v1.1 Changed export names just so we know which file we started from
//// How to Use /////////////
// copy the mightyFBX_export.mel file into your script folder
// rehash;
// Call the script by the procedure name
// mighty_FBX_exporter();
// You will need to modify the path names in every line preceeded by the // filepath comment
// TODO
// create publish folder on the fly
// use relative path instead of hard path
// add bind pose fix { dagPose -s -sl -bp; }
proc mighty_FBX_exporter()
{
// save file
file -s;
// save preClean file
$sceneName = `file -q -ns`;
print $sceneName;
file -rename ($sceneName + "_export_01_preClean.ma"); file -save -type "mayaAscii";
print "\n//////////////////// 1. scene renamed to *_export_01_preClean /////////////////\n";
// regroup and select the necessary nodes for the fbx export
select -r global_C0_0_jnt ;
select -add tamadodge_geo ;
group -n FBX_export;
select -hierarchy "FBX_export";
// fbx export
$postName = ($sceneName + "_export_01_preClean.fbx");
// filepath
file -force -options "v=0;" -typ "FBX export" -pr -es $postName ;
print "//////////////////// 2. preClean exported /////////////////\n";
// Open new file and import the Preclean fbx
file -new -force;
file -import -type "FBX" -ignoreVersion -mergeNamespacesOnClash true -rpr ":" -options "fbx" -pr -importFrameRate true -importTimeRange "override" "Z:/3d/Rigs/Tamadodge/FBX/FBX_export_01_preClean.fbx";
print "//////////////////// 3. FBX reimported for final cleanup /////////////////\n";
// Clean up and delete the not required nodes
delete "rig";
/////// Final Post clean export ///////
// save postClean file
file -rename ($sceneName + "_export_02_postClean.ma"); file -save -type "mayaAscii";
print "\n//////////////////// 1. scene renamed to *_export_01_preClean /////////////////\n";
select -hierarchy "FBX_export";
// filepath
$exportFBXName = ($sceneName + "_export_02_postClean.fbx");
file -force -options "v=0;" -typ "FBX export" -pr -es ("FBX/" + $exportFBXName );
print "//////////////////// Export file generated /////////////////\n";
}
mighty_FBX_exporter();