def get_image_type( element ):
    """
    Returns the output format for a specific render element
    :param element: the render element we want to know the output format for.
    :return: the output format
    """
    if not element or element == rfmConfig.DEFAULT_DISPLAY_NAME:
        return "exr"

    rmanDisplayInfo = rfmDisplays.get_displays()
    driverNode = rmanDisplayInfo["displays"][element]["driverNode"]
    
    return rfmConfig.cfg().displayDriverExtensions[ cmds.nodeType( driverNode ) ]
示例#2
0
def CreateUI(*args):
    # Load Renderman and check version
    cmds.evalDeferred("cmds.loadPlugin(\"RenderMan_for_Maya.py\")")
    from rfm2.config import cfg
    rmanversion = cfg().rfm_env['versions']['rfm']
    print rmanversion
    if rmanversion != "22.4":
        commonTools.areeeeett()
        cmds.evalDeferred(
            "cmds.warning('Wrong Renderman for Maya version (installed version is %s), should be 22.4')"
            % rmanversion)
        return

    # define template UI
    template = uiTemplate('ExampleTemplate', force=True)
    template.define(button, w=300, h=35, align='left')
    template.define(frameLayout, borderVisible=True, labelVisible=True)
    template.define(rowColumnLayout, numberOfColumns=2)
    template.define(optionMenu, w=200)
    template.define(optionMenu, h=35, w=300)

    try:
        cmds.deleteUI('setDressWindow')
    except RuntimeError:
        pass

    with window('setDressWindow',
                title='Set Dress Tools',
                menuBar=True,
                menuBarVisible=True) as win:
        with template:
            with columnLayout():

                with frameLayout('Prepare Scene'):
                    with columnLayout():
                        button(l='Import shot camera', \
                         c='import renderTools; \
							reload(renderTools); \
							renderTools.importShotCamera()'                                                        )
                        button(l='Set Frame Range From Camera', \
                         c='import previzTools;  \
							reload(previzTools); \
							previzTools.setShot()'                                               )
                        # button(l='Import Alembic as Reference', \
                        # 	c='import previzTools; \
                        # 	reload(previzTools); \
                        # 	previzTools.referenceAlembic()')

                with frameLayout('References'):
                    with columnLayout():
                        # button(l='Load all references from selection',\
                        # 	c='import setDressTools; \
                        # 	reload(setDressTools); \
                        # 	setDressTools.loadAllReferences()',en=False)
                        button(l='Unload references from selection',\
                         c='import setDressTools; \
							reload(setDressTools); \
							setDressTools.unloadSelected()'                                                        )
                        button(l='Backup transforms to Atom file',\
                         c='mel.eval("performExportAnim 1;")')

                with frameLayout('Quick reference'):
                    with columnLayout():
                        # button(l='Reference propsGround', \
                        # 	c='import setDressTools; \
                        # 	reload(setDressTools); \
                        # 	setDressTools.importAssetMa("propsGround")')
                        button(l='Reference propsRacetrack', \
                         c='import setDressTools; \
							reload(setDressTools); \
							setDressTools.importAssetMa("propsRaceTrack")'                                                                       )

                with frameLayout('Sectors'):
                    with columnLayout():
                        for sector in sectors:
                            button(l='Import sector %s'%sector, \
                             h=25, \
                             c='import setDressTools; \
								reload(setDressTools); \
								setDressTools.importSector("%s")'                                                              %sector)

                with frameLayout('Publish'):
                    with columnLayout():
                        button(l='Publish Set Dress', \
                         c='import setDressTools; \
							reload(setDressTools); \
							setDressTools.publishSetDress()'                                                         )
                        button(l='Publish Set Dress GPU', \
                         c='import setDressTools; \
							reload(setDressTools); \
							setDressTools.publishSetDressGPU()'                                                            )

                with frameLayout('Nomenclatures'):
                    button(l='Afficher nomenclatures', \
                     c='import commonTools; \
						reload(commonTools); \
						commonTools.showNomenclatures()'                                                     )
示例#3
0
def CreateUI(*args):
	# Load Renderman and check version
	cmds.evalDeferred("cmds.loadPlugin(\"RenderMan_for_Maya.py\")")
	from rfm2.config import cfg
	rmanversion = cfg().rfm_env['versions']['rfm']
	print rmanversion
	if rmanversion != "22.4" :
		commonTools.areeeeett()
		cmds.evalDeferred("cmds.warning('Wrong Renderman for Maya version (installed version is %s), should be 22.4')" % rmanversion)
		return

	# define template UI
	template = uiTemplate('ExampleTemplate', force=True)
	template.define(button, w=300, h=35, align='left')
	template.define(frameLayout, borderVisible=True, labelVisible=True)
	template.define(rowColumnLayout,numberOfColumns=2)
	template.define(optionMenu,h=35,w=300)

	try :
		deleteUI('renderWindow')
	except RuntimeError :
		pass

	with window('renderWindow', title='Render Tools',menuBar=True,menuBarVisible=True) as win:
			with template:
				with columnLayout():

					with frameLayout('Importomatic'):
						with columnLayout():
							button(l='Import shot camera', \
								c='import renderTools; \
								reload(renderTools); \
								renderTools.importShotCamera()')
							button(l='Set Frame Range From Camera', \
								c='import previzTools;  \
								reload(previzTools); \
								previzTools.setShot()')

						with columnLayout():
							button(l='Import shot animations', \
								c='import renderTools; \
								reload(renderTools); \
								renderTools.importShotAlembics()')
							button(l='Import shaders for animations', \
								c='import renderTools; \
								reload(renderTools); \
								renderTools.importShaders()')
							button(l='Asign shaders for animations', \
								c='import renderTools; \
								reload(renderTools); \
								renderTools.assignShaders()')

						with columnLayout():
							button(l='Import shot setDress', \
								c='import renderTools; \
								reload(renderTools); \
								renderTools.importSetDress()')

						with columnLayout():
							button(l='Import Lighting Rig', \
								c='import renderTools; \
								reload(renderTools); \
								renderTools.importLightRig()')
							optionMenu(changeCommand=chooseHDRfile)
							for file in hdri_files :
								file = file.split('HDR\\')[1]
								menuItem(label=file)
							

					with frameLayout('Import'):
						with columnLayout():
							button(l='Import Alembic as Reference', \
								c='import previzTools; \
								reload(previzTools); \
								previzTools.referenceAlembic()')

					with frameLayout('Geometries'):
						with columnLayout() :
							with rowLayout(numberOfColumns=2):
									button(l='Attach Subdiv Scheme',w=149, \
										c='import commonTools; \
										reload(commonTools); \
										commonTools.RfMsubdivScheme(1)')
									button(l="Detach Subdiv Scheme",w=148, \
										c='import commonTools; \
										reload(commonTools); \
										commonTools.RfMsubdivScheme(0)')
							with rowLayout(numberOfColumns=2):
								button(l='Inherit Trace Bias',w=149, \
										c = 'import renderTools ; \
										reload(renderTools) ; \
										renderTools.autoBias(True)')
								button(l='Divide Bias by 10',w=148, \
										c = 'import renderTools ; \
										reload(renderTools) ; \
										renderTools.autoBias(False)')
							with rowLayout(numberOfColumns=2):
								button(l='Inherit Motion Samples',w=149, \
										c = 'import renderTools ; \
										reload(renderTools) ; \
										renderTools.motionSamples(True)')
								button(l='Add 1 motion sample',w=148, \
										c = 'import renderTools ; \
										reload(renderTools) ; \
										renderTools.motionSamples(False)')
							
					
					with frameLayout('Rendering'):
						with columnLayout():
							button(l='Load Render Settings for PathTracer', \
								c='import commonTools; \
								reload(commonTools); \
								commonTools.loadRenderSettings("%s")' %pathTracerPreset)
							button(l='Load Render Settings for Unified', \
								c='import commonTools; \
								reload(commonTools); \
								commonTools.loadRenderSettings("%s")' %unifiedPreset, \
								en=False)

					with frameLayout('Nomenclatures'):
						with columnLayout():
							button(label='Nomenclatures',h=30, \
								c='import commonTools; \
								reload(commonTools); \
								commonTools.showNomenclatures()')
示例#4
0
def CreateUI(*args):
    # Try loading renderman and check version
    cmds.evalDeferred("cmds.loadPlugin(\"RenderMan_for_Maya.py\")")
    from rfm2.config import cfg
    rmanversion = cfg().rfm_env['versions']['rfm']
    print rmanversion
    if rmanversion != "22.3":
        import commonTools
        commonTools.areeeeett()
        cmds.evalDeferred(
            "cmds.warning('Wrong Renderman for Maya version (installed version is %s), should be 22.3')"
            % rmanversion)
    else:
        # define template
        template = uiTemplate(force=True)
        template.define(button, h=35, w=300, align='left')
        template.define(optionMenu, h=35, w=300)
        template.define(frameLayout, borderVisible=True, labelVisible=True)
        template.define(text, h=25)
        template.define(rowLayout)
        template.define(checkBox, h=35)

        try:
            cmds.deleteUI('lookdevWindow')
        except RuntimeError:
            pass

        with window('lookdevWindow',
                    title="Skid Lookdev Tools",
                    menuBar=True,
                    menuBarVisible=True) as win:
            with template:
                with frameLayout(l='Project'):
                    text('PROJECT IS SET TO')
                    text(scenePath)

                with frameLayout('Scene Setup'):
                    with columnLayout():
                        with rowLayout(numberOfColumns=3, ad3=1):
                            button(label='Import lookdev scene',w=198,\
                             c='import lookdevTools; \
								reload(lookdevTools); \
								lookdevTools.importLookdevScene()'                                                               )
                            button(label='Hide',w=48, \
                             c='import lookdevTools; \
								reload(lookdevTools); \
								lookdevTools.hideLookdevScene()'                                                             )
                            button(label='Reload',w=49, \
                             c='import lookdevTools; \
								reload(lookdevTools); \
								lookdevTools.reloadLookdevScene()'                                                               )
                        button(l='Load Render Settings', \
                         c='import commonTools; \
							reload(commonTools); \
							commonTools.loadRenderSettings("%s")'                                                               %lookdevPreset)
                        optionMenu(changeCommand=chooseHDRfile)
                        for file in hdri_files:
                            menuItem(label=file)

                with frameLayout('Geometries'):
                    with rowLayout(numberOfColumns=2):
                        button(label='Attach Subdiv Scheme',w=149, \
                         c='import commonTools; \
								reload(commonTools); \
								commonTools.RfMsubdivScheme(1)'                                                        )
                        button(label="Detach Subdiv Scheme",w=148, \
                         c='import commonTools; \
								reload(commonTools); \
								commonTools.RfMsubdivScheme(0)'                                                        )

                with frameLayout('Shading'):
                    with columnLayout():
                        with rowLayout(numberOfColumns=2, ad2=1):
                            with columnLayout():
                                button(l='Create PxrSurface network', \
                                 c='import lookdevTools; \
									reload(lookdevTools); \
									lookdevTools.createPxrSurfaceNetwork()'                                                                        )
                                button(l='Create PxrLayer network', \
                                 c='import lookdevTools; \
									reload(lookdevTools); \
									lookdevTools.createPxrLayerNetwork()'                                                                      ,en=False)
                                button(l='Convert PxrSurface to PxrLayer', \
                                 c='import lookdevTools; \
									reload(lookdevTools); \
									lookdevTools.convertPxrSurfaceToLayer()'                                                                         )

                with frameLayout('Turn locator'):
                    with columnLayout():
                        with rowLayout(numberOfColumns=2, ad2=1):
                            button(label="Create turn locator",w=248, \
                             c='import lookdevTools; \
								reload(lookdevTools); \
								lookdevTools.initTurn("%s")'                                                          % turnLocator)
                            button(label="Delete",  w=49, \
                             c='import lookdevTools; \
								reload(lookdevTools); \
								lookdevTools.delete_turn_loc()'                                                            )
                        with rowLayout(numberOfColumns=3, ad3=2):
                            for i in turnDurations:  # Create one button for each possible turn duration
                                button(label="%i frames" % i, w=98, \
                                 c='import lookdevTools; \
									reload(lookdevTools); \
									lookdevTools.changeFrameRange("%s",%i)'                                                                         % (turnLocator,i))

                with frameLayout('Turn Lighting'):
                    with columnLayout():
                        with rowLayout(numberOfColumns=3, ad3=2):
                            for i in turnDurations:  # Create one button for each possible turn duration
                                button(label="%i frames" % i, w=98, \
                                 c='import lookdevTools; \
									reload(lookdevTools); \
									lookdevTools.changeFrameRange("%s",%i); \
									lookdevTools.changeFrameRange("%s",%i,%i)'                                                                            % (turnLocator,i,hdriTurnGrp,i,i))
                        with rowLayout(numberOfColumns=1):
                            button(label='Disable lighting turn', \
                             c='import lookdevTools; \
								reload(lookdevTools); \
								lookdevTools.disableTurn("%s")'                                                             % hdriTurnGrp)

                with frameLayout('Nomenclatures'):
                    button(label='Afficher nomenclatures',h=30, \
                     c='import commonTools; \
						reload(commonTools); \
						commonTools.showNomenclatures()'                                                     )
示例#5
0
def CreateUI(*args):
    cmds.evalDeferred("cmds.loadPlugin(\"RenderMan_for_Maya.py\")")
    from rfm2.config import cfg
    rmanversion = cfg().rfm_env['versions']['rfm']
    print rmanversion
    if rmanversion != "22.4":
        commonTools.areeeeett()
        cmds.evalDeferred(
            "cmds.warning('Wrong Renderman for Maya version (installed version is %s), should be 22.4')"
            % rmanversion)
        return

    template = uiTemplate('ExampleTemplate', force=True)
    template.define(button, w=300, h=35, align='left')
    template.define(frameLayout, borderVisible=True, labelVisible=True)
    template.define(rowColumnLayout, numberOfColumns=1)
    template.define(optionMenu, w=200)
    template.define(floatSliderGrp,
                    w=300,
                    h=25,
                    f=True,
                    min=0.0,
                    max=1.0,
                    s=0.1,
                    v=0.1,
                    cl3=('left', 'left', 'left'),
                    cw3=(80, 80, 140))

    try:
        cmds.deleteUI(forestWindow)
    except RuntimeError:
        pass

    with window(forestWindow,
                title='Create forest archive',
                menuBar=True,
                menuBarVisible=True) as win:
        with template:
            with columnLayout():

                # with frameLayout('Camera setup'):
                # 	with rowColumnLayout():
                # 		button(l='Import shot camera', \
                # 			c='import renderTools; \
                # 			reload(renderTools); \
                # 			renderTools.importShotCamera()')
                # 		button(l='Set Frame Range From Camera', \
                # 			c='import previzTools;  \
                # 			reload(previzTools); \
                # 			previzTools.setShot()')

                # with frameLayout('Create point cloud'):
                # 	with rowColumnLayout():
                # 		focalLength = floatSliderGrp(l='Focal Length',min=5,max=300,s=1,v=50)
                # 		mtop = floatSliderGrp(l='Margin top')
                # 		mright = floatSliderGrp(l='Margin right')
                # 		mbot = floatSliderGrp(l='Margin bottom')
                # 		mleft = floatSliderGrp(l='Margin left')
                # 		depth = floatSliderGrp(l='Depth (m)',min=100,max=2000,s=10,v=200)
                # 		b = cmds.button('Compute point cloud')
                # 		button(b, e=True, c=call_fireHoudini)

                with frameLayout('Convert bgeo to maya point cloud'):
                    with rowColumnLayout():
                        # button(l='Load Houdini Engine for Maya', \
                        # 	c='import forestTools; \
                        # 	reload(forestTools); \
                        # 	forestTools.loadHoudiniEngine()')
                        bgeos = glob.glob(forestDir +
                                          r'geo/pointCloud_sector?.bgeo.sc')
                        for bgeo in bgeos:
                            sector = bgeo.split('_sector')[1]
                            sector = sector.split('.')[0]
                            # print sector
                            button(l='Convert bgeo sector %s'%sector, \
                             h=25, \
                             c='import forestTools; \
								reload(forestTools); \
								forestTools.loadShotPoints("%s")'                                                              %sector)
                with frameLayout('Instancing'):
                    with rowColumnLayout():
                        button(l='Import assets to instance', \
                         c='import forestTools; \
							reload(forestTools); \
							forestTools.createInstancer()'                                                       )