Ejemplo n.º 1
0
	def build(self):#================================================================================   	
	    
	    if self._go._i_templateNull.handles not in range(4,6):
		raise Exception, "%s.build_shapes>>> Too many handles. don't know how to rig"%(self._go._strShortName)
	    
	    if not self._go.isRigSkeletonized():
		raise Exception, "%s.build_shapes>>> Must be rig skeletonized to shape"%(self._go._strShortName)	
	    
	    #>>> Get our segment influence joints
	    #=============================================================    
	    l_influenceChains = []
	    ml_influenceChains = []
	    for i in range(50):
		buffer = self._go._i_rigNull.msgList_getMessage('segment%s_InfluenceJoints'%i)
		if buffer:
		    l_influenceChains.append(buffer)
		    ml_influenceChains.append(cgmMeta.validateObjListArg(buffer,cgmMeta.cgmObject))
		else:
		    break    
		
	    log.info("%s.build_shapes>>> Influence Chains -- cnt: %s | lists: %s"%(self._go._strShortName,len(l_influenceChains),l_influenceChains))
	    
	    #>>>Build our Shapes
	    #=============================================================
	    try:
		#Segment IK
		"""
		ml_segmentIKShapes = []
		for i,ml_chain in enumerate(ml_influenceChains):
		    mShapeCast.go(self._go._mi_module,['segmentIK'],targetObjects = [i_jnt.mNode for i_jnt in ml_chain] , storageInstance=self)#This will store controls to a dict called    
		    log.info("%s.build_shapes>>> segmentIK chain %s: %s"%(self._go._strShortName,i,self._go._md_controlShapes))
		    ml_segmentIKShapes.extend(self._go._md_controlShapes['segmentIK'])
		    
		    self._go._i_rigNull.msgList_connect(self._go._md_controlShapes['segmentIK'],'shape_segmentIK_%s'%i,"rigNull")		
		
		self._go._i_rigNull.msgList_connect(ml_segmentIKShapes,'shape_segmentIK',"rigNull")		
		"""
		#Rest of it
		l_toBuild = __d_controlShapes__['shape']
		mShapeCast.go(self._go._mi_module,l_toBuild, storageInstance=self._go)#This will store controls to a dict called    
		log.info(self._go._md_controlShapes)
		log.info(self._go._md_controlPivots)
		self._go._i_rigNull.msgList_connect(self._go._md_controlShapes['segmentFK'],'shape_controlsFK',"rigNull")	
		self._go._i_rigNull.connectChildNode(self._go._md_controlShapes['settings'],'shape_settings',"rigNull")		
		self._go._i_rigNull.connectChildNode(self._go._md_controlShapes['moduleCap'],'shape_cap',"rigNull")
		
	    except Exception,error:
		log.error("%s.build_shapes>>Build shapes fail!"%self._go._strShortName)
		raise Exception,error  
Ejemplo n.º 2
0
 def build_shapes(self):
     l_toBuild = ['clavicle']
     mShapeCast.go(self._go._mi_module,
                   l_toBuild,
                   storageInstance=self._go
                   )  #This will store controls to a dict called
Ejemplo n.º 3
0
reload(Rig)
import cgm.core.lib.attribute_utils as ATTR
reload(ATTR)
m1 = cgmMeta.asMeta('l_leg_part')
ATTR.get_message('M1_puppetNetwork','masterControl',simple = True)
m1.modulePuppet.hasAttr('masterControl')
m1.modulePuppet.masterControl
m1.modulePuppet.getMessage('masterControl')
cgmMeta.asMeta('l_leg_rigNull_dynSwitchSystem').getMessage('dynStoredAttr_0',simple=False)

#ShapeCasting========================================================
from cgm.core.rigger import ModuleShapeCaster as mShapeCast
reload(mShapeCast)
from cgm.core.lib import shapeCaster as ShapeCast
reload(ShapeCast)
mShapeCast.go(m1,l_toBuild)

m1 = cgmMeta.asMeta('l_arm_part')
mShapeCast.go(m1,['segmentFK_Loli'])
mShapeCast.go(m1,['settings'])
mShapeCast.go(m1,['midIK'])
mShapeCast.go(m1,['hand'])

#Issues========================================================
import cgm.core.cgmPy.validateArgs as VALID
reload(VALID)
VALID.is_transform('cgmObject_poly2_parentConstraint1')

mc.listAttr('cgmObject_poly2_parentConstraint1')

ATTR.set('cgmObject_poly2_parentConstraint1','ty',100)
Ejemplo n.º 4
0
    _str_funcName = "build_shapes(%s)" % self._strShortName
    log.info(">>> %s >>> " % (_str_funcName) + "=" * 75)

    if self._i_templateNull.handles > 3:
        raise StandardError, "%s >>> Too many handles. don't know how to rig" % (
            _str_funcName)

    if not self.isRigSkeletonized():
        raise StandardError, "%s.build_shapes>>> Must be rig skeletonized to shape" % (
            self._strShortName)

    #>>>Build our Shapes
    #=============================================================
    try:
        mShapeCast.go(
            self._mi_module, ['eyeball'],
            storageInstance=self)  #This will store controls to a dict called

    except Exception, error:
        log.error("build_eyeball>>Build shapes fail!")
        raise StandardError, error
    return True


#>>> Controls
#===================================================================
def build_controls(*args, **kws):
    class fncWrap(modUtils.rigStep):
        def __init__(self, *args, **kws):
            super(fncWrap, self).__init__(*args, **kws)
            self._str_funcName = 'build_controls(%s)' % self.d_kws[
Ejemplo n.º 5
0
import maya.cmds as mc

from cgm.core import cgm_Meta as cgmMeta
from cgm.core import cgm_PuppetMeta as cgmPM
import Red9.core.Red9_Meta as r9Meta

from cgm.core.classes import SnapFactory as Snap
reload(Snap)
from cgm.core.rigger import ModuleShapeCaster as mShapeCast
reload(mShapeCast)

#>>>Base control size
caster = 'curve1'
geo = 'Morphy_Body_GEO'
axis = ['z+']
mShapeCast.returnBaseControlSize(caster, geo, axis)  #Get size

obj = mc.ls(sl=True)[0] or False
obj = ''
objList = []

#Meshslice bankRotate:
rotateBank = -10
mShapeCast.createMeshSliceCurve('Morphy_Body_GEO1',
                                l_targetObjects[0],
                                curveDegree=3,
                                posOffset=[0, 0, 2.5],
                                points=8,
                                returnDict=True,
                                latheAxis='z',
                                aimAxis='y-')
Ejemplo n.º 6
0
        log.error("eyeball.build_rig>>bad self!")
        raise StandardError,error

    _str_funcName = "build_shapes(%s)"%self._strShortName
    log.info(">>> %s >>> "%(_str_funcName) + "="*75)   

    if self._i_templateNull.handles > 3:
        raise StandardError, "%s >>> Too many handles. don't know how to rig"%(_str_funcName)    

    if not self.isRigSkeletonized():
        raise StandardError, "%s.build_shapes>>> Must be rig skeletonized to shape"%(self._strShortName)	

    #>>>Build our Shapes
    #=============================================================
    try:
        mShapeCast.go(self._mi_module,['eyeball'], storageInstance=self)#This will store controls to a dict called    

    except Exception,error:
        log.error("build_eyeball>>Build shapes fail!")
        raise StandardError,error 
    return True

#>>> Controls
#===================================================================
def build_controls(*args, **kws):
    class fncWrap(modUtils.rigStep):
        def __init__(self,*args, **kws):
            super(fncWrap, self).__init__(*args, **kws)
            self._str_funcName = 'build_controls(%s)'%self.d_kws['goInstance']._strShortName
            self._b_autoProgressBar = True	
            self._b_reportTimes = True	    	    
Ejemplo n.º 7
0
 def build_shapes(self):
     l_toBuild = ['clavicle']
     mShapeCast.go(self._go._mi_module,l_toBuild, storageInstance= self._go )#This will store controls to a dict called