@@ -238,9 +238,7 @@ proc unityExport(int $exportAnim){
238
238
return;
239
239
}
240
240
241
- // create temporary set containing selection
242
- string $selectedSet = `sets`;
243
- $selectedSetList = {$selectedSet};
241
+ string $myIntersector = `stringArrayIntersector`;
244
242
245
243
$i = 0;
246
244
string $setsToExport[];
@@ -249,17 +247,23 @@ proc unityExport(int $exportAnim){
249
247
continue;
250
248
}
251
249
252
- if(`sets -isIntersecting $exportSet $selectedSetList` ||
250
+ stringArrayIntersector -edit -reset $myIntersector;
251
+ stringArrayIntersector -edit -intersect $origSelection $myIntersector;
252
+
253
+ string $exportSetContents[] = `listConnections $exportSet`;
254
+
255
+ stringArrayIntersector -edit -intersect $exportSetContents $myIntersector;
256
+
257
+ string $intersection[] = `stringArrayIntersector -query $myIntersector`;
258
+
259
+ if(size($intersection) > 0 ||
253
260
stringArrayContains($exportSet, $origSelection)){
254
261
255
262
$setsToExport[$i] = $exportSet;
256
263
$i++;
257
264
}
258
265
}
259
266
260
- // delete temporary selection set
261
- delete $selectedSet;
262
-
263
267
// if selection doesn't belong to a set, export to a new file
264
268
if(size($setsToExport) <= 0){
265
269
eval "SendToUnitySelection";
@@ -269,12 +273,19 @@ proc unityExport(int $exportAnim){
269
273
for($unitySet in $setsToExport){
270
274
print ("exporting set: " + $unitySet);
271
275
272
- select -r -ne $unitySet;
276
+ string $unitySetContents[] = `listConnections $unitySet` ;
273
277
274
278
if($exportAnim){
275
279
string $animCurveSelect[] = `ls -typ animCurve`;
276
280
string $animatedTransforms[] = `listConnections -t transform $animCurveSelect`;
277
- select -r $animatedTransforms;
281
+
282
+ stringArrayIntersector -edit -reset $myIntersector;
283
+ stringArrayIntersector -edit -intersect $animatedTransforms $myIntersector;
284
+ stringArrayIntersector -edit -intersect $unitySetContents $myIntersector;
285
+
286
+ string $setAnimatedTransforms[] = `stringArrayIntersector -query $myIntersector`;
287
+
288
+ select -r $setAnimatedTransforms;
278
289
}
279
290
280
291
$pathAttr = $UnityFbxFilePathAttr;
@@ -295,6 +306,9 @@ proc unityExport(int $exportAnim){
295
306
}
296
307
}
297
308
309
+ // Delete the intersector
310
+ deleteUI $myIntersector;
311
+
298
312
select -cl;
299
313
if (size($origSelection) > 0){
300
314
select -add -ne $origSelection;
0 commit comments