@@ -154,6 +154,13 @@ fn createUnityExportAction title parentMenu = (
154
154
createUnityActionItem " UnityExport" " Unity" title parentMenu;
155
155
);
156
156
157
+ global unityResetExportOptions;
158
+ fn unityResetExportOptions = (
159
+ unityFbxFilePathAttr= undefined ;
160
+ unityFbxFileNameAttr= undefined ;
161
+ unityAskSetUnits= undefined ;
162
+ );
163
+
157
164
-- Setup UI in existing Import/Export menus if using 3ds Max 2018+
158
165
if (maxVersion())[1 ] >= 20000 then (
159
166
global importMenuName = " File-Import"
@@ -221,6 +228,11 @@ if (maxVersion())[1] >= 20000 then(
221
228
exportMenu.removeItem unityExportAction; \
222
229
)"
223
230
)
231
+
232
+ -- when opening a new scene, reset the export options to make
233
+ -- sure we don't accidentally overwrite anything
234
+ callbacks.addScript #postSceneReset (" unityResetExportOptions()" )
235
+ callbacks.addScript #systemPreNew (" unityResetExportOptions()" )
224
236
)
225
237
else if (maxVersion())[1 ] == 19000 then (
226
238
-- for 3ds Max 2017
@@ -266,6 +278,11 @@ else if (maxVersion())[1] == 19000 then (
266
278
menuMan.unRegisterMenu unityMenu; \
267
279
)"
268
280
)
281
+
282
+ -- when opening a new scene, reset the export options to make
283
+ -- sure we don't accidentally overwrite anything
284
+ callbacks.addScript #postSceneReset (" unityResetExportOptions()" )
285
+ callbacks.addScript #systemPreNew (" unityResetExportOptions()" )
269
286
)
270
287
else (
271
288
print " Error: Unity Integration only supports 3ds Max 2017 or later"
0 commit comments