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
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
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)
_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[
aimAxis=aimAxis) #Loli extendMode = 'cylinder' closedCurve = False l_specifiedRotates = [-30, -20, -10, -5, 0, 5, 10, 20, 30] #>>> Modules #======================================================= reload(mShapeCast) m1 = cgmPM.cgmModule(name='test') m1 = r9Meta.MetaClass('spine_part') m1.setState('template') m1.getPartNameBase() m1.modulePuppet.getGeo() mShapeCast.go(m1, ['loliHandles'], ['neck_1_1_jnt', 'neck_2_jnt']) mShapeCast.go(m1, ['segmentIK']) mShapeCast.go(m1, ['torsoIK']) mShapeCast.go(m1, ['segmentFK']) mShapeCast.go(m1, ['segmentFK_Loli']) mShapeCast.go(m1, ['cog']) mShapeCast.go(m1, ['hips']) mShapeCast.go(m1) mShapeCast.go(m1, ['segmentFK_Loli', 'segmentIK']) a = dataHolder() a = [] a.__dict__ mShapeCast.go(m1, ['hips'])
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
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