@@ -6,6 +6,11 @@ global string $UnityFbxAnimFileNameAttr = "unityFbxAnimFileName";
6
6
global string $UnityFbxNamespaceAttr = "unityFbxNamespace";
7
7
global string $UnityExportSetNameFormat = "^1s_UnityExportSet";
8
8
9
+ /* Enum */
10
+ global int $UnityExportAnim = 0;
11
+ global int $UnityExportModel = 1;
12
+ global int $UnityExportModelAnim = 2;
13
+
9
14
global proc unityRemoveNativeMenuOnLoad(){
10
15
$removeSendToUnityMenu = `optionVar -q "UnityFbxForMaya_removeSendToUnityMenu"`;
11
16
if($removeSendToUnityMenu && `menu -exists "sendToUnityMenu"`){
@@ -411,7 +416,7 @@ proc exportSet(string $unitySet, int $exportAnim){
411
416
}
412
417
}
413
418
414
- proc unityExport(int $exportAnim ){
419
+ proc unityExport(int $exportType ){
415
420
// get the global variables
416
421
global string $UnityExportSets[];
417
422
@@ -423,8 +428,21 @@ proc unityExport(int $exportAnim){
423
428
return;
424
429
}
425
430
431
+ $exportAnim = false;
432
+ $exportAnimOnly = false;
433
+ switch($exportType){
434
+ case 0 /* export animation only */:
435
+ $exportAnim = true;
436
+ $exportAnimOnly = true;
437
+ break;
438
+ case 1 /* export model only */:
439
+ break;
440
+ default: /* export model + animation */
441
+ $exportAnim = true;
442
+ break;
443
+ }
426
444
FBXProperty "Export|IncludeGrp|Animation" -v $exportAnim;
427
- FBXExportAnimationOnly -v $exportAnim ;
445
+ FBXExportAnimationOnly -v $exportAnimOnly ;
428
446
429
447
$origSelection = `ls -sl`;
430
448
if(size($origSelection) <= 0){
@@ -460,7 +478,7 @@ proc unityExport(int $exportAnim){
460
478
461
479
for($unitySet in $setsToExport){
462
480
print ("exporting set: " + $unitySet);
463
- exportSet($unitySet, $exportAnim );
481
+ exportSet($unitySet, $exportAnimOnly );
464
482
}
465
483
466
484
select -cl;
@@ -470,9 +488,16 @@ proc unityExport(int $exportAnim){
470
488
}
471
489
472
490
global proc unityExportAnim(){
473
- unityExport(true);
491
+ global int $UnityExportAnim;
492
+ unityExport($UnityExportAnim);
474
493
}
475
494
476
495
global proc unityExportModel(){
477
- unityExport(false);
496
+ global int $UnityExportModel;
497
+ unityExport($UnityExportModel);
498
+ }
499
+
500
+ global proc unityExportModelAnim(){
501
+ global int $UnityExportModelAnim;
502
+ unityExport($UnityExportModelAnim);
478
503
}
0 commit comments