@@ -111,6 +111,22 @@ proc string getNewNamespace(string $n1, string $n2){
111
111
return $newNamespace;
112
112
}
113
113
114
+ proc checkNamespaceNeedsUpdate(string $unitySet, string $objectNamespace){
115
+ global string $UnityFbxNamespaceAttr;
116
+
117
+ string $unity_fbx_namespace = getAttribute($unitySet, $UnityFbxNamespaceAttr);
118
+ string $newNamespace = getNewNamespace($unity_fbx_namespace, $objectNamespace);
119
+ if($unity_fbx_namespace != $newNamespace){
120
+ // popup asking to change namespace value to new namespace
121
+ if(showConfirmDialog($unitySet,
122
+ "Set namespace has been modified from "+$unity_fbx_namespace+" to "+$newNamespace+", update export set namespace attribute?",
123
+ "Yes", "No"
124
+ )){
125
+ storeAttribute($unitySet, $UnityFbxNamespaceAttr, $newNamespace);
126
+ }
127
+ }
128
+ }
129
+
114
130
proc importFile(string $filePathStr){
115
131
// get the global variables
116
132
global string $UnityExportSets[];
@@ -143,6 +159,11 @@ proc importFile(string $filePathStr){
143
159
144
160
$setNamespaceExists = false;
145
161
if (setExists($unityExportSet)){
162
+ string $unitySetContents[] = `listConnections $unityExportSet`;
163
+ if(size($unitySetContents) > 0){
164
+ checkNamespaceNeedsUpdate($unityExportSet, getObjectNamespace($unitySetContents[0]));
165
+ }
166
+
146
167
// get namespace from set
147
168
$setNamespace = getAttribute($unityExportSet, $UnityFbxNamespaceAttr);
148
169
if($setNamespace != "" && `namespace -exists $setNamespace`){
@@ -331,16 +352,7 @@ proc exportSet(string $unitySet, int $exportAnim){
331
352
string $unity_fbx_namespace = getAttribute($unitySet, $UnityFbxNamespaceAttr);
332
353
333
354
if(size($unitySetContents) > 0){
334
- string $newNamespace = getNewNamespace($unity_fbx_namespace, getObjectNamespace($unitySetContents[0]));
335
- if($unity_fbx_namespace != $newNamespace){
336
- // popup asking to change namespace value to new namespace
337
- if(showConfirmDialog($unitySet,
338
- "Set namespace has been modified from "+$unity_fbx_namespace+" to "+$newNamespace+", update export set namespace attribute?",
339
- "Yes", "No"
340
- )){
341
- storeAttribute($unitySet, $UnityFbxNamespaceAttr, $newNamespace);
342
- }
343
- }
355
+ checkNamespaceNeedsUpdate($unitySet, getObjectNamespace($unitySetContents[0]));
344
356
}
345
357
346
358
string $animatedObjectSet = "";
0 commit comments