示例#1
0
        def _validate(self):
            #>> validate ============================================================================
            self.mi_obj = cgmMeta.validateObjArg(self.d_kws['objToAttach'],
                                                 cgmMeta.cgmObject,
                                                 noneValid=False)
            self.mi_targetSurface = cgmMeta.validateObjArg(
                self.d_kws['targetSurface'], noneValid=False)
            self.mi_orientation = VALID.simpleOrientation(
                self.d_kws['orientation'])
            self._str_funcCombined = self._str_funcCombined + "(%s,%s)" % (
                self.mi_obj.p_nameShort, self.mi_targetSurface.p_nameShort)

            self.l_shapes = mc.listRelatives(self.mi_targetSurface.mNode,
                                             shapes=True)
            if len(self.l_shapes) > 1:
                log.debug(
                    "More than one shape found. Using 0. targetSurface : %s | shapes: %s"
                    % (self.mi_targetSurface.p_nameShort, self.l_shapes))
            self.mi_shape = cgmMeta.validateObjArg(self.l_shapes[0],
                                                   cgmMeta.cgmNode,
                                                   noneValid=False)
            self.b_createControlLoc = VALID.boolArg(
                self.d_kws['createControlLoc'],
                calledFrom=self._str_funcCombined)
            self.b_createUpLoc = VALID.boolArg(
                self.d_kws['createUpLoc'], calledFrom=self._str_funcCombined)
            self.b_parentToFollowGroup = VALID.boolArg(
                self.d_kws['parentToFollowGroup'],
                calledFrom=self._str_funcCombined)
            self.b_attachControlLoc = VALID.boolArg(
                self.d_kws['attachControlLoc'],
                calledFrom=self._str_funcCombined)
            self.b_connectOffset = VALID.boolArg(
                self.d_kws['connectOffset'], calledFrom=self._str_funcCombined)
            self.b_pointAttach = VALID.boolArg(
                self.d_kws['pointAttach'], calledFrom=self._str_funcCombined)

            self.f_offset = VALID.valueArg(self.d_kws['f_offset'],
                                           calledFrom=self._str_funcCombined)
            #Get info ============================================================================
            self.d_closestInfo = distance.returnClosestPointOnSurfaceInfo(
                self.mi_obj.mNode, self.mi_targetSurface.mNode)
            self.d_closestInfo = DIST.get_closest_point_data_from_mesh(
                self.mi_obj.mNode, self.mi_targetSurface.mNode)
            #Running Lists ============================================================================
            self.md_return = {}
示例#2
0
	def _validate(self):
	    #>> validate ============================================================================
	    self.mi_obj = cgmMeta.validateObjArg(self.d_kws['objToAttach'],cgmMeta.cgmObject,noneValid=False)
	    self.mi_targetSurface = cgmMeta.validateObjArg(self.d_kws['targetSurface'],mayaType='nurbsSurface',noneValid=False)
	    self.mi_orientation = cgmValid.simpleOrientation( self.d_kws['orientation'] )
	    self._str_funcCombined = self._str_funcCombined + "(%s,%s)"%(self.mi_obj.p_nameShort,self.mi_targetSurface.p_nameShort)
	    
	    self.l_shapes = mc.listRelatives(self.mi_targetSurface.mNode,shapes=True)
	    if len(self.l_shapes)>1:
		log.debug( "More than one shape found. Using 0. targetSurface : %s | shapes: %s"%(self.mi_targetSurface.p_nameShort,self.l_shapes) )
	    self.mi_shape = cgmMeta.validateObjArg(self.l_shapes[0],cgmMeta.cgmNode,noneValid=False)
	    self.b_createControlLoc = cgmValid.boolArg(self.d_kws['createControlLoc'],calledFrom=self._str_funcCombined)
	    self.b_createUpLoc = cgmValid.boolArg(self.d_kws['createUpLoc'],calledFrom=self._str_funcCombined)
	    self.b_parentToFollowGroup = cgmValid.boolArg(self.d_kws['parentToFollowGroup'],calledFrom=self._str_funcCombined)
	    self.b_attachControlLoc = cgmValid.boolArg(self.d_kws['attachControlLoc'],calledFrom=self._str_funcCombined)
	    self.b_connectOffset = cgmValid.boolArg(self.d_kws['connectOffset'],calledFrom=self._str_funcCombined)
	    self.b_pointAttach = cgmValid.boolArg(self.d_kws['pointAttach'],calledFrom=self._str_funcCombined)
	    
	    self.f_offset = cgmValid.valueArg(self.d_kws['f_offset'], calledFrom=self._str_funcCombined)
	    #Get info ============================================================================
	    self.d_closestInfo = distance.returnClosestPointOnSurfaceInfo(self.mi_obj.mNode,self.mi_targetSurface.mNode)
	    
	    #Running Lists ============================================================================
	    self.md_return = {}
示例#3
0
Rig.registerControl('pelvis_anim')
l_joints = mc.ls(sl=True)
s = cgmMeta.cgmAttr('pelvis_surfaceJoint', 'scaleX')
s.p_hidden = False
curves.createControlCurve('semiSphere', 10, 'z-')
attributes.doSetAttr('closestPointOnSurface1', 'inPostionX', 5)
mc.setAttr('closestPointOnSurface1.inPostionX', 5)
m1 = cgmPM.cgmModule(name='test')
m1 = cgmMeta.cgmNode('spine_part')
m1.setState('skeleton', forceNew=True)
m1.rigNull.skinJoints
m1.getModuleColors()
m1.getPartNameBase()
m1.modulePuppet.getGeo()
targetObj = mc.ls(sl=True)[0]
distance.returnClosestPointOnSurfaceInfo(targetObj, 'test_controlSurface')
distance.returnClosestUV(targetObj, 'test_controlSurface')
log.info(a)
nodes.createFollicleOnMesh('spine_controlSurface', 'test')
locators.locMeClosestUVOnSurface(mc.ls(sl=True)[0],
                                 'test_controlSurface',
                                 pivotOnSurfaceOnly=False)

mesh = 'Morphy_Body_GEO'
i_obj = cgmMeta.cgmObject('hips_anim')
mControlFactory.returnBaseControlSize(i_obj, mesh, axis=['x', 'y', 'z-'])
mControlFactory.returnBaseControlSize(i_obj, mesh, axis=['z-'])

mc.softSelect(softSelectEnabled=True)
mc.softSelect(q=True, softSelectDistance=True)
mc.softSelect(q=True, softSelectUVDistance=True)
l_joints = mc.ls(sl=True)

s = cgmMeta.cgmAttr('pelvis_surfaceJoint','scaleX')
s.p_hidden = False
curves.createControlCurve('semiSphere',10,'z-')
attributes.doSetAttr('closestPointOnSurface1','inPostionX',5)
mc.setAttr('closestPointOnSurface1.inPostionX',5)
m1 = cgmPM.cgmModule(name = 'test')
m1 = cgmMeta.cgmNode('spine_part')
m1.setState('skeleton',forceNew = True)
m1.rigNull.skinJoints
m1.getModuleColors()
m1.getPartNameBase()
m1.modulePuppet.getGeo()
targetObj = mc.ls(sl=True)[0]
distance.returnClosestPointOnSurfaceInfo(targetObj,'test_controlSurface')
distance.returnClosestUV(targetObj,'test_controlSurface')
log.info(a)
nodes.createFollicleOnMesh('spine_controlSurface','test')
locators.locMeClosestUVOnSurface(mc.ls(sl=True)[0], 'test_controlSurface', pivotOnSurfaceOnly = False)


mesh = 'Morphy_Body_GEO'
i_obj = cgmMeta.cgmObject('hips_anim')
mControlFactory.returnBaseControlSize(i_obj, mesh,axis = ['x','y','z-'])
mControlFactory.returnBaseControlSize(i_obj, mesh,axis = ['z-'])

mc.softSelect(softSelectEnabled = True)
mc.softSelect(q = True, softSelectDistance = True)
mc.softSelect(q = True, softSelectUVDistance = True)
mc.softSelect(q = True, softSelectFalloff = 2)