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

Python cmds.editRenderLayerGlobals函数代码示例

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

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



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

示例1: snapShot

def snapShot(cam, objs, renderPath):
	
    # build the lightrig
    lightRigGrp = cmds.group(em=True, name='lightRigGroup')
    lightMain = cmds.directionalLight(rotation=(-20, -45, 0), intensity=0.8)
    lightFill = cmds.directionalLight(rotation=(-20, 45, 0), intensity=0.4)
    lightUnder = cmds.directionalLight(rotation=(75, 0, 0), intensity=0.15)
    lightKey = cmds.directionalLight(rotation=(-25, 145, 0), intensity=4.0)
    cmds.parent([lightMain, lightFill, lightUnder, lightKey], lightRigGrp)
	
    # select everything, build the special shader, render, then delete everything
    renderLayerName = cmds.createRenderLayer(name='tempSnapShot_rlayer', empty=True, mc=True)

    cmds.editRenderLayerMembers(renderLayerName, objs)
    cmds.editRenderLayerMembers(renderLayerName, lightRigGrp)
    
    shaderNodes = buildTempShader() #build the shader
    cmds.sets(objs, e=True, forceElement=shaderNodes[0]) #adding the shader here means it's in the render layer
  
    tempImage= cmds.render(cam, layer=renderLayerName)
    
    cmds.editRenderLayerGlobals(currentRenderLayer='defaultRenderLayer')
 
    cmds.delete(lightRigGrp, cam, renderLayerName)
    cmds.delete(shaderNodes)
    
    # copy the thumbnail to the desired location
    output = cmds.sysFile(tempImage, rename=renderPath)
    if output==True:
        print 'Path for thumbnail: ' + renderPath
        return renderPath

    return None
开发者ID:adamfok,项目名称:afok_toolset,代码行数:33,代码来源:snapShot2.py


示例2: get_pass_names

def get_pass_names(renderer, layer):
    """Helper method to return the passes for a given layer"""
    cur_layer = cmds.editRenderLayerGlobals(q=True, currentRenderLayer=True)
    cmds.editRenderLayerGlobals(currentRenderLayer=layer)

    pass_names = []
    if renderer == zync.VRAY_RENDERER:
        render_element_nodes = cmds.ls(type="VRayRenderElement")
        for element in render_element_nodes:
            if cmds.getAttr(element + '.enabled'):
                element_attrs = cmds.listAttr(element)
                vray_name_attr = [ x for x in element_attrs if re.match('vray_name_.*', x) or re.match('vray_filename_.*', x) ]
                pass_names.append(cmds.getAttr(element + '.' +vray_name_attr[0]))

    if renderer == zync.MENTAL_RAY_RENDERER:
        pass_names.append('MasterBeauty')
        render_pass_nodes = cmds.listConnections(layer + '.renderPass')
        if render_pass_nodes:
            for pass_ in render_pass_nodes:
                print "  pass %s for %s" % (pass_, layer)
                if cmds.getAttr(pass_ + '.renderable'):
                    pass_names.append(pass_)

    cmds.editRenderLayerGlobals(currentRenderLayer=cur_layer)

    return pass_names
开发者ID:andrewbunday,项目名称:zync-maya,代码行数:26,代码来源:zync_maya.py


示例3: layerChanged

    def layerChanged(self, index):


        self.curLayer = self.renderLayer.itemText(index)
        if self.curLayer == "defaultRenderLayer":
            self.disableLayerOverrides()
        else:
            self.enableLayerOverrides()
            for cache in self.ABCViewerNode:
                c = self.ABCViewerNode[cache]
                over = c.getLayerOverrides(self.getLayer())

                if over:
                    self.overrideProps.setChecked(over["removeProperties"])
                    self.overrideShaders.setChecked(over["removeShaders"])
                    self.overrideDisps.setChecked(over["removeDisplacements"])


        self.updateTree()
        if self.hierarchyWidget.currentItem():
            self.itemCLicked(self.hierarchyWidget.currentItem(), 0, force=True)

        # change it in maya too
        curLayer = cmds.editRenderLayerGlobals(query=1, currentRenderLayer=1)
        if curLayer != self.curLayer:
            cmds.editRenderLayerGlobals( currentRenderLayer=self.curLayer)
开发者ID:skarone,项目名称:PipeL,代码行数:26,代码来源:shaderManager.py


示例4: collect_layer_info

def collect_layer_info(layer, renderer):
    cur_layer = cmds.editRenderLayerGlobals(q=True, currentRenderLayer=True)
    cmds.editRenderLayerGlobals(currentRenderLayer=layer)

    layer_info = {}

    # get list of active render passes
    layer_info['render_passes'] = []
    if renderer == "vray" and cmds.getAttr('vraySettings.imageFormatStr') != 'exr (multichannel)' and cmds.getAttr('vraySettings.relements_enableall') != False: 
        pass_list = cmds.ls(type='VRayRenderElement')
        pass_list += cmds.ls(type='VRayRenderElementSet')
        for r_pass in pass_list:
            if cmds.getAttr('%s.enabled' % (r_pass,)) == True:
                layer_info['render_passes'].append(r_pass)

    # get prefix information
    if renderer == 'vray':
        node = 'vraySettings'
        attribute = 'fileNamePrefix'
    elif renderer in ("sw", "mr"):
        node = 'defaultRenderGlobals'
        attribute = 'imageFilePrefix'
    try:
        layer_prefix = cmds.getAttr('%s.%s' % (node, attribute))
        layer_info['prefix'] = layer_prefix
    except Exception:
        layer_info['prefix'] = ''

    cmds.editRenderLayerGlobals(currentRenderLayer=cur_layer)
    return layer_info
开发者ID:justin-wood,项目名称:zync-maya,代码行数:30,代码来源:zync_maya.py


示例5: SubdivisionLevelChanged

 def SubdivisionLevelChanged(*args):
     cmds.editRenderLayerGlobals( currentRenderLayer = "defaultRenderLayer")
     for mesh in cmds.listRelatives(cmds.getAttr("CMSettings.ModelName"), allDescendents = True):
         try:
             cmds.setAttr(mesh + "Smooth.divisions", cmds.intSlider("SubdivisionLevel",query = True, value = True))
         except:
             pass    
开发者ID:Kif11,项目名称:turbosquid_maya_publisher,代码行数:7,代码来源:RenderLayerManagerFile.py


示例6: NAMEmatchOverrideButton

def NAMEmatchOverrideButton(* args):
    clearList() 
    currentLayer = mc.editRenderLayerGlobals( query=True, currentRenderLayer=True )
    selectionDefiner()
    for trgCt in range(len(trgCmpList)):
        for srcCt in range(len(srcCmpList)):
            if trgCmpList[trgCt] == srcCmpList[srcCt]:
                srcObjSel = srcTrList[srcCt]
                trgObjSel = trgTrList[trgCt]
                mc.select(srcObjSel,replace=True)
                mc.select(trgObjSel,add=True)
                getLayers()
                getSelectedLayers()
                for actLayer in actLayerList:
                    for selLayer in selLayerList:
                        if actLayer == selLayer:
                            mc.editRenderLayerGlobals(currentRenderLayer=actLayer)   
                            overrideTransfer(actLayer)
                                                    
                actLayerList[:]=[]
                selLayerList[:]=[]
                sourceObj[:]=[]
                targetObjs[:]=[]
                sourceShape[:]=[]
                targetShapes[:]=[] 
                     
        if trgCmpList[trgCt] not in srcCmpList:
            print trgTrList[trgCt] + " doesn't match! "
            
    mc.select(srcGrp,replace=True)
    mc.select(trgGrp,add=True)       
            
    mc.editRenderLayerGlobals(currentRenderLayer=currentLayer) 
开发者ID:chichang,项目名称:ccLookdevToolkit,代码行数:33,代码来源:matchRenderLayers.py


示例7: modifySubdivisions

 def modifySubdivisions(*args):
     if cmds.objExists("CMForegroundPlane"):
         if cmds.window("SubdivisionsTextWindow", query = True, exists = True):
             cmds.deleteUI("SubdivisionsTextWindow")
         
         SubdivisionTextClass.UpdateSubSnap()
 
         if os.path.exists(SubdivisionTextClass.ImagePath):
             
             cmds.window( "SubdivisionsTextWindow", title = "Subdivisions Text" )
             cmds.formLayout("SubWriterLayout", numberOfDivisions=100, w = 740, h = 400)
             cmds.picture( "BasePicture", image = SubdivisionTextClass.ImagePath )
             
             cmds.editRenderLayerGlobals( currentRenderLayer = "Subdivision_0")
             SubdivisionTextClass.subColor = cmds.getAttr("CMForegroundPlane.imageName")[-5]
             cmds.editRenderLayerGlobals( currentRenderLayer = "defaultRenderLayer")
             
             
             cmds.window( "SubdivisionsTextWindow", edit = True, w = 740, h = 400)
             
             #Create popupMenu for images 
             cmds.popupMenu( "SubdivisionPopUp", parent = "BasePicture" )
             cmds.menuItem( label='TopLeft'    , p = "SubdivisionPopUp", c = functools.partial(SubdivisionTextClass.ChangePos,  "lt") )  
             cmds.menuItem( label='TopRight'   , p = "SubdivisionPopUp", c = functools.partial(SubdivisionTextClass.ChangePos,  "rt") ) 
             cmds.menuItem( label='BottomLeft' , p = "SubdivisionPopUp", c = functools.partial(SubdivisionTextClass.ChangePos,  "lb") ) 
             cmds.menuItem( label='BottomRight', p = "SubdivisionPopUp", c = functools.partial(SubdivisionTextClass.ChangePos,  "rb") )
             cmds.menuItem( label='ToggleColor', p = "SubdivisionPopUp", c = SubdivisionTextClass.toggleSubdivisionColour )
             cmds.showWindow("SubdivisionsTextWindow")
     else:
         cmds.confirmDialog(m = "The signature camera must be created before running this tool")
开发者ID:Kif11,项目名称:turbosquid_maya_publisher,代码行数:30,代码来源:SubdivisionTextFile.py


示例8: setDefaultRenderState

 def setDefaultRenderState(self):
     if cmds.editRenderLayerGlobals( query=True, currentRenderLayer=True ) != "defaultRenderLayer":
         cmds.editRenderLayerGlobals(currentRenderLayer='defaultRenderLayer')
     for node in self.getAOVs:
         self.getInitState = cmds.getAttr("%s.enabled" % node)
         node = node.split('aiAOV_')[1]
         self.defaultRenderLayerState[node] = self.getInitState
开发者ID:scomly,项目名称:myStuff,代码行数:7,代码来源:arnoldAOVSetup.py


示例9: bRgb_mask

def bRgb_mask(*args):
    t = "MASK"
    sels = cmds.ls(sl=True)
    name = get_name(t)    
    sf = int(cmds.textFieldGrp('start_frame', q=True, tx=True))
    ef = int(cmds.textFieldGrp('end_frame', q=True, tx=True))
    print len(args)
    if args[0] == "ch" :
        type_l = ("face", "hair", "all")
        for x in type_l:
            name = get_name(args[0]+"_"+x+"_"+t)
            if not(cmds.objExists(name)) :
                rl = make_layer(name,sf,ef,t)
    elif type(args[0]) == types.StringType:
        name = get_name(args[0]+"_"+t)
        if not(cmds.objExists(name)) :
            rl = make_layer(name, sf, ef, t)
    else : 
        name = get_name(t)
        if not(cmds.objExists(name)) :
            rl = make_layer(name, sf, ef, t)    
    if not(cmds.objExists(name)) :
        cmds.editRenderLayerGlobals(crl= rl[0])
        cmds.setAttr("defaultRenderGlobals.ren", "mayaSoftware", typ='string')

        maya_set()
        if len(sels) != 0 : cmds.select(sels,r=True)
    return name
开发者ID:muskccat,项目名称:RenderLayerUtils,代码行数:28,代码来源:render_layer_creator_v2.py


示例10: takeSnapShot

def takeSnapShot(targetObj, renderPath, rotX=-30.0, rotY=45.0, rotZ=0.0, resX=300, resY=300, useBoundingBox=False):
	'''
	Take a snapshot of the selected object using the Maya renderer then move the image to a directory
	'''
	
	# build the bounding box and find it's centre
	bBox = targetObj
	if useBoundingBox is True:
		bBox = buildBoundingBoxGeo(targetObj, noChildren=False, ignoreInv=True)
	focusPoint = cmds.xform(bBox, query=True, ws=True, t=True)
	
	# build the camera the move and orient it
	tempCam = cmds.camera(ar=True, ff=3, fl=35)
	camName = tempCam[1]
	cmds.setAttr(camName+'.renderable', True)
	cmds.setAttr(camName+'.displayFilmGate', True)
	cmds.setAttr(camName+'.displayResolution', True)
	cmds.setAttr(camName+'.backgroundColor', 0.5, 0.5, 0.5, type='double3') #transform
	cmds.move(focusPoint[0], focusPoint[1], focusPoint[2], tempCam, ws=True) 
	cmds.rotate( rotX, rotY, rotZ, tempCam, ws=True)
	
	# build the bounding box then fit the camera
	cmds.select(bBox, r=True)
	cmds.viewFit(camName, an = False, f = 0.9 )
	if useBoundingBox is True:
		cmds.delete(bBox)
	
	# set the render globals
	cmds.currentTime(1)
	cmds.setAttr('defaultRenderGlobals.imageFormat', 8)
	cmds.setAttr('defaultRenderQuality.edgeAntiAliasing', 0)
	cmds.setAttr('defaultRenderQuality.shadingSamples', 2)
	cmds.setAttr('defaultRenderQuality.maxShadingSamples', 8)
	cmds.setAttr('defaultRenderQuality.useMultiPixelFilter', 1)
	cmds.setAttr('defaultRenderQuality.enableRaytracing', 0)
	
	# build the lightrig
	lightRigGrp = cmds.group(em=True, name='lightRigGroup')
	lightMain = cmds.directionalLight(rotation=(-20, -45, 0), intensity=0.8)
	lightFill = cmds.directionalLight(rotation=(-20, 45, 0), intensity=0.4)
	lightUnder = cmds.directionalLight(rotation=(75, 0, 0), intensity=0.15)
	lightKey = cmds.directionalLight(rotation=(-25, 145, 0), intensity=4.0)
	cmds.parent([lightMain, lightFill, lightUnder, lightKey], lightRigGrp)
	cmds.rotate( rotX, rotY, rotZ, lightRigGrp, ws=True)
	
	# select everything, build the special shader, render, then delete everything
	cmds.select([targetObj, lightRigGrp], r=True)
	renderLayerName = cmds.createRenderLayer(name='tempSnapShot_rlayer', mc=True)
	shaderNodes = buildReverseNormalShader() #build the shader
	cmds.sets(targetObj, e=True, forceElement=shaderNodes[0]) #adding the shader here means it's in the render layer
	tempImage= cmds.render(camName, layer=renderLayerName, x=resX, y=resY)
	cmds.editRenderLayerGlobals(currentRenderLayer='defaultRenderLayer')
	cmds.delete([lightRigGrp, tempCam[0], renderLayerName, shaderNodes[0], shaderNodes[1], shaderNodes[2], shaderNodes[3]])
	
	# copy the thumbnail to the desired location
	output = cmds.sysFile(tempImage, rename=renderPath)
	if output==True:
		print 'Path for thumbnail: ' + renderPath
		return renderPath
	return None
开发者ID:adamfok,项目名称:afok_toolset,代码行数:60,代码来源:snapShot2.py


示例11: _export_ass

 def _export_ass(self):
     
     import mtoa.cmds.arnoldRender as ar
     
     filePath=cmds.file(q=True,sn=True)
     
     #getting fields for version
     shot_temp=self.parent.sgtk.templates["maya_shot_work"]
     shotgunFields=shot_temp.get_fields(filePath)
     
     #getting output path
     area_temp=self.parent.sgtk.templates['maya_ass_export_area']
     path=area_temp.apply_fields(shotgunFields).replace('\\','/')
     
     #setting ass export path
     cmds.workspace(fileRule = ['ASS', path])
     
     #account for renderlayers
     for layer in cmds.ls(type='renderLayer'):
         
         #discarding referenced layers
         if ':' not in layer:
             
             #checking whether layer needs to be rendered
             if cmds.getAttr(layer+'.renderable')==1:
                 
                 cmds.editRenderLayerGlobals( currentRenderLayer=layer )
                 
                 try:
                     ar.arnoldBatchRender('')
                 except Exception, e:
                     raise TankError("Failed to export Ass files: %s" % e)
开发者ID:baitstudio,项目名称:00719_grandpa,代码行数:32,代码来源:shot_post_submit_tk_maya.py


示例12: useDefaultRenderLayer

def useDefaultRenderLayer():
    """ Analisys if must use the Default Render Layer (masterLayer) checking the option in the UI.
        Set to use it if need.
    """
    # analisys to use the defaultRenderLayer:
    useDefaultRL = cmds.checkBox('defaultRenderLayerCB', query=True, value=True)
    if useDefaultRL:
        cmds.editRenderLayerGlobals(currentRenderLayer='defaultRenderLayer')
开发者ID:utsdab,项目名称:usr,代码行数:8,代码来源:dpUtils.py


示例13: reAdd

def reAdd(samplesField, spreadField, maxDistanceField):
	# switch to the ao render layer
	cmds.editRenderLayerGlobals(currentRenderLayer='ao')
	objects = cmds.ls(g=True)
	cmds.select(objects)
	cmds.hyperShade(a='amb_occl_surf_shader')
	
	changeAOSettings(samplesField, spreadField, maxDistanceField)
开发者ID:matheushrr,项目名称:rl,代码行数:8,代码来源:ao.py


示例14: get_layer_override

def get_layer_override(layer, node, attribute='imageFilePrefix'):
    """Helper method to return the layer override value for the given node and attribute"""
    cur_layer = cmds.editRenderLayerGlobals(q=True, currentRenderLayer=True)

    cmds.editRenderLayerGlobals(currentRenderLayer=layer)
    attr = '.'.join([node, attribute])
    layer_override = cmds.getAttr(attr)
    cmds.editRenderLayerGlobals(currentRenderLayer=cur_layer)
    return layer_override
开发者ID:andrewbunday,项目名称:zync-maya,代码行数:9,代码来源:zync_maya.py


示例15: disableImagePlane

def disableImagePlane():
    objs = mc.ls(typ="imagePlane")
    for obj in objs:
        if not mc.editRenderLayerGlobals(q=1, crl=1) == "defaultRenderLayer":
            mc.editRenderLayerAdjustment(obj + ".displayMode")
        mc.setAttr(obj + ".displayMode", 0)
        if not mc.editRenderLayerGlobals(q=1, crl=1) == "defaultRenderLayer":
            mc.editRenderLayerAdjustment(obj + ".type")
        mc.setAttr(obj + ".type", 1)
开发者ID:pinkwerks,项目名称:Maya-Scripts,代码行数:9,代码来源:renderUtils.py


示例16: img_name

def img_name(*args):
    name = cmds.textScrollList('rl_list',q=True,si=True)
    if type(name) != types.NoneType:
        cmds.editRenderLayerGlobals(crl=name[0])
        i_n = cmds.getAttr("defaultRenderGlobals.imageFilePrefix")
        cmds.textScrollList('img_list', e=True,ra=True,ams=False,append=i_n)
       
        cmds.textFieldGrp('ch_name', e=True, tx = name[0])
        cmds.textFieldGrp('ch_fname', e=True, tx = name[0])
开发者ID:muskccat,项目名称:RenderLayerUtils,代码行数:9,代码来源:render_layer_name_changer.py


示例17: re_add

def re_add(samples_field, spread_field, max_distance_field):
    """if AO already has been setup, just add all the objects to the AO layer"""
    # switch to the ao render layer
    cmds.editRenderLayerGlobals(currentRenderLayer="ao")
    objects = cmds.ls(g=True)
    cmds.select(objects)
    cmds.hyperShade(a="amb_occl_surf_shader")

    change_ao_settings(samples_field, spread_field, max_distance_field)
开发者ID:FLOWERCLOUD,项目名称:rl,代码行数:9,代码来源:ao.py


示例18: MaterialOverrides

 def MaterialOverrides(shaderGroup, layers):
     for i in layers:
         cmds.editRenderLayerGlobals(currentRenderLayer = i)
         try:
             cmds.select( clear=True )
             cmds.select(cmds.getAttr("CMSettings.ModelName"))
             cmds.sets(cmds.ls(selection = True), forceElement = shaderGroup, e = True, n = i + "WireSet")    
         except:
             print "Failed to assign shader"
         cmds.editRenderLayerGlobals(currentRenderLayer = "defaultRenderLayer")
开发者ID:Kif11,项目名称:turbosquid_maya_publisher,代码行数:10,代码来源:RenderLayerManagerFile.py


示例19: _cleanUp

def _cleanUp():
    cmds.editRenderLayerGlobals(currentRenderLayer='defaultRenderLayer')
    cmds.select(clear=True)
    listOfLayers = cmds.ls(type="renderLayer")
    cmds.select("defaultRenderLayer")
    for eachlayer in listOfLayers:
        if eachlayer != "defaultRenderLayer":
            cmds.delete(eachlayer)
    for eachPass in mapi.get_all_passes():
        cmds.delete(eachPass)
开发者ID:jamesbdunlop,项目名称:defaultMayaLibrary,代码行数:10,代码来源:renderGlobals_readXML.py


示例20: on_renderlayer_clicked

 def on_renderlayer_clicked(self):
     
     renderlayer=self.renderlayer_listWidget.selectedItems()[0].text()
     
     cmds.editRenderLayerGlobals( currentRenderLayer=renderlayer)
     cmds.refresh()
     
     regionNode=cmds.listConnections(renderlayer+'.message',type='network')[0]
     
     cmds.select(regionNode)
开发者ID:Bumpybox,项目名称:Tapp,代码行数:10,代码来源:gui.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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