Exemplo n.º 1
0
        def rig(self,**kwargs):
			# Variables
			clusterCtls = []
			
			# create registries
			self.createRegistry("regRigTransform")
			self.createRegistry("regRigShape")
			
			# Check for module container
			rootGrp = cmds.group( n = (self.name + "Rig_GRP"), em = True )
			jointGrp = cmds.group( n = (self.name + "Joint_GRP"), em = True, p= rootGrp)
			setupGrp = cmds.group( n = (self.name + "Setup_GRP"), em = True, p= rootGrp)
			controlGrp = cmds.group( n = (self.name + "Control_GRP"), em = True, p= rootGrp)
			
			# Get blueprinter joints
			blueprinters  = self.getBlueprinterJoints()
			for joint in blueprinters:
				if cmds.objExists(joint) == False:
					cmds.error(joint + " not found!")
			
			# Duplicate joints
			joints = Util.duplicateChain( self.name , blueprinters)
			cmds.parent(joints[0],jointGrp)
			
			# Hide blueprinters joints
			cmds.setAttr((self.name + "Blueprint_GRP" + ".v"), 0)
			
			#cmds.ikHandle()
			handleData = Util.createSplineIk(self.name, joints, sol= "ikSplineSolver")
			clusterList = Util.clusterizeCurve( handleData["CRV"] )
			
			cmds.parent(handleData["IK"], setupGrp)
			
			#create controls
			for cluster in clusterList:
				clusterName = Util.removeSuffix( cluster[0] )
				clusterCtl = Util.createControl( clusterName, {"match":cluster[0]}  )
				
				cmds.parent(cluster[1], clusterCtl[0] )
				cmds.parent(clusterCtl[1], controlGrp )
				clusterCtls.append(clusterCtl)
				
			# parent controls
			for x in range(1,  len(clusterCtls) ):
				cmds.parent( clusterCtls[x][1], clusterCtls[x-1][0] )
			cmds.parent(rootGrp, self.rootGrp)
			
			# store outputs
			self.storeOutput(clusterCtls[3][0],"endControl")