Skip to content

Commit fd55afd

Browse files
committed
add namespace as set attribute
1 parent c35b273 commit fd55afd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Assets/Integrations/Autodesk/maya/scripts/unityCommands.mel

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ global string $UnityFbxFilePathAttr = "unityFbxModelFilePath";
33
global string $UnityFbxFileNameAttr = "unityFbxModelFileName";
44
global string $UnityFbxAnimFilePathAttr = "unityFbxAnimFilePath";
55
global string $UnityFbxAnimFileNameAttr = "unityFbxAnimFileName";
6+
global string $UnityFbxNamespaceAttr = "unityFbxNamespace";
67
global string $UnityExportSetNameFormat = "^1s_UnityExportSet";
78

89
global proc unityRemoveNativeMenuOnLoad(){
@@ -91,6 +92,7 @@ proc importFile(string $filePathStr){
9192
global string $UnityFbxFileNameAttr;
9293
global string $UnityFbxAnimFilePathAttr;
9394
global string $UnityFbxAnimFileNameAttr;
95+
global string $UnityFbxNamespaceAttr;
9496
global string $UnityExportSetNameFormat;
9597

9698
$tempPath = dirname($filePathStr);
@@ -144,6 +146,7 @@ proc importFile(string $filePathStr){
144146
// reset attribute values, in case import fails
145147
storeAttribute($unityExportSet, $UnityFbxFilePathAttr, "");
146148
storeAttribute($unityExportSet, $UnityFbxFileNameAttr, "");
149+
storeAttribute($unityExportSet, $UnityFbxNamespaceAttr, "");
147150
}
148151

149152
if($origNamespace != $nameWithoutExt){
@@ -171,6 +174,10 @@ proc importFile(string $filePathStr){
171174
storeAttribute($unityExportSet,$UnityFbxAnimFileNameAttr,$tempAnimName);
172175
}
173176

177+
if($nameWithoutExt != ""){
178+
storeAttribute($unityExportSet, $UnityFbxNamespaceAttr, $nameWithoutExt);
179+
}
180+
174181
if (setExists($unityExportSet) == true){
175182
// figure out what has been added after import
176183
$itemsInScene = `ls -tr -o -r true`;

0 commit comments

Comments
 (0)