File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed
Assets/Integrations/Autodesk/max/scripts Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -36,15 +36,9 @@ macroScript UnityImport category:"Unity"
36
36
-- Get all objects in scene before importAction
37
37
origObjects = objects as array
38
38
callbacks.addScript #postImport (" afterImport()" ) id: #unityPlugin
39
-
40
- -- set the system units to centimeters
41
- local origUnits = units.SystemType
42
- units.SystemType = #Centimeters
43
39
44
40
importFile fbxFileName using: FBXIMP
45
41
46
- units.SystemType = origUnits
47
-
48
42
unityFbxFilePathAttr = getFilenamePath fbxFileName
49
43
unityFbxFileNameAttr = filenameFromPath fbxFileName
50
44
@@ -71,12 +65,25 @@ macroScript UnityImport category:"Unity"
71
65
)
72
66
macroScript UnityExport category: " Unity"
73
67
(
68
+ fn unitToScaleFactor unit = (
69
+ case unit of (
70
+ #Inches : 2.54
71
+ #Feet : 30.48
72
+ #Miles : 160934
73
+ #Millimeters : 0.1
74
+ #Kilometers : 100000
75
+ #Meters : 100
76
+ default: 1
77
+ )
78
+ );
79
+
74
80
fn loadUnityFbxExportSettings = (
75
81
fbxExportSettings = getINISetting (GetMAXIniFile()) " Unity" " UnityFbxExportSettings"
76
82
if fbxExportSettings != undefined and doesFileExist fbxExportSettings then (
77
83
filein fbxExportSettings
78
84
)
79
- )
85
+ FbxExporterSetParam " ScaleFactor" (unitToScaleFactor units.SystemType)
86
+ );
80
87
81
88
-- Make sure the FbxExporter plugin is loaded
82
89
pluginManager.loadClass FbxExporter
You can’t perform that action at this time.
0 commit comments