Skip to content

Commit 53581a0

Browse files
committed
UNI-42752 code review fixes 3
- move "_UnityExportSet" into global variable
1 parent bbb4914 commit 53581a0

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
-- MacroScripts that will perform actions
22
macroScript UnityImport category:"Unity" tooltip:"Import an FBX file from a Unity project and auto-configure for exporting"
33
(
4+
rootDummyName = "UnityFbxExportSets"
5+
46
origObjects = #()
57
currSetName = ""
6-
rootDummyName = "UnityFbxExportSets"
78
unityFbxFilePathAttr = ""
89
unityFbxFileNameAttr = ""
910
unityAnimFileNameAttr = ""
@@ -91,7 +92,7 @@ macroScript UnityImport category:"Unity" tooltip:"Import an FBX file from a Unit
9192
unityFbxFileName = (filterString unityFbxFileName "@")[1]
9293
)
9394

94-
currSetName = unityFbxFileName + "_UnityExportSet"
95+
currSetName = unityFbxFileName + unityExportSetPostFix
9596

9697
callbacks.addScript #postImport ("afterImport()") id:#unityPlugin
9798

@@ -113,6 +114,8 @@ macroScript UnityExportModel category:"Unity" tooltip:"Export models to Unity"
113114
UnityExportHelpers.exportSelection modelOnly:true
114115
)
115116

117+
global unityExportSetPostFix = "_UnityExportSet"
118+
116119
struct UnityImportHelpers (
117120
fn loadUnityFbxImportSettings = (
118121
fbxImportSettings = getINISetting (GetMAXIniFile()) "Unity" "UnityFbxImportSettings"
@@ -226,8 +229,9 @@ struct UnityExportHelpers (
226229

227230
fn getUnityExportSets = (
228231
local unityExportSets = #()
232+
local exportSetPattern = ("*" + unityExportSetPostFix)
229233
for expSet in selectionSets do (
230-
if(matchPattern expSet.name pattern:"*_UnityExportSet" and
234+
if(matchPattern expSet.name pattern:exportSetPattern and
231235
(not isdeleted expSet) and (expSet != undefined) and
232236
getNodeByName (expSet.name) != undefined) do
233237
(

0 commit comments

Comments
 (0)