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', 35) cmds.setAttr('persp.translateZ', 50) #create a poly cube ptorus = cmds.polyTorus(r=20, sr=2, sh=15, sx=100) pcube = cmds.polyCube(w=0.1, h=0.1, d=0.1) #create a new MASH network mashNetwork = mapi.Network() mashNetwork.createNetwork("CurlNoiseNetwork") shape = cmds.listRelatives(ptorus[0], s=True)[0] mashNetwork.meshDistribute(shape, 4) cmds.setAttr(mashNetwork.distribute + '.floodMesh', 1) #playblast cmds.playbackOptions( animationEndTime='5sec') signalNode = mashNetwork.addNode("MASH_Signal") cmds.setAttr(signalNode.name + '.signalType', 5) cmds.setAttr(signalNode.name + '.transformationSpace', 2) cmds.setAttr(signalNode.name + '.positionX', 5) cmds.setAttr(signalNode.name + '.positionZ', 5) cmds.setAttr(signalNode.name + '.timeScale', 3) trailsNode = mashNetwork.addNode("MASH_Trails") cmds.setAttr(trailsNode.name + '.maxTrails', 1500) cmds.hide(ptorus) cmds.setAttr('lambert1.incandescence', 1, 1, 1, type='double3') #tell Maya to finish what it's doing before we continue cmds.flushIdleQueue() #playblast cmds.playbackOptions( animationEndTime='5sec') cmds.playblast(format="qt", viewer=True, p=100 )