File tree Expand file tree Collapse file tree 1 file changed +25
-2
lines changed
Assets/Integrations/Autodesk/max/scripts Expand file tree Collapse file tree 1 file changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -30,14 +30,37 @@ macroScript UnityImport category:"Unity" tooltip:"Import an FBX file from a Unit
30
30
)
31
31
);
32
32
33
+ -- allow multiple files to be selected for import
34
+ fn GetMultiOpenFilenames caption: " Open" filename: " " types: " All Files (*.*)|*.*" default: 1 =
35
+ (
36
+ local dialog = DotNetObject " System.Windows.Forms.OpenFileDialog"
37
+ dialog.multiSelect = true
38
+ dialog.title = caption
39
+
40
+ if doesFileExist filename then
41
+ dialog.initialDirectory = filename
42
+
43
+ dialog.filter = types
44
+ dialog.filterIndex = default
45
+
46
+ local result = dialog.ShowDialog()
47
+ if (result.Equals result.OK) then
48
+ dialog.filenames
49
+ else
50
+ undefined
51
+ )
52
+
53
+
33
54
-- Make sure the FbxImporter plugin is loaded
34
55
pluginManager.loadClass FbxImporter
35
56
36
57
loadUnityFbxImportSettings()
37
58
38
59
unityProjectPath = getINISetting (GetMAXIniFile()) " Unity" " UnityProject"
39
- fbxFileName = getOpenFileName caption: " Import FBX from Unity" filename: (unityProjectPath + " /Assets/" ) types: " FBX (*.fbx)|*.fbx|"
40
- if fbxFileName != undefined then
60
+ local unityAssetsPath = (unityProjectPath + " /Assets/" )
61
+ unityAssetsPath = substituteString unityAssetsPath " /" " \\ " -- dot net class requires backspaces
62
+ local fbxFileNames = getMultiOpenFilenames caption: " Import FBX from Unity" filename: unityAssetsPath types: " FBX (*.fbx)|*.fbx"
63
+ if fbxFileNames != undefined then
41
64
(
42
65
-- ask to set units to cm if not already
43
66
if (unityAskSetUnits == undefined or not unityAskSetUnits) and units.SystemType != #Centimeters then (
You can’t perform that action at this time.
0 commit comments