Skip to content

Commit e3a1169

Browse files
committed
remove namespace when exporting
- store absolute namespace name (has to be absolute for export flag) - add flag to export with relative namespace
1 parent fd55afd commit e3a1169

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ proc importFile(string $filePathStr){
175175
}
176176

177177
if($nameWithoutExt != ""){
178-
storeAttribute($unityExportSet, $UnityFbxNamespaceAttr, $nameWithoutExt);
178+
storeAttribute($unityExportSet, $UnityFbxNamespaceAttr, `namespaceInfo -an $nameWithoutExt`);
179179
}
180180

181181
if (setExists($unityExportSet) == true){
@@ -282,6 +282,7 @@ proc exportSet(string $unitySet, int $exportAnim){
282282
global string $UnityFbxFileNameAttr;
283283
global string $UnityFbxAnimFilePathAttr;
284284
global string $UnityFbxAnimFileNameAttr;
285+
global string $UnityFbxNamespaceAttr;
285286

286287
string $unitySetContents[] = `listConnections $unitySet`;
287288

@@ -308,12 +309,13 @@ proc exportSet(string $unitySet, int $exportAnim){
308309
$nameAttr = $UnityFbxAnimFileNameAttr;
309310
}
310311

311-
$unity_fbx_file_path = getAttribute($unitySet, $pathAttr);
312-
$unity_fbx_file_name = getAttribute($unitySet, $nameAttr);
312+
string $unity_fbx_file_path = getAttribute($unitySet, $pathAttr);
313+
string $unity_fbx_file_name = getAttribute($unitySet, $nameAttr);
314+
string $unity_fbx_namespace = getAttribute($unitySet, $UnityFbxNamespaceAttr);
313315

314316
$strCmd = "";
315317
if ($unity_fbx_file_path != "" && $unity_fbx_file_name != ""){
316-
$strCmd = "file -force -options \"\" -typ \"FBX export\" -pr -es \"" + $unity_fbx_file_path + "/" + $unity_fbx_file_name + "\"";
318+
$strCmd = `format -s $unity_fbx_namespace -s $unity_fbx_file_path -s $unity_fbx_file_name "file -force -options \"\" -typ \"FBX export\" -relativeNamespace \"^1s\" -es \"^2s/^3s\""`;
317319
eval $strCmd;
318320
}
319321

0 commit comments

Comments
 (0)