// =========================================================================== // Copyright 2018 Autodesk, Inc. All rights reserved. // // Use of this software is subject to the terms of the Autodesk license // agreement provided at the time of installation or download, or which // otherwise accompanies this software in either electronic or hard copy form. // =========================================================================== // // Procedure Name: // MASHcacheRedirection // // Description; // Takes the user to the correct caching window for the type of selected MASH network. // Mesh based networks (Repro) will be send to the Alembic screen. // Instancer based networks will be sent to the built in MASH caching screen. // global proc MASHcacheRedirection() { string $sel[] = `ls -sl`; int $sucsess = 0; //go through the selected objects for ($obj in $sel) { string $idWaiter = `nodeType $obj`; if ($idWaiter == "MASH_Waiter") { string $currentMultiIntancerConnection[] = `listConnections -d on -s off -p off ($obj + ".instancerMessage")`; for ($inst in $currentMultiIntancerConnection) { string $idInstancer = `nodeType $inst`; if ($idInstancer == "instancer") { $sucsess = 1; waiterButtonCMDS $obj 10; } else if ($idInstancer == "MASH_Repro") { string $reproMesh[] = `listConnections -d on -s off -p off ($inst + ".outMesh")`; select -clear; for ($mesh in $reproMesh) { select -add $mesh; } $sucsess = 1; performAlembicExport 1 0; } } } // Check for Shell Dynamics networks string $currentOutputConnections[] = `listConnections -d on -sh on -s on -p off ($obj + ".outputPoints")`; for ($conn in $currentOutputConnections) { string $nt = `nodeType $conn`; if ($nt == "MASH_BulletSolver") { string $solverConn[] = `listConnections -d on -sh on -s off -p off ($conn + ".instancerMessage")`; if (size($solverConn) && (`nodeType $solverConn[0]` == "MASH_ShellDeformer")) { string $geom[] = `listConnections -d on -s off -p off ($solverConn[0] + ".outputGeometry")`; if (size($geom)) { select $geom[0]; $sucsess = 1; performAlembicExport 1 0; } } } } } if (!$sucsess) { MASHinViewMessage((getPluginResource("MASH", "kPleaseSelectAWaiter")), "Warning"); } }