• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python core.objExists函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中pymel.core.objExists函数的典型用法代码示例。如果您正苦于以下问题:Python objExists函数的具体用法?Python objExists怎么用?Python objExists使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了objExists函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: check

    def check(self, *args):
        self.log.insertText("Checking Master Node... \n")
        
        if pm.objExists('master'):
            master_node = pm.PyNode("master")
        else :
            self.log.insertText("  Master Node does not exists \n")
            return False
        
        attrs = ['objectName',
                 'arc_file_path',
                 'arc_file_name',
                 'arc_asset_name',
                 'arc_asset_dept',
                 'arc_asset_version',
                 'ClientAsset']
        
        status = True
        for attr in attrs:
            msg = "%s.%s"%(master_node, attr)
            self.log.insertText("  %s" %(msg.ljust(40, '.')))
            if not pm.objExists('%s.%s'%(master_node, attr)):
                self.log.insertText("FAIL \n")
                status = False
                if master_node not in self.result.getAllItems():
                    self.result.append(master_node)
            else:
                self.log.insertText("OK \n")

        return status
开发者ID:adamfok,项目名称:afok_toolset,代码行数:30,代码来源:asset_check_tool.py


示例2: __restoreShapes__

def __restoreShapes__(elts):

    if elts==None:
        # get each objects from rigShapesSet
        if pmc.objExists('rigShapesSet'):
            elts = pmc.sets('rigShapesSet', query=True)
        fromSelection=False
    else:
        fromSelection=True
    
    if elts:
        for elt in elts:
            if fromSelection:
                atoms = various.getAtoms(elt.getShape(), flat=False)
                for i in range(len(atoms)):
                    try:
                        pmc.move(atoms[i], pmc.PyNode(elt.name()+'_storedShp.cv'+str(i)).get(), absolute=True)
                    except:
                        vp.vPrint('No %s in rigShapesSet set' % (elt.name()+'_storedShp'), 1)
            else:
                if pmc.objExists(elt.name().replace('_storedShp', '')):
                    obj = pmc.PyNode(elt.name().replace('_storedShp', '')).getShape()
                    atoms = various.getAtoms(obj, flat=False)
                    for i in range(len(atoms)):
                        try:
                            pmc.move(atoms[i], pmc.PyNode(elt+'.cv'+str(i)).get(), absolute=True)
                        except:
                            vp.vPrint('No data founded from %s in rigShapesSet set' % elt.name(), 1)
                else:
                    vp.vPrint('Shape %s doesn\'t exist' % elt.name().replace('_storedShp', ''), 1)
开发者ID:loichuss,项目名称:maya,代码行数:30,代码来源:__init__.py


示例3: custom_sets

    def custom_sets(self, *args):
        self.log.clear()
        self.log.insertText('Create Custom Sets...\n')
        self.log.insertText('\nFind all controls under the groups: \n  "Placer", "rig_arc", and "Face_UI|Panels"\n\nGenerate two sets as result : \n  "ctrlSet" contains all tagged controls\n  "_NON_TAGGED_CURVES" contains all non-tagged controls\n')
                
        ctrlSets = pm.ls("*ctrlSet")
        if not ctrlSets:
            self.controlSet = pm.sets(empty=True, name = "ctrlSet")
        
        grps = [grp for grp in ['Placer', 'rig_arc'] if pm.objExists(grp)]
        pm.select(grps, hi=True)
        all_curve = pm.ls(sl=True, type="nurbsCurve")
        pm.select(clear=True)

        all_ctrl = [ctrl.getParent() for ctrl in all_curve]
        
        if pm.objExists('Panels'):
            pm.select('Panels', hi=True)
            all_facial_curve = pm.ls(sl=True, type="nurbsCurve")
            pm.select(clear=True)
            all_ctrl.extend([curve.getParent() for curve in all_facial_curve if curve.getParent().tz.isLocked()]) 
            #pm.sets(all_ctrl, name="_ALL_CURVES")
        
        no_tags = [ctrl for ctrl in all_ctrl if not pm.attributeQuery ('ClientAnimCtrl', node= ctrl, ex=True)]
        pm.sets(no_tags, name="_NON_TAGGED_CURVES")
        
        tags = [ctrl for ctrl in all_ctrl if pm.attributeQuery ('ClientAnimCtrl', node= ctrl, ex=True)]
        self.controlSet.addMembers(tags)
开发者ID:adamfok,项目名称:afok_toolset,代码行数:28,代码来源:asset_check_tool.py


示例4: locInst_locSel

 def locInst_locSel(self):
     '''
     Function: Takes a locator and instances it's target (set as an extra attr)
     Then sets the location of the instance.
     If the instance already exists it uses that
     Returns: None
     '''
     locs = pm.ls(sl=True)
     grp_name = "_".join(locs[0].getParent().split('_')[:-2])+"_INST_GRP"
     print grp_name
     print pm.objExists(grp_name)
     if pm.objExists(grp_name): pm.PyNode(grp_name)
     else: grp=pm.group(em=True, n=grp_name)
     
     for loc in locs:
         #if the target isn't an instance create it
         targetExists = pm.ls(loc.target.get().split('_')[:-1][0]!='GEO', r=True, type='transform')[0]
         instanceExists = pm.ls(loc.target.get().split('_')[:-1][0]!='INST', r=True, type='transform')[0]
         if not instanceExists and targetExists:
             matchObj = pm.ls(loc.target.get(), r=True, type='transform')[0]
             instance = pm.instance(matchObj, n=('_'.join(matchObj.split('_')[:-1])+'_INST'))[0]
             #set the target to the new instance since it was created
             loc.target.set(instance)
         
         elif pm.objExists(loc.target.get()) and pm.objExists('_'.join(target.split('_')[:-1])+'_INST'):
             pm.error('Neither a GEO nor an INST object exists with this name')
         #otherwise initialize the instance variable    
         else: instance = pm.PyNode('_'.join(arg.split('_')[:-1])+'_INST')
         loc.t.connect( instance.t )
         loc.r.connect( instance.r )
         loc.s.connect( instance.s )
         instance.setParent(grp)
开发者ID:AndresMWeber,项目名称:aw,代码行数:32,代码来源:aw_locators.py


示例5: create_wireframe_rl

def create_wireframe_rl(name="wireframe"):
    """
    Creates wireframe material
    Creates wireframe layer
    Adds all geometry and rendercam to the renderlayer
    
    @param name: str layername
    """
    mat_name = "%s_mat" % name

    if not pm.objExists(mat_name):        
        material_node = pm.shadingNode("lambert", n=mat_name, asShader=True)
        material_node.setColor([1, 1, 1])
        
        material_sg_node = pm.sets(renderable=True, noSurfaceShader=True, empty=True, name="%sSG" % mat_name)
        material_sg_node.miContourEnable.set(1)
        material_sg_node.miContourColor.set([0,0,0])
        material_sg_node.miContourWidth.set(1.5)
        material_node.outColor >> material_sg_node.surfaceShader
        
        if not pm.objExists(name):
            render_layer = pm.createRenderLayer(n=name)
            render_layer.setCurrent()
            render_layer.addMembers(pm.ls(geometry=True, cameras=True))
            material_sg_node.message >> render_layer.shadingGroupOverride
开发者ID:borgfriend,项目名称:MayaTools,代码行数:25,代码来源:mr_wireframe.py


示例6: create_control

def create_control(control, module):
    """ Creates a control for the rig, checking for existing controls or creating
    Args:
        control (str, pm.nt.Transform): can be anything really, just as long as it exists
    Returns:
        (pm.nt.Transform): the resulting transform of the control
    """
    is_new = False
    # Check if default control was created
    if pm.objExists('grow_CTRL') and not pm.objExists(control):
        control = pm.PyNode('grow_CTRL')
    
    # Create the control if control doesn't exist
    elif not pm.objExists(control):
        control = pm.circle(n='grow_CTRL')
        # Flat control in Y...
        control[1].normalY.set(1)
        control[1].normalZ.set(0)
        control = control[0]
        is_new = True
        
    # If it's a string and we weren't passed a PyNode we need to check existing nodes
    elif isinstance(control, basestring):
        control = pm.PyNode(control)
        
    setup_control_global_attrs(control, module)
    
    return control, is_new
开发者ID:AndresMWeber,项目名称:aw,代码行数:28,代码来源:create_extrudes_and_connect.py


示例7: loadDeformerWeights

def loadDeformerWeights(filename=None):
	'''
	Usage:
		loadDeformerWeights(filename='/jobs/mercedesFable_5402587/build/charTortoise/maya/export/WEIGHTS/tortoiseAFacial/extraWeights/deformerWeights/v03/deformerWeights.json')
		loadDeformerWeights()
	'''
	if not filename:
		try:
			filename = pm.fileDialog2(cap='Select a json file you stored', fm=1, okc='Load', ff='JSON (*.json)')[0]
		except:
			pm.error('file not found, whatever.')
	with open(filename, 'rb') as fp:
		data = json.load(fp)
		for key in data.keys():
			if pm.objExists(key):
				deformer = Deformer(pm.PyNode(key))
				print 'Loading weights for deformer:\t%s'%deformer
				for deformedShape in data[key].keys():
					if pm.objExists(deformedShape):
						print '\tLoading deformer weights on shape:\t%s'%deformedShape
						deformedTransform = pm.PyNode(deformedShape).getParent()
						#print data[key][deformedShape]
						deformer.setWeights(data[key][deformedShape], deformedTransform)
					else:
						pm.warning('Object %s does not exist to apply deformer weights to...skipping'%deformedShape)
			else:
				pm.warning('Deformer %s doesn\'t exist...skipping'%key)
开发者ID:creuter23,项目名称:tools,代码行数:27,代码来源:lib_deformer.py


示例8: test_clusterPlane

    def test_clusterPlane(self):
        fr = FollowRibbon.FollowRibbon(name="blah")
        plane = pm.nurbsPlane(axis=[0, 1, 0], patchesU=8, patchesV=1, lengthRatio=0.1, ch=0)[0]
        ctrls = []
        ctrls.append(pm.circle(n="blah_ctrl_01")[0].name())
        ctrls.append(pm.circle(n="blah_ctrl_02")[0].name())
        mainGrp = pm.group(em=1, name="main")

        result = fr._clusterPlane(plane=plane, controls=ctrls, mainGrp="main")

        self.testLib.assertListEqual(result, ["blah_cluster_01Handle", "blah_cluster_02Handle"])
        self.assertTrue(pm.objExists("blah_cluster_01"))
        self.assertTrue(pm.objExists("blah_cluster_02"))

        self.assertTrue(pm.listRelatives(result[0], parent=True), "main")
        self.assertTrue(pm.listRelatives(result[1], parent=True), "main")

        self.assertTrue(pm.listRelatives(result[0], parent=1)[0], "blah_ctrlsGrp")
        self.assertTrue(pm.listRelatives(result[1], parent=1)[0], "blah_ctrlsGrp")

        hist = pm.listHistory(plane)
        hitA = 0
        hitB = 0
        for each in hist:
            if each.name() == "blah_cluster_01":
                hitA = 1
            if each.name() == "blah_cluster_02":
                hitB = 1
        self.assertTrue(hitA)
        self.assertTrue(hitB)

        self.assertTrue(pm.isConnected("blah_ctrl_01.translate", "blah_cluster_01Handle.translate"))
        self.assertTrue(pm.isConnected("blah_ctrl_02.translate", "blah_cluster_02Handle.translate"))
开发者ID:Mauricio3000,项目名称:MSH_Maya,代码行数:33,代码来源:test_FollowRibbon.py


示例9: dictToDatas

    def dictToDatas(self, dict_datas):

        """
        [email protected] Get dict datas of skinCluster and push datas to class variables.
        This function is for import.
        """

        if not dict_datas:
            raise RuntimeError("\n\tDict datas is empty or invalid !!!\n")

        #   Check if skin node exists
        #   If skin node doesn't exist set variable with string name
        if pmc.objExists(dict_datas["SKIN_NODE"]):
            self.SKIN_NODE = pmc.PyNode(dict_datas["SKIN_NODE"])
        else:
            self.SKIN_NODE = dict_datas["SKIN_NODE"]

        #   Check if shape node exists
        #   If shape node doesn't exist set variable with string name
        if pmc.objExists(dict_datas["SHAPE"]):
            self.SHAPE = pmc.PyNode(dict_datas["SHAPE"])
        else:
            self.SHAPE = dict_datas["SHAPE"]

        #   Set skin datas
        self.INFLUENCES = dict_datas["INFLUENCES"]
        self.WEIGHTS = dict_datas["WEIGHTS"]
        self.MAX_INFLUENCES = dict_datas["MAX_INFLUENCES"]
        self.MAINTAIN_MAX_INFLUENCES = dict_datas["MAINTAIN_MAX_INFLUENCES"]
        self.SKINNING_METHOD = dict_datas["SKINNING_METHOD"]
        self.USE_COMPONENTS = dict_datas["USE_COMPONENTS"]
        self.BIND_PRE_MATRIX = dict_datas["BIND_PRE_MATRIX"]
        self.BASE_POINT = dict_datas["BASE_POINT"]
开发者ID:AtonLerin,项目名称:Maya_Tools,代码行数:33,代码来源:skinTools.py


示例10: _create_deformers_

    def _create_deformers_(self):
        # Setup missing geo shapes dictionary
        missing_shapes = {}
        # Build in the order of blendshapes
        for blendshape in libXml.list_persist(self.import_data["Order"]):
            # Check if the blendshapes exists. If so create one.
            shapes = libXml.list_persist(self.import_data["Data"][blendshape])
            if not pm.objExists(blendshape):
                # Read info for each blendshape
                # select select the shapes.
                pm.select(cl=1)
                for shape in shapes:
                    # Check the shape exists
                    if pm.objExists(shape):
                        # Add to the selection
                        pm.select(shape, add=1)
                    else:
                        # If not then then add to error list dictionary
                        if missing_shapes.has_key(blendshape):
                            missing_shapes[blendshape].append(shape)
                        else:
                            missing_shapes[blendshape] = [shape]
                # Select the target geo and create blendshape
                pm.select(self.target, add=1)
                pm.blendShape(name=blendshape)

        if len(missing_shapes):
            print "#######The following blends had missing shapes#######"
            for key in missing_shapes.keys():
                print key.upper()
                libUtilities.print_list(missing_shapes[key])
开发者ID:mds-dev,项目名称:mds_repository,代码行数:31,代码来源:libWeights.py


示例11: create_module

def create_module(name):
    """ Creates a top group from an object name
        For now, just dummy checking if the suffix is all caps
    Args:
        name (str): name to parse or use
    Returns (pm.nt.Transform): resulting group node
    """
    module = {}
    if name.split('_')[-1].isupper():
        name = '_'.join( name.split('_')[:-1] )
    
    grp_name = '%s_GRP'%name
    if pm.objExists(name):
        top_group = pm.PyNode(name)
    elif pm.objExists(grp_name):
        top_group = pm.PyNode(grp_name)
    else:
        top_group = pm.group(em=True, n='%s_GRP'%name)
    
    module['top_group'] = top_group
    
    for subgroup in ['skeleton','model','parts','controls']:
        subgroup_name = '%s_%s_GRP'%(name, subgroup)
        if not pm.objExists(subgroup_name):
            module[subgroup] = pm.group(em=True, n=subgroup_name)
            module[subgroup].setParent(top_group)
            top_group.addAttr('%s_vis'%subgroup,
                              at='long',
                              k=True,
                              dv=1, min=0, max=1)
            top_group.attr('%s_vis'%subgroup).connect(module[subgroup].visibility)
        else:
            module[subgroup] = pm.PyNode(subgroup_name)
    
    return module
开发者ID:AndresMWeber,项目名称:aw,代码行数:35,代码来源:create_extrudes_and_connect.py


示例12: _prep

	def _prep(self,args):
		basename=self.inputName.getText()
		nparticle=pm.ls(sl=True)[0]
		if not pm.objExists(self.inputBar.getText()):
			pm.error ('GEO plane doesn\'t exist')
		geo = pm.PyNode(self.inputBar.getText())
		if not isinstance(nparticle.getShape(), pm.nt.NParticle):
			pm.error('Your selection is not an nParticle object')
        #create an instancer
		tempCube=pm.polyCube(n='temp_iinst_GEO',w=.01,h=.01,d=.01,ch=0)
		

		self.instancer=pm.PyNode(pm.particleInstancer(nparticle,name=(nparticle.name().replace('_NPARTICLE','_INSTANCER')),addObject=True,object=tempCube[0],cycleStep=1,cycleStepUnits='Frames',levelOfDetail='Geometry',rotationUnits='Degrees',rotationOrder='XYZ',position='worldPosition',rotation='rotPP',scale='scalePP',objectIndex='indexPP'))

		pm.delete(tempCube)
		#group the nparticle + instancer
		group=pm.group(n=(nparticle.name().replace('_NPATICLE','_lodA_GRP')))
		nparticle.setParent(group)
		self.instancer.setParent(group)
        #nCache itR
		
		if not pm.objExists( nparticle.name().replace('_NPARTICLE','_NUCLEUS') ):
			pm.error('Nucleus doesn\'t exist!')
		nucleus = nparticle.name().replace('_NPARTICLE','_NUCLEUS')
        #delete everything unnecessary that might cause issues
		print geo, nucleus
		print 'issue?'
		pm.delete(geo, nucleus)
		print 'issue?'
		pm.select(nparticle)
		mm.eval('performCreateNclothCache 1 \"add\";')
		pm.confirmDialog(m='WARNING, DO NOT SAVE AFTER THIS STEP',t='DONT SAVE!')
开发者ID:AndresMWeber,项目名称:aw,代码行数:32,代码来源:aw_scatterParticle.py


示例13: createObjectSet

def createObjectSet(setName, objLst = [], exclusiveness = False, partition = None, increment = False):
    '''
    create an objectSet.
    @param    setName           string         :    This objectSet's name.
    @param    objLst            list           :    Objects which belongs this objectSet.
    @param    exclusiveness     bool           :    Whether is this objectSet mutually exclusive with another objectSet in one partition.
    @param    partition         node or string :    When exclusiveness flag is True, partitin should be assigned a partition node. Ignore when exclusiveness flag is False.
    @param    increment         bool           :    Whether to use the existed one or create an increment one When the named objectSet has been existed.
                                                    If the existed objectSet will be used, ignore exclusiveness flag and partition flag.
    @result                     node 
    '''
    useExisted = False
    if not pm.objExists(setName):
        objSet = pm.sets(em=1, name = setName)
    elif pm.objExists(setName) and increment :
        setName = name.compileNodeName(setName)
        objSet = pm.sets(em=1, name = setName)
    else:
        objSet = pm.PyNode(setName)
        useExisted = True
        
    if not useExisted and exclusiveness :
        partition.addMember(objSet)
    
    if objLst:
        #objSet.addMembers(objLst)
        pm.sets(objSet, e=1, forceElement = objLst)
    
    return objSet
开发者ID:TianD,项目名称:TianD_KX_TOOL,代码行数:29,代码来源:objSet.py


示例14: __restorePosingRIG__

def __restorePosingRIG__(elts):

    if elts==None:
        # get each objects from rigShapesSet
        if pmc.objExists('RIG_bindPose'):
            elts = pmc.sets('RIG_bindPose', query=True)
        fromSelection=False
    else:
        fromSelection=True
    
    if elts:
        for elt in elts:
            if fromSelection:
                if pmc.objExists(elt.name()+'_storedPos'):
                    obj = elt.name()+'_storedPos'
                    attrs = pmc.listAttr(elt, keyable=True)
                    for i in range(len(attrs)):
                        try:
                            pmc.PyNode(elt+'.'+attrs[i]).set(pmc.PyNode(obj+'.'+attrs[i]+'_stored').get())
                        except:
                            vp.vPrint('No data founded from %s in rigPosingSet set' % elt.name(), 1)
                else:
                    vp.vPrint('Object %s doesn\'t exist' % (elt.name()+'_storedPos'), 1)
            else:
                if pmc.objExists(elt.name().replace('_storedPos', '')):
                    obj = pmc.PyNode(elt.name().replace('_storedPos', ''))
                    attrs = pmc.listAttr(obj, keyable=True)
                    for i in range(len(attrs)):
                        try:
                            pmc.PyNode(obj+'.'+attrs[i]).set(pmc.PyNode(elt+'.'+attrs[i]+'_stored').get())
                             
                        except:
                            vp.vPrint('No data founded from %s in rigPosingSet set' % elt.name(), 1)
                else:
                    vp.vPrint('Object %s doesn\'t exist' % elt.name().replace('_storedPos', ''), 1)
开发者ID:loichuss,项目名称:maya,代码行数:35,代码来源:__init__.py


示例15: createHierarchy

def createHierarchy():
    """hierarchy construction"""
    
    gp = {}
    
    # create groups
    grps = [['TEMPLATES'], ['BDD'], ['PERSO'], ['SKINSKEL'], ['ADDITIVERIG'], ['ANIMATION'], ['TODELETE'], ['SETUP','PERSO|'], ['SCALEOFFSET','PERSO|SETUP|'], ['NOXFORM','PERSO|SETUP|']]
    for grp in grps:
        
        # create the absolute path
        tmpName = '|'
        for i in reversed(range(len(grp))):
            tmpName += grp[i]
        
        # check if the object exist
        if pmc.objExists(tmpName):
            gp[grp[0]] = pmc.PyNode(tmpName)
        else:
            gp[grp[0]] = pmc.createNode('transform', name=grp[0], skipSelect=True)
            if len(grp)==2:
                gp[grp[0]].setParent(grp[1])
                clean.__lockHideTransform__(gp[grp[0]], channel=['v'])
    
    
    # uncheck inherits transform
    gp['BDD'].inheritsTransform.set(False)
    gp['NOXFORM'].inheritsTransform.set(False)
    
    
    # create scale offset attribut
    if gp['SCALEOFFSET'].hasAttr('scaleOffset')==False:
        pmc.addAttr(gp['SCALEOFFSET'], longName='scaleOffset', attributeType='float', defaultValue=1.0, keyable=True )
    
    # connect the scale offset attribut into the scale
    clean.__lockHideTransform__(gp['SCALEOFFSET'], channel=['s'], lock=False)
    if len(gp['SCALEOFFSET'].sx.inputs(plugs=True))==0:
        gp['SCALEOFFSET'].scaleOffset >> gp['SCALEOFFSET'].sx
    if len(gp['SCALEOFFSET'].sy.inputs(plugs=True))==0:
        gp['SCALEOFFSET'].scaleOffset >> gp['SCALEOFFSET'].sy
    if len(gp['SCALEOFFSET'].sz.inputs(plugs=True))==0:
        gp['SCALEOFFSET'].scaleOffset >> gp['SCALEOFFSET'].sz
    
    
    # hide and lock attribut
    for key in gp.keys():
        clean.__lockHideTransform__(gp[key], channel=['t', 'r', 's'])
    
    
    # create set
    pmc.select(clear=True)
    sets = ['CONTROLS']
    for set in sets:
        if pmc.objExists(set)==False:
            gp[set] = pmc.sets(name=set)
        else:
            gp[set] = pmc.nodetypes.ObjectSet('CONTROLS')
    
    return gp
开发者ID:loichuss,项目名称:maya,代码行数:58,代码来源:hierarchy.py


示例16: cameraHasNoiseApplied

 def cameraHasNoiseApplied(self):
     if self.control:
         if pc.objExists('%s.Seed_T'%self.control) and pc.objExists('%s.Seed_R'%self.control): #check any 2 noise attributes
             noise_status = True
         else:
             noise_status = False
     else:
         noise_status = False
     return noise_status
开发者ID:jricker,项目名称:JR_Maya,代码行数:9,代码来源:JR_camera_shake.py


示例17: assign_killz

def assign_killz():
	sel=pm.ls(sl=True)
	#load shaders 
	if not pm.objExists("HELMET"):
		cmds.file("/mpc/mayors1/playstationKillzone4_5402105/pantry/bodies/vsa_infantry_shaders.ma",i=True,type='mayaAscii', ignoreVersion=True, rpr="vsa_infantry_shaders", options='v=0',loadReferenceDepth='all')
	if not pm.objExists("PLASTIC_LIGHT"):
		cmds.file("/mpc/mayors1/playstationKillzone4_5402105/pantry/bodies/hgh_infantry_shaders.ma",i=True,type='mayaAscii', ignoreVersion=True, rpr="hgh_infantry_shaders", options='v=0',loadReferenceDepth='all')
	assignments_keys=[chkObjNs('*vsa_security_trooper_helmet*'),
	                  chkObjNs('*vsa_security_trooper_glasses'),
	                  chkObjNs('*vsa_security_trooper_visor'),
	                  chkObjNs('*VSA_Infantry_Body_L*'),
	                  chkObjNs('*VSA_Infantry_Markers_L*'),
	                  chkObjNs('*VSA_Infantry_Marker_Lights_L*'),
	                  chkObjNs('*head*l*'),
	                  chkObjNs('*head_anthony_trooper_l*'),
	                  chkObjNs('*heads_GEO*'),
	                  chkObjNs('HGH_specOps_class_bodies_GRP'),
	                  chkObjNs('HGH_support_class_bodies_GRP'),
	                  chkObjNs('HGH_specOps_*_GRP'),
	                  chkObjNs('HGH_support_*_GRP'),
	                  chkObjNs('first_layer'),
	                  chkObjNs('second_layer'),
	                  chkObjNs('edges'),
	                  chkObjNs('*eyes_glowing*'),
	                  chkObjNs('*screen_back_L*'),
	                  chkObjNs('*single_led_back*'),
	                  chkObjNs('*Light_L*'),
	                  chkObjNs('*round_gridlights*')]
	assignments={chkObjNs('*vsa_security_trooper_helmet*'):'HELMET',
		 chkObjNs('*vsa_security_trooper_glasses'):'VISOR',
		 chkObjNs('*vsa_security_trooper_visor'):'VISOR',
		 chkObjNs('*VSA_Infantry_Body_L*'):'BODY',
		 chkObjNs('*VSA_Infantry_Markers_L*'):'lambert1',
		 chkObjNs('*VSA_Infantry_Marker_Lights_L*'):'lambert1',
		 chkObjNs('*head*l*'):'FACE',
		 chkObjNs('*head_anthony_trooper_l*'):'FACE',
		 chkObjNs('*heads_GEO*'):'FACE',
		 chkObjNs('HGH_specOps_class_bodies_GRP'):'HGH_SpecOp_BODY',
		 chkObjNs('HGH_support_class_bodies_GRP'):'HGH_Engineer_BODY',
		 chkObjNs('HGH_specOps_*_GRP'):'HGH_SpecOp_BODY',
		 chkObjNs('HGH_support_*_GRP'):'HGH_Engineer_BODY',
		 chkObjNs('first_layer'):'HGH_Engineer_BODY',
		 chkObjNs('second_layer'):'HGH_Engineer_BODY',
		 chkObjNs('edges'):'HGH_Engineer_BODY',
		 chkObjNs('*eyes_glowing*'):'PLASTIC_LIGHT',
		 chkObjNs('*screen_back_L*'):'PLASTIC_LIGHT',
		 chkObjNs('*single_led_back*'):'PLASTIC_LIGHT',
		 chkObjNs('*Light_L*'):'PLASTIC_LIGHT',
		 chkObjNs('*round_gridlights*'):'PLASTIC_LIGHT'}
	print assignments
	for obj in assignments_keys:
		if not obj == "":
			print 'Assigning shader %s to object %s' % ( assignments[obj], obj)
			objs = pm.ls(obj)
			print objs
			pm.select(objs,r=True)
			pm.hyperShade(obj, a=assignments[obj])
开发者ID:AndresMWeber,项目名称:jobScripts,代码行数:57,代码来源:multi_assign_bodies_shaders.py


示例18: _targetMatch

 def _targetMatch(self, *args):
     args=pm.ls(sl=True)
     for arg in args:
         if pm.objExists(arg+'.target'):
             tgt= pm.PyNode(arg.target.get())
         elif pm.objExists(nami.replaceSuffix(arg+'GEO')): tgt = pm.PyNode(arg.target.get())
         else:
             print 'Couldn\'t find target for object: %s ...skipping' % arg
             break
         posi.matchPos(arg, [tgt], 1)
开发者ID:creuter23,项目名称:tools,代码行数:10,代码来源:aw_transform.py


示例19: rig_makeBlockGeo

def rig_makeBlockGeo(geometry, mpcStyle=False):
	'''Uses the MPC block geo script to create automaded block geo out of one selected object which is properly constrained.
	Args:
		geometry (pm.PyNode): poly mesh to be broken apart
		mpcStyle (boolean): replaces the suffix based on JNT and GEO
	Returns (list[pm.PyNode]): List of proxies that were generated
	Example Usage:
		rig_makeBlockGeo()
	'''
	#convert the list to a mel list as a string to pass
	command = 'rig_makeBlockGeo ({{"{MESHES}"}},"");'.format(MESHES=geometry)
	print command
	proxies = mel.eval(command)
	
	if len(proxies):
		#Time to sort them and order them + constrain them
		if not pm.objExists('proxy_GRP'):
			prx_grp = pm.group(em=True, n='proxy_GRP')
		else:
			prx_grp = pm.PyNode('proxy_GRP')
		
	if pm.objExists('model_GRP'):
		prx_grp.setParent('model_GRP')
		if pm.objExists('globalCon_GRP'):
			pm.scaleConstraint('globalCon_GRP', prx_grp, mo=True)
	final={}
	
	proxy_grp = geometry.replace('GEO','PROXY_GRP')
	if not pm.objExists(proxy_grp):
		proxy_grp=pm.group(em=True,n=proxy_grp)
	else:
		proxy_grp=pm.PyNode(proxy_grp)
	proxy_grp.setParent(prx_grp)
	
	for proxy in proxies:
		if mpcStyle:
			proxy=pm.PyNode(proxy)
			pm.polySoftEdge(proxy, a=0, ch=0)
			jnt = proxy.name().replace('_GEO','')
			print proxy.name().replace('_GEO','')
			print proxy.name().replace('GEO','JNT')
			if pm.objExists(proxy.replace('GEO','JNT')):
				jnt = proxy.replace('GEO','JNT')
			pm.parentConstraint(jnt, proxy, mo=True)
			proxy.setParent(proxy_grp)
			proxy.rename(geometry+'_'+proxy.replace('GEO','PROXY'))
			print 'adding joint'
			final[proxy]=jnt
		else:
			proxy=pm.PyNode(proxy)
			pm.polySoftEdge(proxy, a=0, ch=0)
			proxy.rename(proxy.replace('GEO','PROXY'))
			final[proxy]=proxy.replace('_PROXY', '')
	return final
开发者ID:AndresMWeber,项目名称:aw,代码行数:54,代码来源:lib_mpc.py


示例20: setExpression

	def setExpression(self):
		if pm.objExists('olp_intervalsPerOrbits_expression'):
			pm.delete('olp_intervalsPerOrbits_expression')
		if pm.objExists('olp_orbits_expression'):
			pm.delete('olp_orbits_expression')
		
		interv_int = self.interv_int.value()
		orbit_int = self.orbit_int.value()

		intervExpression = pm.expression(o=rigInterv, n='olp_intervalsPerOrbits_expression', s='rx = frame * (360/{0}.000);'.format(interv_int))
		if_block = 'rz = (frame/{0}) * ((360/{1}.000)/2.000);'.format(interv_int, orbit_int)
		orbitExpression = pm.expression(o=rigOrbit, n='olp_orbits_expression', s='if (frame%{0} == 0) {1}'.format(interv_int, if_block))
开发者ID:Huston94,项目名称:Orbital_Light_Previewer,代码行数:12,代码来源:orbitLights_UI.py



注:本文中的pymel.core.objExists函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python core.optionMenu函数代码示例发布时间:2022-05-27
下一篇:
Python core.nodeType函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap