fix the example postSyncRename script, it could fail
with multiple mesh outputs
@@ -313,12 +313,20 @@ global proc postSyncRename(string $assetNode, int $syncOnlyAttributes, int $sync
string $baseName = "customName#";
+ // we only want the meshData connections, but listConnections gets confused
+ // trying to access a single compound child across all elements of a multi
string $outputObjCon[] = `listConnections -p on ($assetNode + ".outputObjects")`;
+ string $outputMeshCon[];
for($con in $outputObjCon) {
string $src = `connectionInfo -sfd $con`;
// if a mesh output has auxiliary nodes or downstream history
// need a temporary mesh shape to backstop the history
if(endsWith($src, "outputPartMeshData")) {
+ $outputMeshCon[size($outputMeshCon)] = $con;
+ }
+ }
+
+ for($con in $outputMeshCon) {
string $outNode = plugNode($con);
if(nodeType($outNode) == "mesh") {
@@ -342,7 +350,6 @@ global proc postSyncRename(string $assetNode, int $syncOnlyAttributes, int $sync
}
}
}
-}
@endverbatim
<br>
@section Maya_Scripting_Python Python
