コード例 #1
0
 def Autodetect_Threads(self):
     key = cmds.getAttr("defaultArnoldRenderOptions.threads_autodetect")
     if key == True:
         flag = False
     else:
         flag = True
     cmds.attrControlGrp('Threads_S',enable=flag,e=True)
コード例 #2
0
ファイル: basicIK.py プロジェクト: griffinanimator/MPR
 def UI(self, parentLayout):
     ikHandleControl = self.blueprintNamespace+":"+self.moduleNamespace+":ikHandleControl"
     controlObjectInstance = controlObject.ControlObject(ikHandleControl)
     controlObjectInstance.UI(parentLayout)
     
     cmds.attrControlGrp(attribute=ikHandleControl+".twist", label="Twist")
     cmds.attrControlGrp(attribute=ikHandleControl+".stretchiness", label="Stretchiness")
コード例 #3
0
	def UI(self, parentLayout):
		ikHandleControl = self.blueprintNamespace+':'+self.moduleNamespace+':ikHandleControl'
		controlObjectInstance = controlObject.ControlObject(ikHandleControl)
		controlObjectInstance.UI(parentLayout)
		
		cmds.attrControlGrp(attribute=ikHandleControl+'.twist', label='Twist')
		cmds.attrControlGrp(attribute=ikHandleControl+'.stretchiness', label='Stretchiness')
コード例 #4
0
 def Auto_tile(self):
     if cmds.getAttr("defaultArnoldRenderOptions.autotile") == True:
         print 'Yes'
         cmds.attrControlGrp('Tile_Size_T',enable=True,e=True)
     else:
         print 'No'
         cmds.attrControlGrp('Tile_Size_T',enable=False,e=True)
コード例 #5
0
 def setupModuleSpecificControls(self):
     currentlySelectedModuleInfo = cmds.textScrollList(self.UIElements["animationModule_textScroll"], q=True, selectItem=True)
     currentlySelectedModuleNamespace = None
     if currentlySelectedModuleInfo != None:
         currentlySelectedModuleNamespace = currentlySelectedModuleInfo[0]
         
         if currentlySelectedModuleNamespace == self.previousAnimationModule and self.selectedBlueprintModule == self.previousBlueprintModule:
             return
         
     existingControls = cmds.columnLayout(self.UIElements["moduleSpecificControlsColumn"], q=True, childArray=True)
     if existingControls != None:
         cmds.deleteUI(existingControls)
         
     cmds.button(self.UIElements["matchingButton"], edit=True, enable=False)
     
     cmds.setParent(self.UIElements["moduleSpecificControlsColumn"])
     
     moduleNameInfo = utils.findAllModuleNames("/Modules/Animation")
     modules = moduleNameInfo[0]
     moduleNames = moduleNameInfo[1]
     
     if currentlySelectedModuleInfo != None:
         currentlySelectedModule = currentlySelectedModuleNamespace.rpartition("_")[0]
         
         if currentlySelectedModule in moduleNames:
             # Matching button enabled?
             # Should that actually be _weight?
             moduleWeightValue = cmds.getAttr(self.selectedBlueprintModule+":SETTINGS."+currentlySelectedModuleNamespace+"_weight")
             matchButtonEnable = moduleWeightValue == 0.0
             
             moduleIndex = moduleNames.index(currentlySelectedModule)
             module = modules[moduleIndex]
             
             cmds.attrControlGrp(attribute=self.selectedBlueprintModule+":"+currentlySelectedModuleNamespace+":module_grp.lod", label="Module_LOD")
             
             mod = __import__("Animation."+module, {}, {}, [module])                
             reload(mod)
             
             moduleClass = getattr(mod, mod.CLASS_NAME)
             
             moduleInst = moduleClass(self.selectedBlueprintModule+":"+currentlySelectedModuleNamespace)
             
             moduleInst.UI(self.UIElements["moduleSpecificControlsColumn"])
             
             # Set parent back to module specific controls layout
             self.UIElements["moduleSpecificControls_preferencesFrame"] = cmds.frameLayout(borderVisible=True, label="preferences", collapsable=True)
             self.UIElements["moduleSpecificControls_preferencesColumn"] = cmds.columnLayout(columnAttach=["both", 5], adj=True)
             
             cmds.attrControlGrp(attribute=self.selectedBlueprintModule+":"+currentlySelectedModuleNamespace+":module_grp.iconScale", label="Icon Scale")
             
             value = cmds.getAttr(self.selectedBlueprintModule+":"+currentlySelectedModuleNamespace+":module_grp.overrideColor")
             self.UIElements["iconColor"] = cmds.colorIndexSliderGrp(label="Icon Color", maxValue=32, v=value, cc=partial(self.iconColor_callback, currentlySelectedModuleNamespace))
             
             moduleInst.UI_preferences(self.UIElements["moduleSpecificControls_preferencesColumn"])
             
             cmds.button(self.UIElements["matchingButton"], edit=True, enable=matchButtonEnable, c=moduleInst.match)
             
         self.previousBlueprintModule = self.selectedBlueprintModule
         self.previousAnimationModule = currentlySelectedModuleNamespace
コード例 #6
0
	def setupModuleSpecificControls(self):
		currentlySelectedModuleInfo = cmds.textScrollList(self.UIElements['animationModule_textScroll'],q=True, selectItem=True)
		currentlySelectedModuleNamespace = None
		if currentlySelectedModuleInfo != None:
			currentlySelectedModuleNamespace = currentlySelectedModuleInfo[0]
			
			if currentlySelectedModuleNamespace == self.previousAnimationModule and self.selectedBlueprintModule == self.previousBlueprintModule:
				return
				
		existingControls = cmds.columnLayout(self.UIElements['moduleSpecificControlsColumn'], q=True, childArray=True)
		if existingControls != None:
			cmds.deleteUI(existingControls)
			
		cmds.button(self.UIElements['matchingButton'],edit=True, enable=False)
		
		cmds.setParent(self.UIElements['moduleSpecificControlsColumn'])
		
		moduleNameInfo = utils.findAllModuleNames('/Modules/Animation')
		modules = moduleNameInfo[0]
		moduleNames = moduleNameInfo[1]
		
		if currentlySelectedModuleInfo != None:
			currentlySelectedModule = currentlySelectedModuleNamespace.rpartition('_')[0]
			
			if currentlySelectedModule in moduleNames:
				moduleWeightValue = cmds.getAttr(self.selectedBlueprintModule + ':SETTINGS.' + currentlySelectedModuleNamespace + '_weight')
				matchButtonEnable = moduleWeightValue == 0.0
				
				moduleIndex = moduleNames.index(currentlySelectedModule)
				module = modules[moduleIndex]
				
				cmds.attrControlGrp(attribute=self.selectedBlueprintModule + ':' + currentlySelectedModuleNamespace + ':module_grp.lod', label='Module LOD')
				
				mod = __import__('Animation.' + module, {},{},[module])
				reload(mod)
				
				moduleClass = getattr(mod,mod.CLASS_NAME)
				
				moduleInst = moduleClass(self.selectedBlueprintModule + ':' + currentlySelectedModuleNamespace)
				
				moduleInst.UI(self.UIElements['moduleSpecificControlsColumn'])
				
				cmds.setParent(self.UIElements['moduleSpecificControlsColumn'])
				
				self.UIElements['moduleSpecificControls_preferencesFrame'] = cmds.frameLayout(borderVisible=True, label='prefrences',collapsable=True)
				self.UIElements['moduleSpecificControls_preferencesColumn'] = cmds.columnLayout(columnAttach=['both', 5], adj=True)
				
				cmds.attrControlGrp(attribute=self.selectedBlueprintModule + ':' + currentlySelectedModuleNamespace + ':module_grp.iconScale', label='Icon Scale')
				
				value = cmds.getAttr(self.selectedBlueprintModule + ':' + currentlySelectedModuleNamespace + ':module_grp.overrideColor') + 1
				self.UIElements['iconColor'] = cmds.colorIndexSliderGrp(label='Icon Colour', maxValue=32, v=value, cc=partial(self.iconColour_callback, currentlySelectedModuleNamespace))
				
				moduleInst.UI_preferences(self.UIElements['moduleSpecificControls_preferencesColumn'])
				
				cmds.button(self.UIElements['matchingButton'], edit=True, enable=matchButtonEnable, c=moduleInst.match)
				
			self.previousBlueprintModule = self.selectedBlueprintModule
			self.previousAnimationModule = currentlySelectedModuleNamespace
コード例 #7
0
	def UI(self,parentLayout):
		jointsGrp = self.blueprintNamespace + ':' + self.moduleNamespace + ':joints_grp'
		joints = utils.findJointChain(jointsGrp)
		joints.pop(0)
		joints.pop()
		
		for joint in joints:
			fkControl = joint + '_fkControl'
			controlObjectInstance = controlObject.ControlObject(fkControl)
			controlObjectInstance.UI(parentLayout)
			
			cmds.attrControlGrp(attribute=fkControl+'.stretch',label='Stretch')
コード例 #8
0
ファイル: ikArm.py プロジェクト: griffinanimator/MPR
 def UI(self, parentLayout):
     armControl = self.blueprintNamespace+":"+self.moduleNamespace+":armControl"
     
     controlObjectInstance = controlObject.ControlObject(armControl)
     controlObjectInstance.UI(parentLayout)
     
     cmds.attrControlGrp(attribute=armControl+".stretchiness", label="Stretchiness")
     
     circleIK.CircleControlStretchyIK.UI(self, parentLayout)
     
     jointsGrp = self.blueprintNamespace+":"+self.moduleNamespace+":joints_grp"
     joints = utils.findJointChain(jointsGrp)
コード例 #9
0
ファイル: fk_stretchy.py プロジェクト: griffinanimator/MPR
 def UI(self, parentLayout):
     jointsGrp = self.blueprintNamespace + ":" + self.moduleNamespace + ":joints_grp"
     joints = utils.findJointChain(jointsGrp)
     joints.pop(0)
     joints.pop()
     
     for joint in joints:
         fkControl = joint + "_fkControl"
         controlObjectInstance = controlObject.ControlObject(fkControl)
         controlObjectInstance.UI(parentLayout)
         
         cmds.attrControlGrp(attribute=fkControl+".stretch", label="Stretch")
コード例 #10
0
ファイル: ikArm.py プロジェクト: griffinanimator/MPR
    def UI(self, parentLayout):
        armControl = self.blueprintNamespace + ":" + self.moduleNamespace + ":armControl"

        controlObjectInstance = controlObject.ControlObject(armControl)
        controlObjectInstance.UI(parentLayout)

        cmds.attrControlGrp(attribute=armControl + ".stretchiness",
                            label="Stretchiness")

        circleIK.CircleControlStretchyIK.UI(self, parentLayout)

        jointsGrp = self.blueprintNamespace + ":" + self.moduleNamespace + ":joints_grp"
        joints = utils.findJointChain(jointsGrp)
コード例 #11
0
    def UI(self, parentLayout):
        jointsGrp = self.blueprintNamespace + ":" + self.moduleNamespace + ":joints_grp"
        joints = utils.findJointChain(jointsGrp)
        joints.pop(0)
        joints.pop()

        for joint in joints:
            fkControl = joint + "_fkControl"
            controlObjectInstance = controlObject.ControlObject(fkControl)
            controlObjectInstance.UI(parentLayout)

            cmds.attrControlGrp(attribute=fkControl + ".stretch",
                                label="Stretch")
コード例 #12
0
 def updateLayerEnableFiltering(self):
     aovList = aovs.getAOVs(enabled=True)
     
     deepexrEnableFilteringTemplates[:] = [tup for tup in deepexrEnableFilteringTemplates if cmds.columnLayout(tup, exists=True)]
     for templateName in deepexrEnableFilteringTemplates:
         cmds.setParent(templateName)
         for child in cmds.columnLayout(templateName, query=True, childArray=True) or []:
             cmds.deleteUI(child)
         cmds.attrControlGrp(label='beauty' , a='defaultArnoldDriver.layerEnableFiltering[0]' )
         for i in range(0,len(aovList)):
             if aovList[i].node.attr('outputs')[0].driver.inputs()[0].name() == 'defaultArnoldDriver':
                 labelStr = aovList[i].name
                 attrStr = 'defaultArnoldDriver.layerEnableFiltering['+str(i+1)+']'
                 cmds.attrControlGrp(label=labelStr , a=attrStr )
コード例 #13
0
    def updateLayerHalfPrecision(self):
        aovList = aovs.getAOVs(enabled=True)

        deepexrHalfPrecisionTemplates[:] = [
            tup for tup in deepexrHalfPrecisionTemplates
            if cmds.columnLayout(tup, exists=True)
        ]
        for templateName in deepexrHalfPrecisionTemplates:
            cmds.setParent(templateName)
            for child in cmds.columnLayout(
                    templateName, query=True, childArray=True) or []:
                cmds.deleteUI(child)
            cmds.attrControlGrp(label='alpha',
                                a='defaultArnoldDriver.alphaHalfPrecision')
            cmds.attrControlGrp(label='depth',
                                a='defaultArnoldDriver.depthHalfPrecision')
            cmds.attrControlGrp(label='beauty',
                                a='defaultArnoldDriver.layerHalfPrecision[0]')
            for i in range(0, len(aovList)):
                if aovList[i].node.attr('outputs')[0].driver.inputs()[0].name(
                ) == 'defaultArnoldDriver':
                    labelStr = aovList[i].name
                    attrStr = 'defaultArnoldDriver.layerHalfPrecision[' + str(
                        i + 1) + ']'
                    cmds.attrControlGrp(label=labelStr, a=attrStr)
コード例 #14
0
    def showUI(self):

        from functools import partial

        def setToPose(psd, poseName, v):
            psd.setToPose(poseName)

        def selectInScene(jt, v):
            cmds.select(jt)

        cmds.window()
        cmds.scrollLayout(horizontalScrollBarThickness=16,
                          verticalScrollBarThickness=16)
        cmds.gridLayout(numberOfColumns=5, cellWidthHeight=(200, 25))
        cmds.text(label='Pose')
        cmds.text(label='Weight')
        cmds.text(label='Joint')
        cmds.text(label='Rotation')
        cmds.text(label='FallOff')
        cmds.separator()
        cmds.separator()
        cmds.separator()
        cmds.separator()
        cmds.separator()
        for poseName in self.poseNames():
            poseAttr = self.poseAttr(poseName)
            cmds.text(label=poseName)
            cmds.attrControlGrp(attribute=poseAttr + '.poseWeight')
            jts = self.poseJoints(poseName)
            if len(jts) == 1:
                cmds.button(label=jts[0],
                            c=partial(selectInScene, jts[0]),
                            ann='Click to select joint')
                jtIdx = cmds.getAttr(poseAttr + '.poseJoint', mi=1)[0]
                jtRot = cmds.getAttr('{}.poseJoint[{}].poseJointRot'.format(
                    poseAttr, jtIdx))[0]
                jtRot = '{:.2f}, {:.2f}, {:.2f}'.format(
                    jtRot[0], jtRot[1], jtRot[2])
                cmds.button(label=jtRot,
                            c=partial(setToPose, self, poseName),
                            ann='Click to setToPose')
                cmds.attrControlGrp(
                    attribute='{}.poseJoint[{}].poseJointFallOff'.format(
                        poseAttr, jtIdx))
            else:
                cmds.text(label='multiple joints')
                cmds.text(label='')
                cmds.text(label='')
        cmds.showWindow()
コード例 #15
0
 def File_D(self):
     key = cmds.getAttr("defaultArnoldRenderOptions.log_to_file")
     if key == True:
         cmds.attrControlGrp('Filename_D',enable=True,e=True)
         cmds.attrControlGrp('Max_Warnings_D',enable=True,e=True)
     else:
         cmds.attrControlGrp('Filename_D',enable=False,e=True)
         cmds.attrControlGrp('Max_Warnings_D',enable=False,e=True)
コード例 #16
0
def materialDeluxeUI():
    if cmds.window('materialDeluxeWindow', exists=True):
        cmds.deleteUI('materialDeluxeWindow')

    widgets['window'] = cmds.window(
        'materialDeluxeWindow', title='Material ID Deluxe', w=600, h=600, mxb=False, mnb=False)
    mainLayout = cmds.frameLayout(w=600, h=300)

    # Materials
    widgets['gradlayout'] = cmds.gridLayout(
        numberOfColumns=2, cellWidthHeight=(300, 30), cr=True)
    for each in texturePathList:
        file_name = os.path.basename(each)
        new_list.append(file_name)

    for texture in allTextures:

        if cmds.attributeQuery('vrayMaterialId', node=texture):

            file_name = os.path.basename(texturePath)
            widgets[(texture+'_nodeTextType')] = cmds.text(label=texture +
                                                           "("+file_name+")", parent=widgets['gradlayout'])
            widgets[(texture+'_filterType')
                    ] = cmds.attrControlGrp(attribute=(texture+'.vrayMaterialId'))
            widgets[(texture+'_selectButton')] = cmds.button(label='Select node',
                                                             command='cmds.select("'+texture+'")', parent=widgets['gradlayout'])

    cmds.setParent('..')
    cmds.frameLayout(w=600, h=100, borderStyle='etchedIn')
    cmds.button(label='Close', command='closeWin()')
    cmds.showWindow(widgets['window'])
コード例 #17
0
 def Enable_MB_Off(self):
     cmds.setAttr("defaultArnoldRenderOptions.motion_blur_enable",0)
     cmds.text('Deformation_Text',enable=False,e=True)
     cmds.checkBox('Deformation_MB',enable=False,e=True)
     cmds.text('Camera_MB',enable=False,e=True)
     cmds.checkBox('Camera_MB',enable=False,e=True)
     cmds.attrControlGrp('Keys_MB',enable=False,e=True)
     cmds.text('Position_MB',enable=False,e=True)
     cmds.optionMenu('Position_optionMenu_MB',enable=False,e=True)
     cmds.attrControlGrp('Length_MB',enable=False,e=True)
     cmds.attrControlGrp('Start_MB',enable=False,e=True)
     cmds.attrControlGrp('End_MB',enable=False,e=True)
コード例 #18
0
 def UI(self, parentLayout):
     footControl = self.blueprintNamespace+":"+self.moduleNamespace+":footControl"
     
     controlObjectInstance = controlObject.ControlObject(footControl)
     controlObjectInstance.UI(parentLayout)
     
     cmds.attrControlGrp(attribute=footControl+".stretchiness", label="Stretchiness")
     
     circleIK.CircleControlStretchyIK.UI(self, parentLayout)
     
     jointsGrp = self.blueprintNamespace+":"+self.moduleNamespace+":joints_grp"
     joints = utils.findJointChain(jointsGrp)
     
     ballJoint = joints[4]
     toeJoint = joints[5]
     
     for joint in [ballJoint, toeJoint]:
         jointControl = joint+"_ryControl"
         controlObjectInstance = controlObject.ControlObject(jointControl)
         controlObjectInstance.UI(parentLayout)
コード例 #19
0
 def UI_preferences(self, parentLayout):
     moduleGrp = self.blueprintNamespace + ":" + self.moduleNamespace + ":module_grp"
     cmds.attrControlGrp(attribute=moduleGrp + ".offsetY", label="Offset Y")
     cmds.attrControlGrp(attribute=moduleGrp + ".offsetZ", label="Offset Z")
コード例 #20
0
	def UI_preferences(self,parentLayout):
		twistOffset = self.blueprintNamespace + ':' + self.moduleNamespace + ':twistControlOffset'
		cmds.attrControlGrp(attribute=twistOffset+'.translateX',label='Twist Offset')
コード例 #21
0
 def UI_preferences(self, parentLayout):
     twistOffset = self.blueprintNamespace + ":" + self.moduleNamespace + ":twistControlOffset"
     cmds.attrControlGrp(attribute=twistOffset + ".translateX",
                         label="Twist Offset")
コード例 #22
0
 def UI_preferences(self, parentLayout):
     twistOffset = self.blueprintNamespace + ":" + self.moduleNamespace + ":twistControlOffset"
     cmds.attrControlGrp(attribute=twistOffset+".translateX", label="Twist Offset")
コード例 #23
0
    def create_rotation_order_ui_control(self, joint):

        joint_name = utils.strip_all_namespaces(joint)[1]
        attr_control_group = cmds.attrControlGrp(attribute=joint +
                                                 ".rotateOrder",
                                                 label=joint_name)
コード例 #24
0
ファイル: settings.py プロジェクト: Quazo/breakingpoint
def createArnoldTextureSettings():

    pm.setUITemplate("attributeEditorTemplate", pushTemplate=True)
    pm.columnLayout(adjustableColumn=True)

    pm.attrControlGrp("texture_automip", label="Auto-mipmap", attribute="defaultArnoldRenderOptions.textureAutomip")

    pm.attrControlGrp(
        "texture_accept_unmipped", label="Accept Unmipped", attribute="defaultArnoldRenderOptions.textureAcceptUnmipped"
    )

    cmds.separator()

    pm.checkBoxGrp("ts_autotile", cc=updateAutotileSettings, label="", label1="Auto-tile")

    pm.connectControl("ts_autotile", "defaultArnoldRenderOptions.autotile", index=2)

    pm.intSliderGrp(
        "ts_texture_autotile", label="Tile Size", minValue=16, maxValue=64, fieldMinValue=16, fieldMaxValue=1024
    )

    pm.connectControl("ts_texture_autotile", "defaultArnoldRenderOptions.textureAutotile", index=1)
    pm.connectControl("ts_texture_autotile", "defaultArnoldRenderOptions.textureAutotile", index=2)
    pm.connectControl("ts_texture_autotile", "defaultArnoldRenderOptions.textureAutotile", index=3)

    """pm.attrControlGrp('texture_autotile',
                        label="Auto-tile Size",
                        attribute='defaultArnoldRenderOptions.textureAutotile')"""

    pm.attrControlGrp(
        "texture_accept_untiled", label="Accept Untiled", attribute="defaultArnoldRenderOptions.textureAcceptUntiled"
    )

    pm.attrControlGrp(
        "use_existing_tiled_textures",
        label="Use Existing .tx Textures",
        attribute="defaultArnoldRenderOptions.use_existing_tiled_textures",
    )

    cmds.separator()

    pm.attrControlGrp(
        "texture_max_memory_MB", label="Max Cache Size (MB)", attribute="defaultArnoldRenderOptions.textureMaxMemoryMB"
    )

    pm.attrControlGrp(
        "texture_max_open_files", label="Max Open Files", attribute="defaultArnoldRenderOptions.textureMaxOpenFiles"
    )

    cmds.separator()

    cmds.attrControlGrp(
        "texture_diffuse_blur", label="Diffuse Blur", attribute="defaultArnoldRenderOptions.textureDiffuseBlur"
    )

    cmds.attrControlGrp(
        "texture_glossy_blur", label="Glossy Blur", attribute="defaultArnoldRenderOptions.textureGlossyBlur"
    )

    pm.setParent("..")

    pm.setUITemplate(popTemplate=True)
コード例 #25
0
	def createRotationOrderUIControl(self, joint):
		jointName = utils.stripAllNamespaces(joint)[1]
		attrControlGroup = cmds.attrControlGrp(attribute=joint + '.rotateOrder' , label=jointName)
		cmds.scriptJob(attributeChange=[joint+'.rotateOrder', partial(self.attributeChange_callBackMethod, joint, '.rotateOrder')],parent=attrControlGroup)
コード例 #26
0
ファイル: arnold_patches.py プロジェクト: eoyilmaz/anima
def createArnoldTextureSettings():
    """The patched version of the original file
    """
    import pymel.core as pm
    import maya.cmds as cmds
    import pymel.versions as versions
    from mtoa.ui.globals import settings

    pm.setUITemplate('attributeEditorTemplate', pushTemplate=True)
    pm.columnLayout(adjustableColumn=True)

    pm.attrControlGrp(
        'autotx',
        cc=settings.updateAutoTxSettings,
        label="Auto-convert Textures to TX (Disabled in Anima)",
        attribute='defaultArnoldRenderOptions.autotx',
        enable=False
    )

    pm.attrControlGrp('use_existing_tiled_textures',
                      label="Use Existing TX Textures",
                      attribute='defaultArnoldRenderOptions.use_existing_tiled_textures')

    # disable autotx
    pm.setAttr('defaultArnoldRenderOptions.autotx', 0)
    settings.updateAutoTxSettings()
    cmds.separator()

    # don't create texture_automip for 2017 as autoTx is ON by default
    maya_version = versions.shortName()
    if int(float(maya_version)) < 2017:
        pm.attrControlGrp('texture_automip',
                          label="Auto-mipmap",
                          attribute='defaultArnoldRenderOptions.textureAutomip')

    pm.attrControlGrp('texture_accept_unmipped',
                      label="Accept Unmipped",
                      attribute='defaultArnoldRenderOptions.textureAcceptUnmipped')

    cmds.separator()

    pm.checkBoxGrp('ts_autotile',
                   cc=settings.updateAutotileSettings,
                   label='',
                   label1='Auto-tile')

    pm.connectControl('ts_autotile', 'defaultArnoldRenderOptions.autotile',
                      index=2)

    pm.intSliderGrp('ts_texture_autotile',
                    label="Tile Size",
                    minValue=16,
                    maxValue=64,
                    fieldMinValue=16,
                    fieldMaxValue=1024
                    )

    pm.connectControl('ts_texture_autotile',
                      'defaultArnoldRenderOptions.textureAutotile', index=1)
    pm.connectControl('ts_texture_autotile',
                      'defaultArnoldRenderOptions.textureAutotile', index=2)
    pm.connectControl('ts_texture_autotile',
                      'defaultArnoldRenderOptions.textureAutotile', index=3)

    '''pm.attrControlGrp('texture_autotile',
                        label="Auto-tile Size",
                        attribute='defaultArnoldRenderOptions.textureAutotile')'''

    pm.attrControlGrp('texture_accept_untiled',
                      label="Accept Untiled",
                      attribute='defaultArnoldRenderOptions.textureAcceptUntiled')

    pm.attrControlGrp('texture_max_memory_MB',
                      label="Max Cache Size (MB)",
                      attribute='defaultArnoldRenderOptions.textureMaxMemoryMB')

    pm.attrControlGrp('texture_max_open_files',
                      label="Max Open Files",
                      attribute='defaultArnoldRenderOptions.textureMaxOpenFiles')

    cmds.separator()

    cmds.attrControlGrp('texture_diffuse_blur',
                        label="Diffuse Blur",
                        attribute='defaultArnoldRenderOptions.textureDiffuseBlur')

    # cmds.attrControlGrp('texture_glossy_blur',
    #                     label="Glossy Blur",
    #                     attribute='defaultArnoldRenderOptions.textureGlossyBlur')

    pm.setParent('..')

    pm.setUITemplate(popTemplate=True)
コード例 #27
0
    def showWindows(self):
        if cmds.window('ArnoldSettingUI', q=1, exists=1):
            cmds.deleteUI('ArnoldSettingUI')
        Mytool = cmds.window('ArnoldSettingUI',title='Mili Arnold Setting',widthHeight=(420,600),sizeable=False)
        cmds.rowColumnLayout( numberOfColumns=1, columnWidth=[(1, 420)])
        cmds.text(label='Arnold Global Setting',height=30, backgroundColor=[0.5, 0.5, 0.6])
        cmds.separator(style='out')
        tabs = cmds.tabLayout('tabsNameSpace')

        #################################
        #Common
        child1 = cmds.rowColumnLayout(numberOfColumns=1, columnWidth=[(1, 420)])
        cmds.scrollLayout('scrollLayoutUnique1', height=600)


        #File Output
        cmds.frameLayout(label='File Output', collapsable=True, collapse=False,width=410,borderStyle='etchedIn')
        cmds.columnLayout(adjustableColumn=True)
        cmds.separator(style='in')
        cmds.attrControlGrp('defaultResolutionWidth',attribute="defaultRenderGlobals.imageFilePrefix ",label='File name prefix:')
        cmds.separator(style='in')
        cmds.attrControlGrp(attribute="defaultRenderGlobals.animation",label='Frame/Animation ext')
        cmds.attrControlGrp(attribute="defaultRenderGlobals.outFormatControl",label='Out Format Control:')
        cmds.attrControlGrp(attribute="defaultRenderGlobals.extensionPadding",label='Frame padding:')
        cmds.setParent('..')
        cmds.setParent('..')


        #Image Size
        cmds.frameLayout(label='Image Size', collapsable=True, collapse=False,width=410,borderStyle='etchedIn')
        cmds.columnLayout(adjustableColumn=True)
        cmds.separator(style='in')
        cmds.attrControlGrp('defaultResolutionWidth',attribute="defaultResolution.width",label='Width in pixels:')
        cmds.attrControlGrp('defaultResolutionHeight',attribute="defaultResolution.height",label='Height in pixels:')
        cmds.attrControlGrp(attribute="defaultResolution.imageSizeUnits",label='Size units:')
        cmds.attrControlGrp(attribute="defaultResolution.dpi",label='Resolution:')
        cmds.attrControlGrp(attribute="defaultResolution.pixelDensityUnits",label='Resolution units:')
        cmds.separator(style='in')
        cmds.attrControlGrp(attribute="defaultResolution.deviceAspectRatio",label='Device aspect ratio:')
        cmds.attrControlGrp(attribute="defaultResolution.pixelAspect",label='Pixel aspect ratio:')
        cmds.setParent('..')
        cmds.setParent('..')


        #Render Option
        cmds.frameLayout(label='Render Option', collapsable=True, collapse=False,width=410,borderStyle='etchedIn')
        cmds.columnLayout(adjustableColumn=True)
        cmds.attrControlGrp(attribute="defaultRenderGlobals.preMel",label='Pre render MEL:')
        cmds.attrControlGrp(attribute="defaultRenderGlobals.postMel",label='Post render MEL')
        cmds.attrControlGrp(attribute="defaultRenderGlobals.prlm",label='Pre render layer MEL')
        cmds.attrControlGrp(attribute="defaultRenderGlobals.polm",label='Post render layer MEL')
        cmds.attrControlGrp(attribute="defaultRenderGlobals.prm",label='Post render frame MEL')
        cmds.attrControlGrp(attribute="defaultRenderGlobals.pom",label='Post render frame MEL')
        cmds.setParent('..')
        cmds.setParent('..')
        cmds.setParent('..')
        cmds.setParent('..')

        #################################
        #Arnold Renderer
        child2 = cmds.rowColumnLayout(numberOfColumns=1, columnWidth=[(1, 420)])
        cmds.scrollLayout('scrollLayoutUnique2', height=600)

        #Sampling
        cmds.frameLayout(label='Sampling', collapsable=True, collapse=False,borderStyle='etchedIn',width=410)
        cmds.columnLayout(adjustableColumn=True)
        cmds.attrControlGrp( attribute='defaultArnoldRenderOptions.AASamples',label='Camera(AA)')
        cmds.attrControlGrp( attribute='defaultArnoldRenderOptions.GIDiffuseSamples',label='Diffuse')
        cmds.attrControlGrp( attribute='defaultArnoldRenderOptions.GIGlossySamples',label='Glossy')
        cmds.attrControlGrp( attribute='defaultArnoldRenderOptions.GIRefractionSamples',label='Refraction')
        cmds.attrControlGrp( attribute='defaultArnoldRenderOptions.sssBssrdfSamples',label='SSS')
        cmds.attrControlGrp( attribute='defaultArnoldRenderOptions.volumeIndirectSamples',label='Volume Indirect')
        cmds.separator(style='in')
        cmds.attrControlGrp( attribute="defaultArnoldRenderOptions.lock_sampling_noise",label='Lock Sampling Pattern')
        cmds.attrControlGrp( attribute="defaultArnoldRenderOptions.sssUseAutobump",label='Use Autobump in SSS')
        cmds.setParent('..')
        cmds.columnLayout(adjustableColumn=True)
        cmds.frameLayout(label='Clamping', collapsable=True, collapse=True,borderStyle='out')
        cmds.rowColumnLayout(numberOfColumns=2, columnWidth=[(1, 145),(2,200)])
        cmds.text('Clamp Sample Values ',align='right',height=25)
        cmds.checkBox('Clamp_Sample_Values',value=cmds.getAttr("defaultArnoldRenderOptions.use_sample_clamp"),label='',onCommand=lambda *arg:self.Clamp_Sample_Values_On(),offCommand=lambda *arg:self.Clamp_Sample_Values_Off())
        cmds.text('Affect_AOVs_text',enable=cmds.getAttr("defaultArnoldRenderOptions.use_sample_clamp"),label='Affect AOVs ',align='right')
        cmds.checkBox('Affect_AOVs',enable=cmds.getAttr("defaultArnoldRenderOptions.use_sample_clamp"),value=cmds.getAttr("defaultArnoldRenderOptions.use_sample_clamp_AOVs"),label='',onCommand=lambda *arg:cmds.setAttr("defaultArnoldRenderOptions.use_sample_clamp_AOVs",1),offCommand=lambda *arg:cmds.setAttr("defaultArnoldRenderOptions.use_sample_clamp_AOVs",0))
        cmds.setParent('..')
        cmds.attrControlGrp('Max_Value',attribute="defaultArnoldRenderOptions.AASampleClamp",label='Max Value',enable=cmds.getAttr("defaultArnoldRenderOptions.use_sample_clamp"))
        cmds.setParent('..')
        cmds.frameLayout(label='Filter', collapsable=True, collapse=True,borderStyle='out')
        cmds.columnLayout(adjustableColumn=True)
        cmds.text(label=u'很抱歉,这项功能暂不支持。如有需要请联系RnD!',align='center',backgroundColor=(0.6,0.5,0.5),height=40)
        '''
        cmds.rowColumnLayout(numberOfColumns=2, columnWidth=[(1, 115),(2,120)])
        cmds.text(' ')
        cmds.optionMenu('Filter_optionMenu',label='Type')
        cmds.menuItem(label='gaussian')
        cmds.menuItem(label='blackman_harris')
        cmds.menuItem(label='box')
        cmds.menuItem(label='catrom')
        cmds.menuItem(label='catrom2d')
        cmds.menuItem(label='closest')
        cmds.menuItem(label='cone')
        cmds.menuItem(label='cook')
        cmds.menuItem(label='cubic')
        cmds.menuItem(label='disk')
        cmds.menuItem(label='farthest')
        cmds.menuItem(label='heatmap')
        cmds.menuItem(label='mitnet')
        cmds.menuItem(label='sinc')
        cmds.menuItem(label='triangle')
        cmds.menuItem(label='variance')
        cmds.menuItem(label='video')
        cmds.optionMenu('Filter_optionMenu',value='gaussian',e=True)
        cmds.columnLayout(adjustableColumn=True)
        cmds.attrControlGrp(attribute="defaultArnoldFilter.width",label='Width')
        cmds.setParent('..')
        '''
        cmds.setParent('..')
        cmds.setParent('..')
        cmds.setParent('..')
        cmds.setParent('..')

        #Ray Depth
        cmds.frameLayout(label='Ray Depth', collapsable=True, collapse=True,width=410,borderStyle='etchedIn')
        cmds.columnLayout(adjustableColumn=True)
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.GITotalDepth",label='Total')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.GIDiffuseDepth",label='Diffuse')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.GIGlossyDepth",label='Glossy')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.GIReflectionDepth",label='Reflection')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.GIRefractionDepth",label='Refraction')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.GIVolumeDepth",label='Volume')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.autoTransparencyDepth",label='Transparency Depth')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.autoTransparencyThreshold",label='Transparency Threshold')
        cmds.setParent('..')
        cmds.setParent('..')

        #Environment
        cmds.frameLayout(label='Environment', collapsable=True, collapse=True,width=410,borderStyle='etchedIn')
        cmds.columnLayout(adjustableColumn=True)
        cmds.text(label=u'很抱歉,这项功能暂不支持。如有需要请联系RnD!',align='center',backgroundColor=(0.6,0.5,0.5),height=80)
        cmds.setParent('..')
        cmds.setParent('..')

        #Motion Blur
        cmds.frameLayout(label='Motion Blur', collapsable=True, collapse=True,width=410,borderStyle='etchedIn')
        cmds.columnLayout(adjustableColumn=True)
        cmds.rowColumnLayout(numberOfColumns=2, columnWidth=[(1, 145),(2,255)])
        cmds.text('Enable  ',height=18,align='right')
        cmds.checkBox('Enable_MB',value=cmds.getAttr("defaultArnoldRenderOptions.motion_blur_enable"),label='',onCommand=lambda *args:self.Enable_MB_On(),offCommand=lambda *args:self.Enable_MB_Off())
        cmds.text('Deformation_Text', enable=cmds.getAttr("defaultArnoldRenderOptions.motion_blur_enable"),label='Deformation  ',height=18,align='right')
        cmds.checkBox('Deformation_MB',value=cmds.getAttr("defaultArnoldRenderOptions.mb_object_deform_enable"),label='',enable=cmds.getAttr("defaultArnoldRenderOptions.motion_blur_enable"),onCommand=lambda *args:self.Deformation_MB_On(),offCommand=lambda *args:self.Deformation_MB_Off())
        cmds.text('Camera_MB',label='Camera  ',height=18,align='right',enable=cmds.getAttr("defaultArnoldRenderOptions.motion_blur_enable"))
        cmds.checkBox('Camera_MB',value=cmds.getAttr("defaultArnoldRenderOptions.mb_camera_enable"),label='',enable=cmds.getAttr("defaultArnoldRenderOptions.motion_blur_enable"),onCommand=lambda *args:self.Camera_MB_On(),offCommand=lambda *args:self.Camera_MB_Off())
        cmds.setParent('..')
        cmds.attrControlGrp('Keys_MB',attribute="defaultArnoldRenderOptions.motion_steps",label='Keys',enable=cmds.getAttr("defaultArnoldRenderOptions.motion_blur_enable"))
        cmds.separator(style='in')
        cmds.rowColumnLayout(numberOfColumns=2, columnWidth=[(1, 145),(2,100)])
        cmds.text('Position_MB',label='Position  ',align='right',enable=cmds.getAttr("defaultArnoldRenderOptions.motion_blur_enable"))
        flag_MB = cmds.getAttr("defaultArnoldRenderOptions.range_type")
        if flag_MB == 0:
            optionValue = 'Start On Frame'
            enableFlag1 = True
            enableFlag2 = False
        elif flag_MB == 1:
            optionValue = 'Center On Frame'
            enableFlag1 = True
            enableFlag2 = False
        elif flag_MB == 2:
            optionValue = 'End On Frame'
            enableFlag1 = True
            enableFlag2 = False
        else:
            optionValue = 'Custom'
            enableFlag1 = False
            enableFlag2 = True
        cmds.optionMenu('Position_optionMenu_MB',label='',enable=cmds.getAttr("defaultArnoldRenderOptions.motion_blur_enable"),changeCommand=lambda *args:self.Position_optionMenu_MB())
        cmds.menuItem(label='Start On Frame')
        cmds.menuItem(label='Center On Frame')
        cmds.menuItem(label='End On Frame')
        cmds.menuItem(label='Custom')
        cmds.optionMenu('Position_optionMenu_MB',value=optionValue,e=True)
        cmds.setParent('..')
        cmds.columnLayout(adjustableColumn=True)
        cmds.attrControlGrp('Length_MB',attribute="defaultArnoldRenderOptions.motion_frames",label='Length ',enable=enableFlag1)
        cmds.attrControlGrp('Start_MB',attribute="defaultArnoldRenderOptions.motion_start",label='Start ',enable=enableFlag2)
        cmds.attrControlGrp('End_MB',attribute="defaultArnoldRenderOptions.motion_end",label='End ',enable=enableFlag2)
        cmds.setParent('..')
        cmds.setParent('..')
        cmds.setParent('..')

        #Lights
        cmds.frameLayout(label='Lights', collapsable=True, collapse=True,width=410,borderStyle='etchedIn')
        cmds.columnLayout(adjustableColumn=True)
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.lowLightThreshold",label='Low Light Threshold')
        cmds.separator(style='in')
        cmds.columnLayout(adjustableColumn=True)
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.lightLinking",label='Light Linking')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.shadowLinking" ,label='Shadow Linking')
        cmds.setParent('..')
        cmds.setParent('..')
        cmds.setParent('..')

        #Gamma Correction
        cmds.frameLayout(label='Gamma Correction', collapsable=True, collapse=True,width=410,borderStyle='etchedIn')
        cmds.columnLayout(adjustableColumn=True)
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.display_gamma",label='Display Driver Gamma')
        cmds.separator(style='in')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.light_gamma",label='Lights')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.shader_gamma",label='Shaders')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.texture_gamma",label='Textures')
        cmds.setParent('..')
        cmds.setParent('..')

        #Textures
        cmds.frameLayout(label='Textures', collapsable=True, collapse=True,width=410,borderStyle='etchedIn')
        cmds.columnLayout(adjustableColumn=True)
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.textureAutomip",label='Auto-mipmap')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.textureAcceptUnmipped",label='Accept Unmipped')
        cmds.separator(style='in')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.autotile",label='Auto-tile',changeCommand=lambda *args:self.Auto_tile())
        cmds.attrControlGrp('Tile_Size_T',attribute="defaultArnoldRenderOptions.textureAutotile",label='Tile Size',enable=cmds.getAttr("defaultArnoldRenderOptions.autotile"))
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.textureAcceptUntiled",label='Accept Untiled')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.use_existing_tiled_textures",label='Use Existing .tx Textures')
        cmds.separator(style='in')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.textureMaxMemoryMB",label='Max Cache Size(MB)')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.textureMaxOpenFiles",label='Max Open Files')
        cmds.separator(style='in')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.textureDiffuseBlur",label='Diffuse Blur')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.textureGlossyBlur",label='Glossy Blur')
        cmds.setParent('..')
        cmds.setParent('..')

        cmds.setParent('..')
        cmds.setParent('..')

        #################################
        #Systrm
        child3 = cmds.rowColumnLayout(numberOfColumns=1, columnWidth=[(1, 420)])
        cmds.scrollLayout('scrollLayoutUnique3', height=600)

        #Maya Integration
        cmds.frameLayout(label='Maya Integration', collapsable=True, collapse=False,width=410,borderStyle='etchedIn')
        cmds.columnLayout(adjustableColumn=True)
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.progressive_rendering",label='Progressive Refinement')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.progressive_initial_level",label='Initial Sampling Level')
        cmds.separator(style='in')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.clear_before_render",label='Clear Before Render')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.force_scene_update_before_IPR_refresh",label='Force Scene Update On IPR Refresh')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.force_texture_cache_flush_after_render",label='Force Texture Cache Flush After Render')
        cmds.separator(style='in')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.enable_swatch_render",label='Enable Swatch Render')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.standinDrawOverride",label='StandIn Viewport Override')
        cmds.setParent('..')
        cmds.setParent('..')

        #Render Settings
        cmds.frameLayout(label='Render Settings', collapsable=True, collapse=False,width=410,borderStyle='etchedIn')
        cmds.columnLayout(adjustableColumn=True)
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.renderType",label='Render Type')
        cmds.separator(style='in')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.bucketScanning",label='Bucket Scanning')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.bucketSize",label='Bucket Size')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.outputOverscan",label='Overscan')
        cmds.separator(style='in')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.threads_autodetect",label='Autodetect Threads',changeCommand=lambda *args:self.Autodetect_Threads())
        key = cmds.getAttr("defaultArnoldRenderOptions.threads_autodetect")
        if key == True:
            flag = False
        else:
            flag = True
        cmds.attrControlGrp('Threads_S',attribute="defaultArnoldRenderOptions.threads",label='Threads',enable=flag)
        cmds.separator(style='in')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.binaryAss",label='Binary-encode ASS Files')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.outputAssBoundingBox",label='Export Bounding Box(.asstoc)')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.expandProcedurals",label='Expand Procedurals')
        cmds.separator(style='in')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.kickRenderFlags",label='Kick Render Flags')
        cmds.setParent('..')
        cmds.setParent('..')

        #Search Paths
        cmds.frameLayout(label='Search Paths', collapsable=True, collapse=False,width=410,borderStyle='etchedIn')
        cmds.columnLayout(adjustableColumn=True)
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.absoluteTexturePaths",label='Absolute Texture Paths')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.absoluteProceduralPaths",label='Absolute Procedural Paths')
        cmds.separator(style='in')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.procedural_searchpath",label='Procedural Search Path')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.shader_searchpath",label='Shader Search Path')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.texture_searchpath",label='Texture Search Path')
        cmds.setParent('..')
        cmds.setParent('..')

        #Licensing
        cmds.frameLayout(label='Licensing', collapsable=True, collapse=False,width=410,borderStyle='etchedIn')
        cmds.columnLayout(adjustableColumn=True)
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.abortOnLicenseFail",label='About On License Fail')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.skipLicenseCheck",label='Skip License Check')
        cmds.setParent('..')
        cmds.setParent('..')
        cmds.setParent('..')
        cmds.setParent('..')

        #################################
        #AOVs
        child4 = cmds.rowColumnLayout(numberOfColumns=1, columnWidth=[(1, 420)])
        cmds.rowColumnLayout(numberOfColumns=1, columnWidth=[(1, 420)])
        cmds.columnLayout(adjustableColumn=True)
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.aovMode",label='Mode',changeCommand=lambda *args:self.Mode_A())
        cmds.rowColumnLayout(numberOfColumns=3, columnWidth=[(1, 143),(2,200),(3,50)])
        cmds.text('Render View AOV ',align='right')
        cmds.optionMenu('RenderViewAOVs_optionMenu',label='',changeCommand=lambda *args:self.renderViewAov())
        aiAOVs = cmds.listConnections('defaultArnoldRenderOptions.aovList')
        cmds.menuItem(label='beauty')
        if aiAOVs != None:
            for aiAOV in aiAOVs:
                name = cmds.getAttr('%s.name'%aiAOV)
                cmds.menuItem(label=name)
        cmds.text(' ')
        cmds.setParent('..')
        cmds.setParent('..')
        cmds.setParent('..')
        key = cmds.getAttr("defaultArnoldRenderOptions.aovMode")
        if key == 0:
            flag = False
        else:
            flag = True
        cmds.rowColumnLayout(numberOfColumns=1, columnWidth=[(1, 420)])
        cmds.scrollLayout('scrollLayoutUnique', height=550)

        #Default Drivers
        cmds.frameLayout('Default_Drivers_frameLayout',label='Default Drivers', collapsable=True, collapse=True,width=410,borderStyle='etchedIn',enable=flag)
        cmds.columnLayout(adjustableColumn=True)
        cmds.rowColumnLayout(numberOfColumns=3, columnWidth=[(1, 140),(2,100),(3,50)])
        cmds.text('Default Arnold Display Driver ',align='right')
        cmds.optionMenu(label='')
        cmds.menuItem(label='exr')
        cmds.text(' ')
        cmds.setParent('..')
        cmds.frameLayout(collapsable=False, labelVisible=False,collapse=True,width=410,borderStyle='etchedIn')
        cmds.columnLayout(adjustableColumn=True)
        cmds.attrControlGrp(attribute="defaultArnoldDisplayDriver.exrCompression",label='Compression')
        cmds.attrControlGrp(attribute="defaultArnoldDisplayDriver.halfPrecision",label='Half Precision')
        cmds.attrControlGrp(attribute="defaultArnoldDisplayDriver.preserveLayerName",label='Preserve Layer Name')
        cmds.attrControlGrp(attribute="defaultArnoldDisplayDriver.tiled",label='Tiled')
        cmds.attrControlGrp(attribute="defaultArnoldDisplayDriver.autocrop",label='Autocrop')
        cmds.attrControlGrp(attribute="defaultArnoldDisplayDriver.append",label='Append')
        cmds.frameLayout(label='Default Drivers', collapsable=True, collapse=True,width=410,borderStyle='etchedIn')
        cmds.columnLayout(adjustableColumn=True)
        cmds.text(label=u'很抱歉,这项功能暂不支持。如有需要请联系RnD!',align='center',backgroundColor=(0.6,0.5,0.5),height=40)
        cmds.setParent('..')
        cmds.setParent('..')
        cmds.setParent('..')
        cmds.setParent('..')
        cmds.setParent('..')
        cmds.setParent('..')

        #AOV Browser
        cmds.frameLayout('AOV_Browser_frameLayout',label='AOV Browser', collapsable=True, collapse=False,width=410,borderStyle='etchedIn',height=200,enable=flag)
        cmds.columnLayout(adjustableColumn=True)
        cmds.text(label=u'很抱歉,这项功能正在开发,请耐心等待。',align='center',backgroundColor=(0.6,0.5,0.5),height=30)
        cmds.rowColumnLayout(numberOfColumns=3, columnWidth=[(1, 135),(2,135),(3,135)])
        cmds.columnLayout(adjustableColumn=True)
        cmds.text('AOV Groups',align='center')
        cmds.textScrollList('AOV_Groups_A', numberOfRows=8, allowMultiSelection=True,
                            append=['<builtin>', 'aiHair', 'aiSkin', 'aiStandard', 'alCel', 'alHair','alHairX','alLayer','alSurface','alSurfaceX'],height=160)
        cmds.setParent('..')
        cmds.columnLayout(adjustableColumn=True)
        cmds.text('Available AOVs',align='center')
        cmds.textScrollList('Available_AOVs_A', numberOfRows=8, allowMultiSelection=True,append=[],height=135)
        cmds.button(label='>>')
        cmds.setParent('..')
        cmds.columnLayout(adjustableColumn=True)
        cmds.text('Active AOVs',align='center')
        cmds.textScrollList('Active_AOVs_A', numberOfRows=8, allowMultiSelection=True,
                        append=[],height=135)

        cmds.button(label='<<')
        cmds.setParent('..')
        cmds.setParent('..')
        cmds.setParent('..')
        cmds.setParent('..')

        #AOVs
        cmds.frameLayout('AOVs_frameLayout',label='AOVs', collapsable=True, collapse=False,width=410,borderStyle='in')
        cmds.columnLayout(adjustableColumn=True)
        cmds.rowColumnLayout(numberOfColumns=4, columnWidth=[(1, 140),(2,100),(3,100),(4,80)])
        cmds.text(' ')
        cmds.button(label='Add Custom',command=lambda *args:self.addCustom_AOVS())
        cmds.button(label='Delete All',command=lambda *args:self.deleteAll_AOVs())
        cmds.text(' ')
        cmds.setParent('..')
        cmds.separator(style='in')
        cmds.rowColumnLayout(numberOfColumns=4, columnWidth=[(1, 140),(2,60),(3,60),(4,80)])
        cmds.text(label='name',align='center')
        cmds.text(label='data',align='center')
        cmds.text(label='driver',align='center')
        cmds.text(label='filter',align='center')
        cmds.setParent('..')
        cmds.frameLayout('aiAOV_nodeList',labelVisible=False,width=420,borderStyle='in')
        aiAOVs = cmds.listConnections('defaultArnoldRenderOptions.aovList')
        if aiAOVs != None:
            for aiAOV in aiAOVs:
                self.cmdsGuiGroup(aiAOV)
        cmds.setParent('..')
        cmds.setParent('..')
        cmds.setParent('..')

        cmds.setParent('..')
        cmds.setParent('..')
        cmds.setParent('..')

        #################################
        #Diagnostics
        child5 = cmds.rowColumnLayout(numberOfColumns=1, columnWidth=[(1, 420)])
        cmds.scrollLayout('scrollLayoutUnique5', height=600)

        #Log
        cmds.frameLayout(label='Log', collapsable=True, collapse=False,width=410,borderStyle='etchedIn')
        cmds.columnLayout(adjustableColumn=True)
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.log_verbosity",label='Verbosity Level')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.log_to_console",label='Console')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.log_to_file",label='File',changeCommand=lambda *args:self.File_D())
        cmds.attrControlGrp('Filename_D',attribute="defaultArnoldRenderOptions.log_filename",label='Filename',enable=cmds.getAttr("defaultArnoldRenderOptions.log_to_file"))
        cmds.attrControlGrp('Max_Warnings_D',attribute="defaultArnoldRenderOptions.log_max_warnings",label='Max.Warnings',enable=cmds.getAttr("defaultArnoldRenderOptions.log_to_file"))
        cmds.setParent('..')
        cmds.setParent('..')

        #Error Handing
        cmds.frameLayout(label='Error Handing', collapsable=True, collapse=False,width=410,borderStyle='etchedIn')
        cmds.columnLayout(adjustableColumn=True)
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.abortOnError",label='About On Error')
        cmds.separator(style='in')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.errorColorBadTexture",label='Texture Error Color')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.errorColorBadPixel",label='NaN Error Color')
        cmds.setParent('..')
        cmds.setParent('..')
        cmds.setParent('..')
        cmds.setParent('..')

        #################################
        #Override
        child6 = cmds.rowColumnLayout(numberOfColumns=1, columnWidth=[(1, 420)])
        cmds.scrollLayout('scrollLayoutUnique6', height=600)

        #User Options
        cmds.frameLayout(label='User Options', collapsable=True, collapse=False,width=410,borderStyle='out')
        cmds.columnLayout(adjustableColumn=True)
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.aiUserOptions",label='Option')
        cmds.setParent('..')
        cmds.setParent('..')

        #Feature Overrides
        cmds.frameLayout(label='Feature Overrides', collapsable=True, collapse=False,width=410,borderStyle='out')
        cmds.columnLayout(adjustableColumn=True)
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.ignoreTextures",label='Ignore Textures')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.ignoreShaders",label='Ignore Shaders')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.ignoreAtmosphere",label='Ignore Atmosphere')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.ignoreLights",label='Ignore Lights')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.ignoreShadows",label='Ignore Shadows')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.ignoreSubdivision",label='Ignore Subdivision')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.ignoreDisplacement",label='Ignore Displacement')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.ignoreBump",label='Ignore Bump')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.ignoreSmoothing",label='Ignore Normal Smoothing')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.ignoreMotionBlur",label='Ignore Motion Blur')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.ignoreDof",label='Ignore Depth of Field')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.ignoreSss",label='Ignore Sub-Surface-Scattering')
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.forceTranslateShadingEngines",label='Force Translation of Shading Engines')
        cmds.setParent('..')
        cmds.setParent('..')

        #Subdivision
        cmds.frameLayout(label='Subdivision', collapsable=True, collapse=False,width=410,borderStyle='out')
        cmds.columnLayout(adjustableColumn=True)
        cmds.attrControlGrp(attribute="defaultArnoldRenderOptions.maxSubdivisions",label='Max.Subdvisions')
        cmds.setParent('..')
        cmds.setParent('..')
        cmds.setParent('..')
        cmds.setParent('..')

        cmds.tabLayout(tabs, edit=True, tabLabel=((child1, 'Common'),(child2,'Arnold Renderer'),(child3,'Systrm'),(child4,'AOVs'),(child5,'Diagnosics'),(child6,'Override')) )
        cmds.setParent('..')
        cmds.button(label='Close',height=30,command=lambda *args:cmds.deleteUI('ArnoldSettingUI'))
        cmds.showWindow(Mytool)
コード例 #28
0
ファイル: controlObject.py プロジェクト: griffinanimator/MPR
    def UI(self, parentLayout):
        cmds.setParent(parentLayout)
        cmds.separator()

        niceName = utils.stripLeadingNamespace(self.controlObject)[1]
        cmds.text(label=niceName)

        cmds.attrControlGrp(attribute=self.controlObject + ".display",
                            label="Visibility: ")

        if self.translation == [True, True, True]:
            cmds.attrControlGrp(attribute=self.controlObject + ".translate",
                                label="Translate")
        else:
            if self.translation[0] == True:
                cmds.attrControlGrp(attribute=self.controlObject +
                                    ".translateX",
                                    label="Translate X")

            if self.translation[1] == True:
                cmds.attrControlGrp(attribute=self.controlObject +
                                    ".translateY",
                                    label="Translate Y")

            if self.translation[2] == True:
                cmds.attrControlGrp(attribute=self.controlObject +
                                    ".translateZ",
                                    label="Translate Z")

        if self.rotation == [True, True, True]:
            cmds.attrControlGrp(attribute=self.controlObject + ".rotate",
                                label="Rotate")
        else:
            if self.translation[0] == True:
                cmds.attrControlGrp(attribute=self.controlObject + ".rotateX",
                                    label="Rotate X")

            if self.translation[1] == True:
                cmds.attrControlGrp(attribute=self.controlObject + ".rotateY",
                                    label="Rotate Y")

            if self.translation[2] == True:
                cmds.attrControlGrp(attribute=self.controlObject + ".rotateZ",
                                    label="Rotate Z")
        # WARNING Commented out the global scale here.
        if self.globalScale == True:
            try:
                cmds.attrControlGrp(attribute=self.controlObject +
                                    ".globalScale",
                                    label="Scale")
            except:
                pass
コード例 #29
0
 def Clamp_Sample_Values_Off(self):
     cmds.setAttr("defaultArnoldRenderOptions.use_sample_clamp",0)
     cmds.text('Affect_AOVs_text',enable=False,e=True)
     cmds.checkBox('Affect_AOVs',enable=False,e=True)
     cmds.attrControlGrp('Max_Value',enable=False,e=True)
コード例 #30
0
ファイル: arnold_patches.py プロジェクト: all-in-one-of/anima
def createArnoldTextureSettings():
    """The patched version of the original file
    """
    import pymel.core as pm
    import maya.cmds as cmds
    import pymel.versions as versions
    from mtoa.ui.globals import settings

    pm.setUITemplate('attributeEditorTemplate', pushTemplate=True)
    pm.columnLayout(adjustableColumn=True)

    pm.attrControlGrp('autotx',
                      cc=settings.updateAutoTxSettings,
                      label="Auto-convert Textures to TX (Disabled in Anima)",
                      attribute='defaultArnoldRenderOptions.autotx',
                      enable=False)

    pm.attrControlGrp(
        'use_existing_tiled_textures',
        label="Use Existing TX Textures",
        attribute='defaultArnoldRenderOptions.use_existing_tiled_textures')

    # disable autotx
    pm.setAttr('defaultArnoldRenderOptions.autotx', 0)
    settings.updateAutoTxSettings()
    cmds.separator()

    # don't create texture_automip for 2017 as autoTx is ON by default
    maya_version = versions.shortName()
    if int(float(maya_version)) < 2017:
        pm.attrControlGrp(
            'texture_automip',
            label="Auto-mipmap",
            attribute='defaultArnoldRenderOptions.textureAutomip')

    pm.attrControlGrp(
        'texture_accept_unmipped',
        label="Accept Unmipped",
        attribute='defaultArnoldRenderOptions.textureAcceptUnmipped')

    cmds.separator()

    pm.checkBoxGrp('ts_autotile',
                   cc=settings.updateAutotileSettings,
                   label='',
                   label1='Auto-tile')

    pm.connectControl('ts_autotile',
                      'defaultArnoldRenderOptions.autotile',
                      index=2)

    pm.intSliderGrp('ts_texture_autotile',
                    label="Tile Size",
                    minValue=16,
                    maxValue=64,
                    fieldMinValue=16,
                    fieldMaxValue=1024)

    pm.connectControl('ts_texture_autotile',
                      'defaultArnoldRenderOptions.textureAutotile',
                      index=1)
    pm.connectControl('ts_texture_autotile',
                      'defaultArnoldRenderOptions.textureAutotile',
                      index=2)
    pm.connectControl('ts_texture_autotile',
                      'defaultArnoldRenderOptions.textureAutotile',
                      index=3)
    '''pm.attrControlGrp('texture_autotile',
                        label="Auto-tile Size",
                        attribute='defaultArnoldRenderOptions.textureAutotile')'''

    pm.attrControlGrp(
        'texture_accept_untiled',
        label="Accept Untiled",
        attribute='defaultArnoldRenderOptions.textureAcceptUntiled')

    pm.attrControlGrp(
        'texture_max_memory_MB',
        label="Max Cache Size (MB)",
        attribute='defaultArnoldRenderOptions.textureMaxMemoryMB')

    pm.attrControlGrp(
        'texture_max_open_files',
        label="Max Open Files",
        attribute='defaultArnoldRenderOptions.textureMaxOpenFiles')

    cmds.separator()

    cmds.attrControlGrp(
        'texture_diffuse_blur',
        label="Diffuse Blur",
        attribute='defaultArnoldRenderOptions.textureDiffuseBlur')

    # cmds.attrControlGrp('texture_glossy_blur',
    #                     label="Glossy Blur",
    #                     attribute='defaultArnoldRenderOptions.textureGlossyBlur')

    pm.setParent('..')

    pm.setUITemplate(popTemplate=True)
コード例 #31
0
ファイル: blueprint.py プロジェクト: firstPeterParker/mlRig
	def create_rotation_order_ui_control(self, joint):

		joint_name = utils.strip_all_namespaces(joint)[1]
		attr_control_group = cmds.attrControlGrp(attribute=joint+".rotateOrder", label=joint_name)
コード例 #32
0
	def UI(self,parentLayout):
		cmds.setParent(parentLayout)
		cmds.separator()
		
		niceName = utils.stripAllNamespaces(self.controlObject)[1]
		cmds.text(label=niceName)
		
		cmds.attrControlGrp(attribute=self.controlObject + '.display', label='Visibility: ')
		
		if self.translation == [True,True,True]:
			cmds.attrControlGrp(attribute=self.controlObject + '.translate', label='Translate')
		else:
			if self.translation[0] == True:
				cmds.attrControlGrp(attribute=self.controlObject + '.translateX', label='Translate X')
				
			if self.translation[1] == True:
				cmds.attrControlGrp(attribute=self.controlObject + '.translateY', label='Translate Y')
				
			if self.translation[2] == True:
				cmds.attrControlGrp(attribute=self.controlObject + '.translateZ', label='Translate Z')
			
			


		if self.rotation == [True,True,True]:
			cmds.attrControlGrp(attribute=self.controlObject + '.rotate', label='Rotate')
		else:
			if self.rotation[0] == True:
				cmds.attrControlGrp(attribute=self.controlObject + '.rotateX', label='Rotate X')
				
			if self.rotation[1] == True:
				cmds.attrControlGrp(attribute=self.controlObject + '.rotateY', label='Rotate Y')
				
			if self.rotation[2] == True:
				cmds.attrControlGrp(attribute=self.controlObject + '.rotateZ', label='Rotate Z')
				
		if self.globalScale == True:
			cmds.attrControlGrp(attribute=self.controlObject + '.globalScale', label='Scale')
コード例 #33
0
 def Position_optionMenu_MB(self):
     key = cmds.optionMenu('Position_optionMenu_MB',value=True,q=True)
     if key == 'Start On Frame':
         cmds.setAttr("defaultArnoldRenderOptions.range_type",0)
         cmds.attrControlGrp('Length_MB',enable=True,e=True)
         cmds.attrControlGrp('Start_MB',enable=False,e=True)
         cmds.attrControlGrp('End_MB',enable=False,e=True)
     elif key == 'Center On Frame':
         cmds.setAttr("defaultArnoldRenderOptions.range_type",1)
         cmds.attrControlGrp('Length_MB',enable=True,e=True)
         cmds.attrControlGrp('Start_MB',enable=False,e=True)
         cmds.attrControlGrp('End_MB',enable=False,e=True)
     elif key == 'End On Frame':
         cmds.setAttr("defaultArnoldRenderOptions.range_type",2)
         cmds.attrControlGrp('Length_MB',enable=True,e=True)
         cmds.attrControlGrp('Start_MB',enable=False,e=True)
         cmds.attrControlGrp('End_MB',enable=False,e=True)
     else:
         cmds.setAttr("defaultArnoldRenderOptions.range_type",3)
         cmds.attrControlGrp('Length_MB',enable=False,e=True)
         cmds.attrControlGrp('Start_MB',enable=True,e=True)
         cmds.attrControlGrp('End_MB',enable=True,e=True)
コード例 #34
0
    def adjustall():
        Xyz = pymel.window(title="XYZ Adjust", s=True, wh=(100, 50))
        pymel.columnLayout(adj=True)
        pymel.text(l="Adjust the Min & Max values")
        pymel.attrControlGrp(l="X Min", attribute='An_range.oldMinX')
        pymel.attrControlGrp(l="X Max", attribute='An_range.oldMaxX')
        pymel.attrControlGrp(l="Y Min", attribute='An_range.oldMinY')
        pymel.attrControlGrp(l="Y Max", attribute='An_range.oldMaxY')
        pymel.attrControlGrp(l="Z Min", attribute='An_range.oldMinZ')
        pymel.attrControlGrp(l="Z Max", attribute='An_range.oldMaxZ')

        pymel.showWindow(Xyz)
コード例 #35
0
 def UI_preferences(self, parentLayout):
     moduleGrp = self.blueprintNamespace + ":" + self.moduleNamespace + ":module_grp"
     cmds.attrControlGrp(attribute=moduleGrp+".offsetY", label="Offset Y")
     cmds.attrControlGrp(attribute=moduleGrp+".offsetZ", label="Offset Z")