@@ -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"`){
@@ -413,7 +418,7 @@ proc exportSet(string $unitySet, int $exportAnim){
413
418
}
414
419
}
415
420
416
- proc unityExport(int $exportAnim ){
421
+ proc unityExport(int $exportType ){
417
422
// get the global variables
418
423
global string $UnityExportSets[];
419
424
@@ -425,8 +430,21 @@ proc unityExport(int $exportAnim){
425
430
return;
426
431
}
427
432
433
+ $exportAnim = false;
434
+ $exportAnimOnly = false;
435
+ switch($exportType){
436
+ case 0 /* export animation only */:
437
+ $exportAnim = true;
438
+ $exportAnimOnly = true;
439
+ break;
440
+ case 1 /* export model only */:
441
+ break;
442
+ default: /* export model + animation */
443
+ $exportAnim = true;
444
+ break;
445
+ }
428
446
FBXProperty "Export|IncludeGrp|Animation" -v $exportAnim;
429
- FBXExportAnimationOnly -v $exportAnim ;
447
+ FBXExportAnimationOnly -v $exportAnimOnly ;
430
448
431
449
$origSelection = `ls -sl`;
432
450
if(size($origSelection) <= 0){
@@ -462,7 +480,7 @@ proc unityExport(int $exportAnim){
462
480
463
481
for($unitySet in $setsToExport){
464
482
print ("exporting set: " + $unitySet);
465
- exportSet($unitySet, $exportAnim );
483
+ exportSet($unitySet, $exportAnimOnly );
466
484
}
467
485
468
486
select -cl;
@@ -472,9 +490,16 @@ proc unityExport(int $exportAnim){
472
490
}
473
491
474
492
global proc unityExportAnim(){
475
- unityExport(true);
493
+ global int $UnityExportAnim;
494
+ unityExport($UnityExportAnim);
476
495
}
477
496
478
497
global proc unityExportModel(){
479
- unityExport(false);
498
+ global int $UnityExportModel;
499
+ unityExport($UnityExportModel);
500
+ }
501
+
502
+ global proc unityExportModelAnim(){
503
+ global int $UnityExportModelAnim;
504
+ unityExport($UnityExportModelAnim);
480
505
}
0 commit comments