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

Python cmds.hyperShade函数代码示例

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

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



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

示例1: convert_area_light

def convert_area_light(area_light, attributes):
    # create and initialise material for object
    light_material = cmds.createNode("ms_appleseed_material", n=area_light + "_material")
    cmds.setAttr(light_material + ".enable_back_material", 0)
    cmds.setAttr(light_material + ".duplicate_front_attributes_on_back", 0)

    # create and initialise surface shader
    light_surface_shader = ms_commands.create_shading_node("constant_surface_shader", area_light + "_surface_shader")
    cmds.setAttr(light_surface_shader + ".alpha_multiplier", 0, 0, 0, type="double3")

    # create and initialise edf
    light_edf = ms_commands.create_shading_node("diffuse_edf", area_light + "_edf")
    cmds.setAttr(
        light_edf + ".exitance", attributes["color"][0], attributes["color"][1], attributes["color"][2], type="double3"
    )
    cmds.setAttr(
        light_edf + ".exitance_multiplier",
        attributes["multiplier"],
        attributes["multiplier"],
        attributes["multiplier"],
        type="double3",
    )

    # assign material and connect up nodes
    cmds.select(area_light)
    cmds.hyperShade(assign=light_material)
    cmds.connectAttr(light_edf + ".outColor", light_material + ".EDF_front_color", f=True)
    cmds.connectAttr(light_surface_shader + ".outColor", light_material + ".surface_shader_front_color", f=True)
开发者ID:dictoon,项目名称:mescaline_utils,代码行数:28,代码来源:mescaline_setup.py


示例2: __init__

 def __init__(self, name, index):
     #these will need to be actual data, and update as you move the object in the world
     self.m_name = name
     self.m_index = index
     #self.m_scale = (1, 1, 0) #we shouldn't really work with scale
     #self.m_position = (0, 0, 0)
     #self.m_width = 100#we could instead use scale and just let them scale instead of drag vertex
     #self.m_height = 100#then we could just calcualte width and height from base w/h and multiple by scale
     #probably the better idea then to let them move around the vertecies
     tempCube = cmds.polyCube(n = name, w = 100, h = 100, d = 0)[0]
     cmds.rotate(0, 90, 0, r=True, os=True)
     self.m_cube = tempCube
     self.m_layout = []
     self.m_effectNumber = -1
     if 'Attack' in self.m_name:
         self.b_isAttack = True
         self.m_effectNumber = 0
     else:
         self.b_isAttack = False
     #self.addUI()
     #red or blue based off of type of box
     lambert = cmds.shadingNode('lambert', asShader=True) 
     cmds.select(self.m_cube)
     if "Attack" in self.m_name:
         cmds.setAttr ( (lambert + '.color'), 1.0, 0.0, 0.0, type = 'double3' )
     else :
         cmds.setAttr ( (lambert + '.color'), 0.0, 0.0, 1.0, type = 'double3' )
         
     cmds.setAttr ( (lambert + '.transparency'), 0.90,0.90,0.90, type= 'double3' )
     
     cmds.hyperShade( assign=lambert )
开发者ID:tp2124,项目名称:SwirvSwagYolo,代码行数:31,代码来源:HitBox_AttackBox.py


示例3: consolidateShaders

def consolidateShaders(mainMat_sel):

    mainMatSG = None
    matList = cmds.ls(materials=True, r=True)

    mainMatSplit = mainMat_sel.split(":")
    mainMat = mainMatSplit[-1]
    try:
        tmpList = cmds.listConnections(mainMat_sel)
        
        mainSplit = mainMat_sel.split(":")
        matVal = mainSplit[-1]
            
        for t in tmpList:
            if re.search("SG",t):
                mainMatSG = t
                break
                
        matList.sort()
        
        if mainMatSG != None:
            for m in matList:
                if m.split(":")[-1] == matVal:
                    cmds.select(m)
                    cmds.hyperShade(objects="")
                    cmds.sets( e=True, forceElement= mainMatSG )
                    
                    if m != mainMat_sel:
                        cmds.delete(m)
    except:
        pass
开发者ID:davidwilliamsDK,项目名称:maya,代码行数:31,代码来源:dsCommonTools.py


示例4: getObjMaterials

def getObjMaterials():
    global remapAndLuminaceNodes
    shadingType = ["blinn", "phong", "RedshiftArchitectural", "aiStandard"]
    displacementShading = ["RedshiftDisplacement", "displacementShader"]
    duplicateMaterials = list()
    selObjsList = cmds.ls(sl=1, tr=1)
    if not selObjsList:
        assert "No object is selected!"
    for obj in selObjsList:
        duplicateNodes = list()
        cmds.select(obj, r=1)
        cmds.hyperShade(smn=1)
        selObjsDuplicateMaterials = cmds.duplicate(un=1)
        for item in selObjsDuplicateMaterials:
            dupliMater = cmds.rename(item, "%s_duplicate" % (item))
            duplicateNodes.append(dupliMater)
        for item in duplicateNodes:
            if cmds.nodeType(item) in shadingType:
                duplicateShading = cmds.sets(r=1, nss=1, em=1, n="%s_SG" % item)
                cmds.connectAttr("%s.outColor" % item, "%s.surfaceShader" % duplicateShading, f=1)
                duplicateMaterials.append(item)
            elif cmds.nodeType(item) == "RedshiftDisplacement":
                conInfo = cmds.connectionInfo("%s.displacementShader" % duplicateShading, sfd=1)
                if not conInfo:
                    cmds.connectAttr("%s.out" % item, "%s.displacementShader" % duplicateShading, f=1)
            elif cmds.nodeType(item) == "displacementShader":
                conInfo = cmds.connectionInfo("%s.displacementShader" % duplicateShading, sfd=1)
                if not conInfo:
                    cmds.connectAttr("%s.displacement" % item, "%s.displacementShader" % duplicateShading, f=1)
        cmds.sets(obj, e=1, fe=duplicateShading)
    cmds.select(selObjsList, r=1)
    return list(set(duplicateMaterials))
开发者ID:chuckbruno,项目名称:remap,代码行数:32,代码来源:RemapAndIllumanceForAllShadings_modify_01.py


示例5: assignShaders

def assignShaders(shadersName):
    
    shaderPath="Y:/TRABAJOS/PECERA_MALVINAS/1_Shot_Related/_ASSETS_GENERALES/04_SHADING/2_EXPORTS/shaders/"    
    #print shadersName
    
    objSelected=cmds.ls(sl=True)
    objFiltered=maya.cmds.listRelatives(objSelected, allDescendents=True, noIntermediate=True, fullPath=True, type="mesh")
    
    for obj in objFiltered:
        
        objName=cmds.listRelatives(obj, parent=True)
        #print objName
        obj= obj.rsplit('|', 1)
        obj=obj[0]
        #print obj[0]
        if '|' in obj[0]:
            obj=obj[1: ]
            attrName=cmds.getAttr("%s.objIdName"%(obj))
            #print attrName.split("_")[0]            
            for shader in shadersName:                
                
                if ".json" in shader and attrName.split("_")[0] in shader:
                    
                    json_data=open(shaderPath+shader).read()
                    jsonList = json.loads(json_data)
                    shaderName= jsonList[attrName]
                    cmds.select(obj)
                    shaderName=shaderName["shader"]
                    cmds.hyperShade(assign=shaderName)
    cmds.select(objSelected)
开发者ID:TDargentina,项目名称:MoshTools,代码行数:30,代码来源:importerTool.py


示例6: linkShaders

	def linkShaders(self, *args):

		links = self.getLinksFromDB()

		if links == None:
			return

		selection = cmds.ls(sl=True)
		if len(selection) > 0:
			selection = cmds.listRelatives(selection, allDescendents=True, noIntermediate=True)

		# If shader file is available import it
		shaderPath = cmds.textFieldButtonGrp("tfbShaderPath", q=True, tx=True)
		if len(shaderPath) > 0:
			cmds.file(shaderPath, i=True)
			cmds.textFieldButtonGrp("tfbShaderPath", e=True, tx="")

		# Link shaders
		for link in links:
			mesh = link[0]
			shader = link[1]

			if cmds.checkBox("cbSubstring", q=True, value=True):
				substring = cmds.textField("tfSubstring", q=True, text=True)
				mesh = substring + mesh

			if cmds.objExists(mesh):
				cmds.select(mesh)
				cmds.hyperShade(assign=shader)
				print "'" + mesh + "' linked"

		print "Finished linking."
开发者ID:Quazo,项目名称:breakingpoint,代码行数:32,代码来源:jf_shaderLinker.py


示例7: hookup_shaders

def hookup_shaders(reference_node):

    hookup_prefix = "SHADER_HOOKUP_"
    shader_hookups = {}
    for node in cmds.ls(type="script"):
        if not node.startswith(hookup_prefix):
            continue
        obj_pattern = node.replace(hookup_prefix, "") + "\d*"
        obj_pattern = "^" + obj_pattern + "$"
        shader = cmds.scriptNode(node, query=True, beforeScript=True)
        shader_hookups[obj_pattern] = shader

    for node in cmds.referenceQuery(reference_node, nodes=True):
        for (obj_pattern, shader) in shader_hookups.iteritems():
            if re.match(obj_pattern, node, re.IGNORECASE):
                # assign the shader to the object
                cmds.file(unloadReference=reference_node, force=True)
                cmds.setAttr(reference_node + ".locked", False)
                cmds.file(loadReference=reference_node)
                cmds.select(node, replace=True)
                cmds.hyperShade(assign=shader)
                cmds.file(unloadReference=reference_node)
                cmds.setAttr(reference_node + ".locked", True)
                cmds.file(loadReference=reference_node)
            else:
                print "NODE: " + node + " doesn't match " + obj_pattern
开发者ID:mkolar,项目名称:maya-look-hookup,代码行数:26,代码来源:maya_look_hookup.py


示例8: setupDomeMatteMaterial

def setupDomeMatteMaterial(applyToMeshName):
  import maya.cmds as cmds
  import maya.mel as mel  

  #Get the selected geometry
  object_selection = applyToMeshName

  domeShaderName = 'dome_crossbounce_matte_material'

  #Create the mia_material + shading group
  dome_mia_shader_group_name = cmds.sets( renderable=True, noSurfaceShader=True, empty=True, name=domeShaderName+'SG' )
  
  #Create a mia_material_x_passes shader
  dome_mia_shader_name = cmds.shadingNode( 'mia_material_x_passes', n=domeShaderName, asShader=True) 

  #Apply the shading group to the selected geometry
  if object_selection:
    print("Applying the "+dome_mia_shader_name+" surface material to:")
    cmds.select(object_selection)
    cmds.hyperShade(assign=dome_mia_shader_group_name)  

  # Set the mia_material to be a matte material
  cmds.setAttr(dome_mia_shader_name+".diffuse", 0.5, 0.5, 0.5, type="double3")
  cmds.setAttr(dome_mia_shader_name+".diffuse_roughness", 0)
  cmds.setAttr(dome_mia_shader_name+".diffuse_weight", 1)
  cmds.setAttr(dome_mia_shader_name+".refl_color", 1, 1, 1, type="double3")
  cmds.setAttr(dome_mia_shader_name+".reflectivity", 0)

  # Connect the mia_material shader to the shading group
  cmds.connectAttr(dome_mia_shader_name+'.message', dome_mia_shader_group_name+'.surfaceShader', f=True)
  cmds.connectAttr(dome_mia_shader_name+'.message', dome_mia_shader_group_name+'.miPhotonShader', f=True)
  cmds.connectAttr(dome_mia_shader_name+'.message', dome_mia_shader_group_name+'.miShadowShader', f=True)
  cmds.connectAttr(dome_mia_shader_name+'.message', dome_mia_shader_group_name+'.miMaterialShader', f=True)
开发者ID:hsnk,项目名称:domemaster-stereo-shader,代码行数:33,代码来源:domeCrossBounce.py


示例9: convert_connection_to_image

def convert_connection_to_image(shader, attribute, dest_file, overwrite, resolution=1024, pass_through=False):

    if os.path.exists(dest_file) and not overwrite:
        return dest_file

    dest_dir = os.path.split(dest_file)[0]

    create_dir(dest_dir)

    plug_name = shader + '.' + attribute

    if not cmds.objExists(plug_name):
        warning('error converting texture, no object named {0} exists'.format(plug_name))
    else:
        connection = cmds.listConnections(plug_name)
        if not connection:
            warning('nothing connected to {0}, skipping conversion'.format(plug_name))
        elif pass_through == True:
            warning('{0}: skipping conversion'.format(plug_name))
        else:
            cmds.hyperShade(objects=shader)
            connected_object = cmds.ls(sl=True)[0]
            cmds.convertSolidTx(connection[0] ,connected_object ,fileImageName=dest_file, antiAlias=True, bm=3, fts=True, sp=True, alpha=True, doubleSided=True, resolutionX=resolution, resolutionY=resolution)

        return dest_file
开发者ID:jonathantopf,项目名称:mayaseed,代码行数:25,代码来源:ms_commands.py


示例10: doRenderRig

	def doRenderRig(self) : 
		path = str(self.ui.path_lineEdit.text())
		texturePath = '%s/textures' % path 
		renderRes = str(self.ui.renderRes_comboBox.currentText())

		facialCore.path = texturePath
		facialCore.res = renderRes

		if mc.objExists(self.defaultHeadName) : 
			# rename 
			mc.rename(self.defaultHeadName, self.renderHeadName)

			# group 
			group = mc.group(em = True, n = self.stillGroup)
			mc.parent(self.renderHeadName, group)

			# render node 
			ltNode = facialCore.makeRenderFacial()

			# create lambert 
			if not mc.objExists(self.renderNode) : 
				vrayMtl = mc.shadingNode('VRayMtl', asShader = True, n = self.renderNode)

			# connect 
			mc.connectAttr('%s.outColor' % ltNode, '%s.color' % vrayMtl, f = True)

			# assign 
			mc.select(self.renderHeadName)
			mc.hyperShade(assign = vrayMtl)

			self.messageBox('Success', 'Set Render Node Complete')

		else : 
			self.messageBox('Warning', '%s not Exists' % self.defaultHeadName)
开发者ID:myCodeTD,项目名称:frozen_facial,代码行数:34,代码来源:app.py


示例11: combineShader

 def combineShader( shaderList ):
     
     cmds.undoInfo( ock=1 )
     
     targetObjs = []
     for shader in shaderList:
         cmds.hyperShade( objects = shader )
         targetObjs += cmds.ls( sl=1 )
     shadingEngines = cmds.listConnections( shaderList, s=0, d=1, type='shadingEngine' )
     if not shadingEngines: return None
     shadingEngines = list( set( shadingEngines ) )
     targetShadingEngine = shadingEngines[0]
     
     cmds.sets( targetObjs, e=1, forceElement = targetShadingEngine )
     
     cmds.delete( shadingEngines[1:] )
     for shader in shaderList:
         shadingEngines = cmds.listConnections( shader, s=0, d=1, type='shadingEngine' )
         if not shadingEngines:
             cmds.delete( shader )
         elif not targetShadingEngine in shadingEngines:
             cmds.delete( shader, shadingEngines )
     
     Window_global.nodeInfomation = {}
     
     cmds.undoInfo( cck=1 )
开发者ID:jonntd,项目名称:mayadev-1,代码行数:26,代码来源:__init__.py


示例12: selectObjectByMaterials

 def selectObjectByMaterials( shaderList ):
     
     targetObjs = []
     for shader in shaderList:
         cmds.hyperShade( objects = shader )
         targetObjs += cmds.ls( sl=1 )
     cmds.select( targetObjs )
开发者ID:jonntd,项目名称:mayadev-1,代码行数:7,代码来源:__init__.py


示例13: importAbcFile

def importAbcFile():
    importFilePath=pm.textField('path_ABC2', q=True, text=True)
    #.abc를 없애준다
    filePathDeletAbc = importFilePath.replace('.abc','')

    pm.importFile( filePathDeletAbc+'.ma' )
    importAbc( filePathDeletAbc+'.abc' )
    connectionsTxtFile_open = open(filePathDeletAbc+'.txt')
    import pickle
    lst = pickle.load(connectionsTxtFile_open)
    print lst
    for geo, shd, aiShd,disShd in lst:
        cmds.select( geo )
        cmds.hyperShade( assign=shd )
        node=pm.ls(geo)[0]
        shape = node.getShape()
        shadingGrps = shape.outputs( type='shadingEngine' )
        print shadingGrps[0]
        shader=pm.ls(aiShd)[0]
        print shader
        try:
            print 'good'
            pm.connectAttr(shader.outColor,shadingGrps[0].aiSurfaceShader) 
        except:
            print 'false'
        try:
            disShader=pm.ls(disShd)[0]
            pm.connectAttr(disShader.outColor,shadingGrps[0]..displacementShader) 
        except:
            print 'no dis'
开发者ID:kyuhoChoi,项目名称:mayaTools,代码行数:30,代码来源:AlembicMasterExporter_03v.py


示例14: SundayRenderToolsChangeTextureResolution

def SundayRenderToolsChangeTextureResolution(object, level):
    sel = cmds.ls(selection = True)
    if object == 'selected':
        if len(sel) == 0:
            SundayDialogPy.SundayDialogConfirm('ERROR                       ', 'Nothing selected.', 'OK')
        else:
            cmds.hyperShade('', shaderNetworksSelectMaterialNodes = True)
            selShader = cmds.ls(selection = True)
            for curSelShader in selShader:
                notes = cmds.hyperShade(listUpstreamNodes = curSelShader)
                for note in notes:
                    if cmds.nodeType(note) == 'file' or cmds.nodeType(note) == 'psdFileTex':
                        cmds.select(note)
                        SundayRenderToolsChangeTextureResolutionSet(level, note)
                        continue
                
            
    elif object == 'global':
        notes = cmds.ls(type = 'file')
        for note in notes:
            cmds.select(note)
            SundayRenderToolsChangeTextureResolutionSet(level, note)
        
    
    
    try:
        cmds.select(sel)
    except:
        pass
开发者ID:elliottjames,项目名称:jeeves,代码行数:29,代码来源:SundayRenderToolsPy.py


示例15: roundPlate

def roundPlate():
    
    #get values from UI
    rgb = cmds.colorSliderGrp('brickColour', query=True, rgbValue=True)
    transparent = cmds.checkBox('makeTransparent', query = True, value = True)
    
    base = cmds.polyCylinder( h = 0.18, r = 0.3 )
    cmds.rotate( 90, rotateY = True )
    cmds.move( 0.18/2, moveY = True)
    
    wide = cmds.polyCylinder( h = 0.14, r = 0.4 )
    cmds.rotate( 90, rotateY = True )
    cmds.move( 0.18 + (0.14/2), moveY = True)
    
    stud = cmds.polyCylinder( h = 0.18, r = 0.24 )
    cmds.rotate( 90, rotateY = True )
    cmds.move( 0.18 + 0.14 + (0.18/2), moveY = True)
    
    rp = cmds.polyUnite( base, wide, stud )
    
    myShader = cmds.shadingNode( 'phong', asShader=True )
    cmds.setAttr( myShader+".color", rgb[0], rgb[1], rgb[2], type='double3')
    cmds.setAttr( myShader+".reflectivity", 0 )
    
    if( transparent == True ):
       cmds.setAttr( myShader+".transparency", 0.5, 0.5, 0.5, type = 'double3' ) 
    
    cmds.select( rp )
    cmds.hyperShade( assign = myShader )
    
    cmds.delete( ch = True )
开发者ID:stephonatron,项目名称:LegoTechnicGenerator,代码行数:31,代码来源:LegoTechnicGenerator.py


示例16: getObjMaterials

def getObjMaterials():
    global remapAndLuminaceNodes
    shadingType = ['blinn', 'phong', 'RedshiftArchitectural', 'aiStandard']
    displacementShading = ['RedshiftDisplacement', 'displacementShader']
    duplicateMaterials = list()
    selObjsList = cmds.ls(sl = 1, tr = 1)
    if not selObjsList: assert 'No object is selected!'
    obj = selObjsList[0]
    duplicateNodes = list()
    cmds.select(obj, r = 1)
    cmds.hyperShade(smn = 1)
    selObjsDuplicateMaterials = cmds.duplicate(un = 1)
    for item in selObjsDuplicateMaterials:
        dupliMater = cmds.rename(item, '%s_duplicate'%(item))
        duplicateNodes.append(dupliMater)
    for item in duplicateNodes:
        if cmds.nodeType(item) in shadingType:
            duplicateShading = cmds.sets(r = 1, nss = 1, em = 1, n = '%s_SG'%item)
            cmds.connectAttr('%s.outColor'%item, '%s.surfaceShader'%duplicateShading, f = 1)
            duplicateMaterials.append(item)
        elif cmds.nodeType(item) == 'RedshiftDisplacement':
            conInfo = cmds.connectionInfo('%s.displacementShader'%duplicateShading, sfd = 1)
            if not conInfo:
                cmds.connectAttr('%s.out'%item, '%s.displacementShader'%duplicateShading, f = 1)
        elif cmds.nodeType(item) == 'displacementShader':
            conInfo = cmds.connectionInfo('%s.displacementShader'%duplicateShading, sfd = 1)
            if not conInfo:
                cmds.connectAttr('%s.displacement'%item, '%s.displacementShader'%duplicateShading, f = 1)
    cmds.sets(obj, e = 1, fe = duplicateShading)
    cmds.select(selObjsList, r = 1)
    return list(set(duplicateMaterials))
开发者ID:chuckbruno,项目名称:remap,代码行数:31,代码来源:RemapAndIllumanceForSameTexture.py


示例17: remove_material_duplicates

def remove_material_duplicates(mats, compare_func):
    node2Node = list()
    needDelete = list()

    for i in xrange(0, len(mats)):
        for j in xrange(0, i):
            if compare_func(mats[i], mats[j]):
                node2Node.append(mats[i])
                node2Node.append(mats[j])
                needDelete.append(mats[i])

                cmds.hyperShade(objects=mats[i])
                sel = cmds.ls(sl=True)
                if sel != None and sel != []:
                    cmds.hyperShade(assign=mats[j])
                break

    for each in needDelete:
        listSG = cmds.listConnections(each, type="shadingEngine")
        cmds.delete(each)
        if listSG != None:
            for sg in listSG:
                if cmds.listConnections(sg, d=False) != None:
                    cmds.delete(sg)

    return len(needDelete)
开发者ID:Kapukw,项目名称:vfxutils,代码行数:26,代码来源:Utils.py


示例18: createImpactHelper

 def createImpactHelper(self):
     '''
     Creates IS Sphere Helper
     '''
     mImpact = cmds.sphere(r = 0.00001, n = 'IS_Impact')
     mImpactShape = cmds.listRelatives(mImpact[0])[0]
     
     self._mVoroImpactTrs = mImpact[0]
     self._mVoroImpactShape = mImpact[1]
     
     cmds.setAttr(mImpact[0] + '.visibility', False)
     cmds.setAttr(mImpact[0] + '.overrideEnabled', True)
     cmds.setAttr(mImpact[0] + '.overrideColor', 14)
     cmds.setAttr(mImpact[1] + '.sections', 2)
     cmds.setAttr(mImpact[1] + '.spans', 2)
     cmds.setAttr(mImpactShape + '.curvePrecisionShaded', 20)
     
     self._mVoroImpactShader = cmds.shadingNode('lambert', name = 'IS_ImpactMat', asShader = True)
     cmds.setAttr(self._mVoroImpactShader + '.diffuse', 0.0)
     cmds.setAttr(self._mVoroImpactShader + '.translucence', 0.3)
     cmds.setAttr(self._mVoroImpactShader + '.translucenceDepth', 0.75)
     cmds.setAttr(self._mVoroImpactShader + '.color', 0.0, 1.0, 0.0, type = 'double3')
     cmds.setAttr(self._mVoroImpactShader + '.incandescence', 0.0, 0.15, 0.0, type = 'double3')
     cmds.setAttr(self._mVoroImpactShader + '.transparency', 0.55, 0.55, 0.55, type = 'double3')
     
     cmds.select(mImpact, replace = True)
     cmds.hyperShade(assign = self._mVoroImpactShader)
     mel.eval('hyperShadePanelMenuCommand("hyperShadePanel1", "deleteUnusedNodes")')
     
     if (cmds.attributeQuery('hiddenInOutliner', node = self._mVoroImpactTrs, exists = True)):
         cmds.setAttr(self._mVoroImpactTrs + '.hiddenInOutliner', True)
     
     cmds.select(clear = True)
     cmds.scriptEditorInfo (clearHistory = True)
开发者ID:jeffhong21,项目名称:scripts,代码行数:34,代码来源:IShatterCTX.py


示例19: generate

  def generate(cls, *args):
    components = []
    boolean = []
    width = cmds.intSliderGrp(cls.get_prefix() + Labels["width_label"], query=True, value=True)
    rgb = cmds.colorSliderGrp(cls.get_prefix() + Labels["color_label"], query=True, rgbValue=True)

    block_width = width * Constants["block_width_unit"]
    block_height = Constants["block_height_unit"]
    block_depth = Constants["block_depth_unit"]

    for x in range(0, width):
      stub = cmds.polyCylinder(name=get_unique_name(cls.get_prefix(), "Stub"), radius=Constants["stub_radius"], height = Constants["stub_height"])
      components.append(stub[0])
      cmds.move(Constants["block_width_unit"] * x + half(Constants["block_width_unit"]), half(Constants["block_height_unit"]) + half(Constants["stub_height"]), half(Constants["block_depth_unit"]), stub[0])
      
    for x in range(0, width-1):
      hole = cmds.polyCylinder(name=get_unique_name(cls.get_prefix(), "Hole"), radius=Constants["perforation_radius"], height=Constants["block_depth_unit"] + 0.2)
      boolean.append(hole[0])
      cmds.rotate('90deg', 0, 0, hole[0])
      cmds.move(Constants["block_width_unit"] * x + Constants["block_width_unit"], 0, half(Constants["block_depth_unit"]), hole[0])

    cube = cmds.polyCube(sx=5,sy=2,sz=2,name=get_unique_name(cls.get_prefix(), "block"), width=block_width, height=block_height, depth=block_depth)
    components.append(cube[0])
    cmds.move(half(width * Constants["block_width_unit"]), 0, half(Constants["block_depth_unit"]), cube)
    solid = cmds.polyUnite(components, name=get_unique_name(cls.get_prefix(), ""))
    boolean_group = cmds.polyUnite(boolean, name=get_unique_name(cls.get_prefix(),"boolean"))
    final = cmds.polyBoolOp( solid[0], boolean_group[0], op=2, n=get_unique_name(cls.get_prefix(), "") )

    shader = cmds.shadingNode('blinn', asShader=True, name=get_unique_name(cls.get_prefix(),"mat"))
    cmds.setAttr(shader + ".color", rgb[0],rgb[1],rgb[2], type='double3')
    cmds.select(final[0], r=True)
    cmds.hyperShade(assign=shader)
开发者ID:JakeCataford,项目名称:3dcg-tutorials,代码行数:32,代码来源:LegoBuilder.py


示例20: ToMaterialFromFace

 def ToMaterialFromFace(self):
     materials = []
     for name in self.names:
         cmds.select(name)
         cmds.hyperShade(smn=True)
         materials += cmds.ls(sl=True)
     return materials
开发者ID:GRGSIBERIA,项目名称:MayaToPMD,代码行数:7,代码来源:topmd.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python cmds.iconTextButton函数代码示例发布时间:2022-05-27
下一篇:
Python cmds.hide函数代码示例发布时间: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