Esempio n. 1
0
def cleanMeshControls(doConfirm=True):
    shapesRemoved = 0
    for node in getRigPartContainers(True):

        clsName = getAttr('%s._rigPrimitive.typeName' % node)
        cls = RigPart.GetNamedSubclass(clsName)

        if cls is None:
            continue

        rigPart = cls(node)
        for c in rigPart:
            for shape in listRelatives(c, s=True, pa=True) or []:
                if getAttr('%s.intermediateObject' % shape):
                    delete(shape)
                    shapesRemoved += 1

    printInfoStr("Clean up %d bogus shapes" % shapesRemoved)
    if doConfirm:
        cmd.confirmDialog(
            t='Done!',
            m="I'm done polishing your rig!\n%d shapes removed." %
            shapesRemoved,
            b='OK',
            db='OK')
Esempio n. 2
0
	def setupMirroring( self ):
		for control in self:
			if control is None:
				continue

			oppositeControl = self.getOppositeControl( control )
			pair = poseSym.ControlPair.Create( control, oppositeControl )
			printInfoStr( 'setting up mirroring on %s %s' % (control, oppositeControl) )
	def setupMirroring( self ):
		for control in self:
			if control is None:
				continue

			oppositeControl = self.getOppositeControl( control )
			pair = poseSym.ControlPair.Create( control, oppositeControl )
			printInfoStr( 'setting up mirroring on %s %s' % (control, oppositeControl) )
Esempio n. 4
0
def cleanMeshControls( doConfirm=True ):
	shapesRemoved = 0
	for node in getRigPartContainers( True ):

		clsName = getAttr( '%s._rigPrimitive.typeName' % node )
		cls = RigPart.GetNamedSubclass( clsName )

		if cls is None:
			continue

		rigPart = cls( node )
		for c in rigPart:
			for shape in listRelatives( c, s=True, pa=True ) or []:
				if getAttr( '%s.intermediateObject' % shape ):
					delete( shape )
					shapesRemoved += 1

	printInfoStr( "Clean up %d bogus shapes" % shapesRemoved )
	if doConfirm:
		cmd.confirmDialog( t='Done!', m="I'm done polishing your rig!\n%d shapes removed." % shapesRemoved, b='OK', db='OK' )
Esempio n. 5
0
	def write( self, objects, **kwargs ):
		type = self.getType()
		clipDict = api.writeExportDict( TOOL_NAME, VER )
		clipDict[ kEXPORT_DICT_CLIP_TYPE ] = type
		clipDict[ kEXPORT_DICT_OBJECTS ] = objects
		clipDict[ kEXPORT_DICT_WORLDSPACE ] = False

		theClip = self.TYPE_CLASSES[ type ]()
		success = theClip.generate( objects, **kwargs )

		if not success:
			printErrorStr( "Failed to generate clip!" )
			return

		clipDict[ kEXPORT_DICT_THE_CLIP ] = theClip

		#write the preset file to disk
		self.pickle( clipDict )

		#generate the icon for the clip and add it to perforce if appropriate
		icon = generateIcon( self )
		#icon.asP4().add()

		printInfoStr( "Generated clip!" )
Esempio n. 6
0
    def write(self, objects, **kwargs):
        type = self.getType()
        clipDict = api.writeExportDict(TOOL_NAME, VER)
        clipDict[kEXPORT_DICT_CLIP_TYPE] = type
        clipDict[kEXPORT_DICT_OBJECTS] = objects
        clipDict[kEXPORT_DICT_WORLDSPACE] = False

        theClip = self.TYPE_CLASSES[type]()
        success = theClip.generate(objects, **kwargs)

        if not success:
            printErrorStr("Failed to generate clip!")
            return

        clipDict[kEXPORT_DICT_THE_CLIP] = theClip

        #write the preset file to disk
        self.pickle(clipDict)

        #generate the icon for the clip and add it to perforce if appropriate
        icon = generateIcon(self)
        #icon.asP4().add()

        printInfoStr("Generated clip!")