Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #--------------------------------------------------------------------------------------
- # PARTICLE SPAWNER: Creates the pSets of emitters, particals and geometry.
- # ( Brian Williams (Translator) / Scott Cormier (Creator) ) 2011
- #--------------------------------------------------------------------------------------
- #
- #--------------------------------------------------------------------------------------
- # To-Do List
- #--------------------------------------------------------------------------------------
- """
- - Use the inputted name as the instantiated class name when making new rigs, this way you can have multiple sequences...populate
- a list of the sets with a loop then group them so that there is a hierachy.
- -Encapsualte into this one file and reference it in another file for easy reading.
- """
- #--------------------------------------------------------------------------------------
- # Importing
- #--------------------------------------------------------------------------------------
- """
- from pymel.core import *
- import maya.cmds as mc
- """
- #--------------------------------------------------------------------------------------
- class ParticleSpawner():
- cntSet = 1
- group( em=True, name='Root' )
- def makeEmitters(self, emitAmt = 0, placer = 0):
- for i in range(0,emitAmt,1):
- select(cl=True)
- lpIndex = i+1
- emitter(n='emit_' + str(self.cntSet) + '_' + str(lpIndex))
- particle(n='part_' + str(self.cntSet) + '_' + str(lpIndex))
- connectDynamic('part_' + str(self.cntSet) + '_' + str(lpIndex), em='emit_' + str(self.cntSet) + '_' + str(lpIndex))
- spaceLocator(n='pLoc_' + str(self.cntSet) + '_' + str(lpIndex))
- parent('emit_' + str(self.cntSet) + '_' + str(lpIndex),'pLoc_' + str(self.cntSet) + '_' + str(lpIndex))
- parent('part_' + str(self.cntSet) + '_' + str(lpIndex),'pLoc_' + str(self.cntSet) + '_' + str(lpIndex))
- polyCube(n='pRigRoot_' + str(self.cntSet))
- select('pLoc_'+ str(self.cntSet) + '_*', 'pRigRoot_' + str(self.cntSet))
- group(n='pSet_' + str(self.cntSet))
- def popSet(self,emitAmt):
- self.makeEmitters(emitAmt)
- parent('pSet_' + str(self.cntSet), 'Root')
- self.cntSet += 1
- #--------------------------------------------------------------------------------------
- # Run Script: mc.file( f=True, new=True )
- #--------------------------------------------------------------------------------------
- #Run This and Above class first
- rigTest = ParticleSpawner()
- rigTest.cntSet = 1
- # Run this for every time you want a new pSet, the argument controls how many emitters are in each pSet
- rigTest.popSet(2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement