Skip to content

Commit 24edafa

Browse files
committed
add dialog warning about using units other than cm
popup dialog whenever we are in a new file, or for as long as the user selects "yes" to converting to centimeters.
1 parent 03f8b2f commit 24edafa

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Assets/Integrations/Autodesk/max/scripts/UnityFbxForMaxPlugin.ms

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ macroScript UnityImport category:"Unity"
55

66
persistent global unityFbxFilePathAttr
77
persistent global unityFbxFileNameAttr
8+
persistent global unityAskSetUnits
89

910
global afterImport
1011
fn afterImport = (
@@ -29,6 +30,20 @@ macroScript UnityImport category:"Unity"
2930
fbxFileName = getOpenFileName caption:"Import FBX from Unity" filename:(unityProjectPath + "/Assets/") types:"FBX (*.fbx)|*.fbx|"
3031
if fbxFileName != undefined then
3132
(
33+
-- ask to set units to cm if not already
34+
if (unityAskSetUnits == undefined or !unityAskSetUnits) and units.SystemType != #Centimeters then (
35+
result = false
36+
(
37+
result = queryBox "Using system units other than centimeters is not recommended and may result in unexpected scaling on export.\nWould you like to set system units to centimeters?" title:"Warning"
38+
)
39+
if result then (
40+
units.SystemType = #Centimeters
41+
)
42+
else (
43+
unityAskSetUnits = true
44+
)
45+
)
46+
3247
-- reset persistent values, in case import fails
3348
unityFbxFilePathAttr = ""
3449
unityFbxFileNameAttr = ""

0 commit comments

Comments
 (0)