File tree Expand file tree Collapse file tree 4 files changed +34
-2
lines changed
Integrations/Autodesk/max/scripts Expand file tree Collapse file tree 4 files changed +34
-2
lines changed Original file line number Diff line number Diff line change @@ -577,11 +577,13 @@ public class MaxIntegration : DCCIntegration
577
577
private const string ConfigureMaxScript = MaxScriptsPath + "configureUnityFbxForMax.ms" ;
578
578
579
579
private const string ExportSettingsFile = MaxScriptsPath + "unityFbxExportSettings.ms" ;
580
+ private const string ImportSettingsFile = MaxScriptsPath + "unityFbxImportSettings.ms" ;
580
581
581
582
private const string PluginSourceTag = "UnityPluginScript_Source" ;
582
583
private const string PluginNameTag = "UnityPluginScript_Name" ;
583
584
private const string ProjectTag = "UnityProject" ;
584
585
private const string ExportSettingsTag = "UnityFbxExportSettings" ;
586
+ private const string ImportSettingsTag = "UnityFbxImportSettings" ;
585
587
586
588
public override string IntegrationZipPath { get { return "FbxExporters/UnityFbxForMax.zip" ; } }
587
589
@@ -600,7 +602,8 @@ private static string GetInstallScript(){
600
602
{ PluginSourceTag , GetAbsPath ( PluginPath ) } ,
601
603
{ PluginNameTag , PluginName } ,
602
604
{ ProjectTag , GetProjectPath ( ) } ,
603
- { ExportSettingsTag , GetAbsPath ( ExportSettingsFile ) }
605
+ { ExportSettingsTag , GetAbsPath ( ExportSettingsFile ) } ,
606
+ { ImportSettingsTag , GetAbsPath ( ImportSettingsFile ) }
604
607
} ;
605
608
606
609
var installScript = "" ;
Original file line number Diff line number Diff line change @@ -22,10 +22,19 @@ macroScript UnityImport category:"Unity" tooltip:"Import an FBX file from a Unit
22
22
)
23
23
selectionSets[" UnityFbxExportSet" ] = unityFbxExportSet
24
24
);
25
+
26
+ fn loadUnityFbxImportSettings = (
27
+ fbxImportSettings = getINISetting (GetMAXIniFile()) " Unity" " UnityFbxImportSettings"
28
+ if fbxImportSettings != undefined and doesFileExist fbxImportSettings then (
29
+ filein fbxImportSettings
30
+ )
31
+ );
25
32
26
33
-- Make sure the FbxImporter plugin is loaded
27
34
pluginManager.loadClass FbxImporter
28
35
36
+ loadUnityFbxImportSettings()
37
+
29
38
unityProjectPath = getINISetting (GetMAXIniFile()) " Unity" " UnityProject"
30
39
fbxFileName = getOpenFileName caption: " Import FBX from Unity" filename: (unityProjectPath + " /Assets/" ) types: " FBX (*.fbx)|*.fbx|"
31
40
if fbxFileName != undefined then
@@ -56,7 +65,7 @@ macroScript UnityImport category:"Unity" tooltip:"Import an FBX file from a Unit
56
65
origObjects = objects as array
57
66
callbacks.addScript #postImport (" afterImport()" ) id: #unityPlugin
58
67
59
- importFile fbxFileName using: FBXIMP
68
+ importFile fbxFileName #noPrompt using: FBXIMP
60
69
61
70
unityFbxFilePathAttr = getFilenamePath fbxFileName
62
71
unityFbxFileNameAttr = filenameFromPath fbxFileName
Original file line number Diff line number Diff line change @@ -6,5 +6,6 @@ maxIniFile = (GetMAXIniFile())
6
6
unityCategory = " Unity"
7
7
setINISetting maxIniFile unityCategory " UnityProject" UnityProject
8
8
setINISetting maxIniFile unityCategory " UnityFbxExportSettings" UnityFbxExportSettings
9
+ setINISetting maxIniFile unityCategory " UnityFbxImportSettings" UnityFbxImportSettings
9
10
10
11
quitMax()
Original file line number Diff line number Diff line change
1
+ FbxImporterSetParam " ResetImport"
2
+
3
+ FbxImporterSetParam " Mode" #merge -- update animation
4
+
5
+ -- Geometry
6
+ FbxImporterSetParam " SmoothingGroups" true
7
+ FbxImporterSetParam " Shape" true
8
+ FbxImporterSetParam " Skin" true
9
+
10
+ -- Animation
11
+ FbxImporterSetParam " Animation" true
12
+ FbxImporterSetParam " ImportBoneAsDummy" true
13
+ FbxImporterSetParam " KeepFrameRate" true
14
+
15
+ FbxImporterSetParam " Cameras" true
16
+ FbxImporterSetParam " Lights" true
17
+
18
+ -- Axis Conversion
19
+ FbxImporterSetParam " UpAxis" " Y"
You can’t perform that action at this time.
0 commit comments