Skip to content

Commit 858363d

Browse files
committed
handle case where there is no export set
- allow user to export to a new file - also check if selection contains the set itself
1 parent f52fac1 commit 858363d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,9 @@ global proc unityExport(){
244244
continue;
245245
}
246246

247-
if(`sets -isIntersecting $exportSet $selectedSetList`){
247+
if(`sets -isIntersecting $exportSet $selectedSetList` ||
248+
stringArrayContains($exportSet, $origSelection)){
249+
248250
$setsToExport[$i] = $exportSet;
249251
$i++;
250252
}
@@ -253,6 +255,12 @@ global proc unityExport(){
253255
// delete temporary selection set
254256
delete $selectedSet;
255257

258+
// if selection doesn't belong to a set, export to a new file
259+
if(size($setsToExport) <= 0){
260+
eval "SendToUnitySelection";
261+
return;
262+
}
263+
256264
for($unitySet in $setsToExport){
257265
print ("exporting set: " + $unitySet);
258266

0 commit comments

Comments
 (0)