// =========================================================================== // 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. // =========================================================================== global proc MASHnNetworkConnect() { string $sel[] = `ls -sl`; if (size($sel) > 1) { string $idParticles = `nodeType $sel[0]`; string $idWaiter = `nodeType $sel[1]`; string $shapes[]; $shapes = `listRelatives -shapes $sel[0]`; if ($idParticles == "nParticle" && $idWaiter == "MASH_Waiter") { string $distribute[] = `listConnections ($sel[1]+".waiterMessage")`; connectAttr -force ($sel[0]+".position") ($distribute[0]+".inPositionPP"); setAttr ($distribute[0]+".arrangement") 5; //change to input points mode } else if (size($shapes) > 0) { //did the user select a transform, if so, get the shape child string $distribute[] = `listConnections ($sel[1]+".waiterMessage")`; connectAttr -force ($shapes[0]+".position") ($distribute[0]+".inPositionPP"); setAttr ($distribute[0]+".arrangement") 5; //change to input points mode } else { MASHinViewMessage((getPluginResource("MASH", "kSelectParticlesThenWaiter")), "Warning"); } } else { MASHinViewMessage((getPluginResource("MASH", "kSelectParticlesThenWaiter")), "Warning"); } }