import MASH.api as mapi import maya.cmds as cmds #new file cmds.file(force=True, new=True) #move the camera cmds.setAttr('persp.translateX', 50) cmds.setAttr('persp.translateY', 48) cmds.setAttr('persp.translateZ', 50) #create a poly cube pcube = cmds.polyCube(w=1.0, h=1.0, d=1.0) #create a new MASH network mashNetwork = mapi.Network() mashNetwork.createNetwork(name="OffsetMapNetwork", geometry="Repro") cmds.setAttr(mashNetwork.distribute + '.arrangement', 6) cmds.setAttr(mashNetwork.distribute + '.gridAmplitudeX', 30) cmds.setAttr(mashNetwork.distribute + '.gridAmplitudeY', 30) cmds.setAttr(mashNetwork.distribute + '.gridAmplitudeZ', 30) cmds.setAttr(mashNetwork.distribute + '.gridx', 30) cmds.setAttr(mashNetwork.distribute + '.gridy', 30) cmds.setAttr(mashNetwork.distribute + '.gridz', 30) signalNode = mashNetwork.addNode("MASH_Signal") cmds.setAttr(signalNode.name + '.positionX', 0) cmds.setAttr(signalNode.name + '.positionY', 0) cmds.setAttr(signalNode.name + '.positionZ', 0) cmds.setAttr(signalNode.name + '.rotationX', 360) cmds.setAttr(signalNode.name + '.rotationY', 360) cmds.setAttr(signalNode.name + '.rotationZ', 360) cmds.setAttr(signalNode.name + '.scaleX', 5) cmds.setAttr(signalNode.name + '.timeScale', 0.2) signalFalloff = signalNode.addFalloff() falloffTransform = cmds.listRelatives( signalFalloff, allParents=True )[0] cmds.setAttr(falloffTransform + '.translateX', 15.7) cmds.setAttr(falloffTransform + '.translateY', 14) cmds.setAttr(falloffTransform + '.scaleX', 25) cmds.setAttr(falloffTransform + '.scaleY', 25) cmds.setAttr(falloffTransform + '.scaleZ', 25) colorNode = mashNetwork.addNode("MASH_Color") cmds.setAttr(colorNode.name + '.color', 1.0,0.188,0.192 , type='double3') cmds.setAttr(colorNode.name + '.enableBackgroundColor', 1) cmds.setAttr(colorNode.name + '.backgroundColor', 0.086,0.247,0.282 , type='double3') cmds.connectAttr(signalFalloff+'.falloffOut', colorNode.name+'.strengthPP[0]') colorNodeHotSpot = mashNetwork.addNode("MASH_Color") cmds.setAttr(colorNodeHotSpot.name + '.blendMode', 2) cmds.setAttr(colorNodeHotSpot.name + '.color', 0.626,0.626,0.238 , type='double3') hotspotFalloff = colorNodeHotSpot.addFalloff() cmds.setAttr(hotspotFalloff + '.innerRadius', 0) falloffTransform = cmds.listRelatives( hotspotFalloff, allParents=True )[0] cmds.setAttr(falloffTransform + '.translateX', 15.7) cmds.setAttr(falloffTransform + '.translateY', 14) cmds.setAttr(falloffTransform + '.scaleX', 15) cmds.setAttr(falloffTransform + '.scaleY', 15) cmds.setAttr(falloffTransform + '.scaleZ', 15) #tell Maya to finish what it's doing before we continue cmds.flushIdleQueue() #playblast cmds.playbackOptions( animationEndTime='3sec') cmds.playblast(format="qt", viewer=True, p=100 )