Renderer

Arnold Render Settings

setGlobalsArnold()

Sets the current renderer in the render globals to renderman and builds the core options

loadRendererArnold(setZooDefaults=True)

Loads the Arnold renderer and sets the render settings to Arnold too

setArnoldSamples(cameraAA=3, diffuse=2, specular=2, transmission=2, sss=2, volumeIndirect=2, progressive=0, adaptiveSampling=0, maxCamAA=20, adaptiveThreshold=0.015)

Sets Arnold’s Sample and Adaptive Sample settings in the Render Settings window.

Globals must be set with setGlobalsArnold()

Parameters:
  • cameraAA (int) – Camera AA samples

  • diffuse (int) – Diffuse samples

  • specular (int) – Specular samples

  • transmission (int) – Transmission samples

  • sss (int) – Sub Surface Scattering samples

  • volumeIndirect (int) – Volume Indirect samples

  • progressive (int) – The Progressive Render check box either 0 or 1

  • adaptiveSampling (int) – The Adaptive Sampling check box, either 0 or 1

  • maxCamAA (int) – The Max. Camera (AA) setting if Adaptive Sampling is on

  • adaptiveThreshold (float) – Adaptive Threshold setting if Adaptive Sampling is on

openArnoldRenderview(final=False, ipr=False)

Open the Arnold render view and optionally start rendering

Parameters:
  • final (bool) – True will immediately start final rendering an image

  • ipr (bool) – True will immediately start IPR rendering an image

Export Alembic Shader Lights

Todo

Exporting lights should use long names?

from zoo.libs.maya.cmds.renderer import exportabcshaderlights exportabcshaderlights.scaleToSceneConversion(1.0, fromUnit=”cm”)

tagTransformsZooABCAttr(nodeType, attrName)

Tags transform nodes of shape nodes of the given type Will tag by creating a float attribute named attrName message nodes cannot be exported by alembic

Parameters:
  • nodeType (str) – the maya node type eg “mesh”, or “nurbsCurve”

  • attrName (str) – the name of the attribute to be created

tagZooABCAttributes(meshes=False, lights=True, cameras=False, locators=False, curves=False)

Tags all nodes (transforms) in the scene with a message attribute with the prefix “zooABC” eg. zooABC_light The attribute tags can be exported with alembic These tags enable us to control what’s in the scene on ABC import by deleting or managing unwanted types This is really only handy for lights which often need to be deleted but can’t be found via querying the object type as they are usually empty transform nodes

Parameters:
  • meshes (bool) – tag mesh transform node types with an attribute identifier

  • lights (bool) – tag lights transform node types with an attribute identifier

  • cameras (bool) – tag camera transform node types with an attribute identifier

  • locators (bool) – tag locators transform node types with an attribute identifier

  • curves (bool) – tag curves transform node types with an attribute identifier

deleteZooABCAttrObjs(rendererNiceName='', meshes=False, lights=True, cameras=False, locators=False, curves=False, message=False, lightGrps=True, checkNodes='', skipLightGrps=False)

Deletes objects with attribute tags by type, usually used for lights from ABC as they aren’t imported as light types and so can’t be tracked or deleted.

Parameters:
  • rendererNiceName (bool) – the renderer name “Arnold” “Redshift” etc, needs to be specified for deleting light groups

  • meshes (bool) – delete objects with mesh tags

  • lights (bool) – delete objects with light tags

  • cameras (bool) – delete objects with camera tags

  • locators (bool) – delete objects with locator tags

  • curves (bool) – delete objects with curves tags

  • message (bool) – report the message to message user

  • checkNodes (list) – only check these nodes, otherwise the whole scene

  • skipLightGrps (bool) – skips the deletion of the light grp of the current renderer

Return deletedNodes:

all the deleted nodes

Rtype deletedNodes:

list

getShaderLightDict(rendererNiceName, getShader=True, getLight=True, exportSelected=False, includeSelChildren=False)

get the information from the scene to build the shader/light dictionaries given the options passed in

Parameters:
  • rendererNiceName (str) – name of the renderer nicename “Arnold”

  • getShader (bool) – get shader information

  • getLight (bool) – get the lighting information

  • exportSelected (bool) – export only the selected objects (and their children/grandchildren)

Return zooSceneDict:

the lightShader dictionary with version number

Rtype zooSceneDict:

dict

removeNamespaceZooScene(zooSceneDict, shaderMultiDict, lightMultiDict)

Depreciated function, might not be needed anymore since Alembic supports namespaces removes all namespaces from the zooSceneDict, might be handy for strip namespaces to match that flag for alembic

Could be done better as a flag while collecting the dict info, maybe will do later Ugly dict and string handling :/

Deletes namespaces in the

zooSceneDict[MESHOBJECTS] = the keys (long names) zooSceneDict[LIGHTS][AREALIGHTS] = the area light keys (short names) zooSceneDict[LIGHTS][IBLSKYDOMES] = the ibl keys (short names) zooSceneDict[SHADERDICT][OBJECTFACES] = then go through each list (short names)

Parameters:

zooSceneDict (dict) – the lighting/shader/subd dict the .zooscene

Return zooSceneDict:

the lighting/shader/subd dict the .zooscene, now with namespaces removed

Rtype zooSceneDict:

dict

createShaderLightDict(rendererNiceName, shadMultDict, lightMultDict, setShaders=True, setLights=True, addSuffix=True, replaceShaders=True, replaceLights=True, includeLights=True)

Given the renderer and zooSceneDict, build the lights and shaders in the scene,

Parameters:
  • rendererNiceName (str) – name of the renderer nicename “Arnold”

  • zooSceneDict (dict) – the lightShader dictionary with light and shader info

  • setShaders (bool) – apply/import the shaders?

  • setLights (bool) – import the lights?

  • addSuffix (bool) – add suffixes to the shaders and lights?

  • replaceShaders (bool) – replace the existing shaders? if off will add shaders but with new names 001 002 etc

  • includeLights (bool) – if False then skip the importing of lights, override

Return allNodes:

all shader and light nodes created

Rtype allNodes:

list

getTexturedAttributes(shaderList, renderer)

Builds the nested dictionary from shader connections so it can be rebuilt later with transferRenderer():

{“shaderName”: {“gDiffuseColor_srgb”: “fileTexture01.outColor”,

“gSpecRoughness”: “fileTexture02.outAlpha”}}

If no textures the dicts will be empty.

{“shaderName”: {}}

See reconnectTextures() for rebuilding the connections after Renderer convert

Parameters:
  • shaderList (list(str)) – A list of shader names to find source connections

  • renderer (str) – The renderer of the shader names

Return texturedShaderDict:

A nested dictionary, shader keys and then generic key (attrs), values are node.attr

Rtype texturedShaderDict:

dict(dict(str))

reconnectTextures(texturedShaderDict, fromRenderer, toRenderer, addSuffix)

Reconnects textures while converting transferRenderer(). Uses a nested dict texturedShaderDict:

{“oldShaderName”: {“gDiffuseColor_srgb”: “fileTexture01.outColor”,

“gSpecRoughness”: “fileTexture02.outAlpha”}}

Parameters:
  • texturedShaderDict (dict(dict(str))) – A nested dictionary, shader keys and then generic key (attrs), values are node.attr

  • fromRenderer (str) – The renderer converting from

  • toRenderer (str) – The renderer converting to

  • addSuffix (bool) – Adding suffix’s to the new renderer? Recommended to be true

transferRenderer(fromRenderer, toRenderer, transferShader=True, transferLights=True, transferSelected=False, addSuffix=True, replaceShaders=True, deleteOld=False)

Transfers a scene (transferSelected=False) or selection to a new renderer using the generic shader dicts Many options Currently will always delete lights while rebuilding

Texture Note:

Textures that are connected to supported generic attributes ie. shadermultirenderer.GEN_KEY_LIST will be reconnected. However they will not be converted, so it’ll only work with native Maya nodes such as ramps and native file textures and or math nodes etc that are supported by the both renderers.

TODO: Add support attributes such as metalness, normals, bump, displacement etc.

Parameters:
  • fromRenderer (str) – The renderer converting from “Arnold”

  • toRenderer (str) – The renderer converting to “Redshift”

  • transferShader (bool) – transfer the shaders?

  • transferLights (bool) – transfer the lights?

  • transferSelected (bool) – transfer only selected objects? If false will export scene, shaders are assigned to objs

  • addSuffix (bool) – add a suffix to the shader names while creating

  • replaceShaders (bool) – replace shaders with the same names

  • deleteOld (bool) – delete the old lights and shaders (if they are being transferred) Shaders use suffix’s

Return wasConverted:

if converted True if not False

Rtype wasConverted:

bool

exportAbcWithDictInfo(filePathAlembic, zooSceneDict=None, exportSelected=False, noMayaDefaultCams=True, exportGeo=False, exportCams=False, exportAll=True, dataFormat='ogawa', frameRange='', visibility=True, creases=True, uvSets=True, exportSubD=True)
Exports the .abc data with a generic zooSceneDict .zooScene file

has a number of filter options, including exporting hierarchies containing geo or cams. Can exclude Maya default cams, persp front bottom back Can export SubD attribute info to the .zooScene file Other regular .abc export flags too.

Parameters:
  • filePathAlembic (str) – the full filepath to the .abc file to save

  • zooSceneDict (dict) – the exported dict usually for .zooScene writing, if None it will be created

  • exportSelected (bool) – export selected, will override other filters like noMayaDefaultCams

  • noMayaDefaultCams (bool) – omit the Maya default cams, ‘front’ ‘left’ ‘bottom’ ‘back’ ‘persp’ etc

  • exportGeo (bool) – export the geometry? Note, child nodes of all objects root parent will still be included

  • exportCams (bool) – export the cameras? Note, child nodes of all cameras root parent will still be included

  • exportAll (bool) – will export everything, maya default cams are still potentially filtered

  • visibility (bool) – will export visibility state of every object

  • creases (bool) – will export creases on objects, currently broken

  • uvSets (bool) – will export poly objects with uv sets

  • dataFormat (str) – abc format type, “ogawa” is small and fast, “hdf” supports backwards compatibility

  • frameRange (str) – frame to and from as a string eg “0 10”. If left empty will default to current frame.

  • exportSubD (bool) – export the subD settings into the .zooScene file

Return zooSceneDict:

the exported dict usually for .zooScene writing extra data uch as subD and objExist info

Rtype zooSceneDict:

dict

exportAbcGenericShaderLights(zooSceneFullPath, rendererNiceName='Arnold', exportSelected=False, exportShaders=True, exportLights=True, exportAbc=True, noMayaDefaultCams=True, exportGeo=False, exportCams=False, exportAll=True, dataFormat='ogawa', frameRange='', visibility=True, creases=True, uvSets=True, exportSubD=True, exportNamespaces=True, tagInfoDict={}, includeSelChildren=False, keepThumbnailOverride=False)

Saves files

  1. .zooScene file with misc info

  2. The shader file with generic shader info

  3. The lights file with generic light info

  4. An alembic file with the same name in the same location

  5. The zooInfo file with information meta data about the file

While saving lights or shaders only it’s worth saving this same filetype, and the remaining category will be an empty dict.

The related importer will only import the dictionaries it finds with legit data. Please note that the ‘exportGeo’ and ‘exportCams’ will save the root node of each of those object types, the alembic will export all viable nodes parented into that hierarchy.

Parameters:
  • zooSceneFullPath (str) – the full filepath to the json file to save

  • rendererNiceName (str) – which rendererNice name should the lights be saved from? Saving shaders only = not needed

  • exportSelected (bool) – export selected, will override other filters like noMayaDefaultCams

  • exportShaders (bool) – export all meshes (poly only) in the scene and all related shaders

  • exportLights (bool) – will export supported light types, the lights in generic (not alembic) format as .zooScene

  • exportAbc (bool) – will export an alembic files with the same name as the .zooScene

  • noMayaDefaultCams (bool) – omit the Maya default cams, ‘front’ ‘left’ ‘bottom’ ‘back’ ‘persp’ etc

  • exportGeo (bool) – export the geometry? Note, child nodes of all objects root parent will still be included

  • exportCams (bool) – export the cameras? Note, child nodes of all cameras root parent will still be included

  • exportAll (bool) – will export everything, maya default cams are still potentially filtered

  • visibility (bool) – will export visibility state of every object

  • creases (bool) – will export creases on objects, currently broken

  • uvSets (bool) – will export poly objects with uv sets

  • dataFormat (str) – abc format type, “ogawa” is small and fast, “hdf” supports backwards compatibility

  • frameRange (str) – frame to and from as a string eg “0 10”. If left empty will default to current frame.

  • exportSubD (bool) – export the subD settings into the .zooScene file

  • exportNamespaces (bool) – exports namespaces to the .zooscene folder, bug in .abc means it must created before import

  • exportNamespaces – exports namespaces to the .zooscene folder, bug in .abc means it must created before import

  • keepThumbnailOverride (bool) – keeps the existing thumbnail image if over righting, usually for delete when renaming

Return tagInfoDict:

tag info dictionary that is saved as a .zooInfo, if empty and will be created as empty

Rtype tagInfoDict:

dict

Return includeSelChildren:

include whole hierarchy of selected, will override to auto on if alembic and exportsel

Rtype includeSelChildren:

dict

Return zooSceneFullPath:

file path of the alembic file saved

Rtype filePathAlembic:

str

selectedZooSceneObjDictFix(zooSceneDict, gShaderDict, objectRootList)

This function adjusts for exporting selected nodes on the long file names fixing the paths alembic exports from the root and leaves out other dag objects higher in the hierarchy so on importing those parent objects are missing. this function checks and fixes the long name pathing

Parameters:
  • zooSceneDict (dict) – the main dict in a .zooscene file

  • exportSubD (bool) – are subds being exported?

Return objectLongList:

the object long list now fixed with the parent of the alembic roots cut out of the prefix

Rtype objectLongList:

list

Return zooSceneDict:

the now updated zooSceneDict

Rtype zooSceneDict:

dict

importAbcDict(filePathAlembic, zooSceneDict, shadMultDict, lightMultDict, rendererNiceName, replaceRoots=False, importSubDInfo=True, returnNodes=True, createNamespaces=True, deleteAbcLightNulls=True, importLights=True, replaceLights=True)

Imports an alembic file and uses zooSceneDict to potentially replace existing roots

Parameters:
  • filePathAlembic (str) – the full filepath to the .abc file to save

  • zooSceneDict (dict) – the nested exported dict which contains subD information

  • replaceRoots (bool) – Will delete an existing hierarchy root to make way for the imported hierarchy

  • createNamespaces (bool) – needs to create empty namespaces in the scene for namespaces to be imported correctly

  • deleteAbcLightNulls (bool) – deletes nulls that were once lights, and so avoids clashes with maya/generic lights

  • importLights (bool) – this is for the generic light importer, if off don’t delete the existing scene lights

  • replaceLights (bool) – if True then we need to delete the renderer lights grp here for returning all abc nodes

Return filePathAlembic:

the full filepath to the .abc file to save

Rtype filePathAlembic:

str

importAbcGenericShaderLights(zooSceneFullPath, rendererNiceName='Arnold', importShaders=True, importLights=True, importAbc=True, replaceShaders=True, addShaderSuffix=True, importSubDInfo=True, replaceRoots=False, returnNodes=True, replaceLights=True)

Imports the generic .zooScene file (shaders, shader assignment and lighting) with alembic data supported and various flags for importing.

Parameters:
  • zooSceneFullPath (str) – the full path of the .zooScene file to be saved

  • rendererNiceName (str) – The renderer nice name used to import generic shaders eg. “Redshift” “Arnold”

  • importShaders (bool) – will import shaders in generic format

  • importLights (bool) – will import lights in generic format

  • importAbc (bool) – imports the accompanying .abc alembic file

  • replaceShaders (bool) – will delete existing shaders before importing those of the same name

  • addShaderSuffix (bool) – Adds renderer suffixes to shader imports eg _RS, _ARN, _PXR

  • importSubDInfo (bool) – Imports the subD info, includes maya subd info data like renderer level etc.

  • replaceRoots (bool) – Will delete an existing hierarchy root to make way for the imported hierarchy

  • newNodes (bool) – returns the new nodes created if returnNodes=True, otherwise returns None

  • replaceLights (bool) – if lights are imported will delete lights with the incoming/clashing names

Return newNodes:

returns the new nodes created if returnNodes=True, otherwise returns None

Rtype newNodes:

list

saveLightsZooScene(zooSceneFullPath, renderer, exportAll=True)

Simple function that exports lights with hardcoded export options

Parameters:
  • zooSceneFullPath (str) – fullpath to the .zooscene

  • renderer (str) – the renderNiceName “Arnold”

  • exportAll (bool) – export all (True) or selected (False)

Return zooSceneFullPath:

the path to the zooScene saved

Rtype zooSceneFullPath:

str

importLightPreset(zooSceneFullPath, rendererNiceName, overideDeleteLights)

Imports the lights only from a .zooScene and the dependency file .zooGShad

Parameters:
  • zooSceneFullPath (str) – the full path to the .zooScene file

  • rendererNiceName (str) – nice name of the renderer “Arnold”

  • overideDeleteLights (bool) – delete current lights while importing, deletes the current renderer lights

Return allLightShapes:

all light shapes and I think transforms created

RtypeallLightShapes:

list

updateIBLPaths(zooSceneDir, oldIblPath='D:/3dtrainingResources/HDRImages/_neatHDRIcollection', newIblPath='')

temp functexportglobalsion to fix bad ibl paths for .zooScene directories. Useful for upgrading or batch fixing

Note: is likely depreciated, nothing is using this function

Parameters:
  • zooSceneDir (str) – the directory to rename made up of .zooScene files and their dependencies

  • oldIblPath (str) – the old ibl path to replace

  • newIblPath (str) – the new iblPath, if “” then will use the default location of the IBL dir from lighting.presets

Return lightFilesRenamedList:

a list of fileNames full path that have been renamed

Rtype lightFilesRenamedList:

list

setShaderAttrsZscnInstance(shaderInstance, zooScenePath, convertToRendering=True)

Sets a shader instance to the values of the first shader in a zooscene dict file.

Parameters:
setShaderAttrsZooScene(zooScenePath, shaderName, shaderType, renameToZooName=False, message=True)

Sets a shader’s attributes from a .zooScene file

Will find the first shader in the file, and then it’s attributes

Can rename the shader to the .zooScene name, useful for creating from a preset or thumb browser

Parameters:
  • shaderName (str) – The maya name of the shader, could be any user defined name

  • shaderType (str) – the type of shader, RedshiftMaterial pxrSurface alStandardSurface etc

  • renameToZooName (str) – Rename the existing shader to the shader name in the .zooScene

  • message (bool) – report the success message to the user?

Return shaderName:

The name of the shader set

Rtype shaderName:

str

saveShaderPresetZooScene(zooSceneFullPath, shaderInScene, shaderName)

Saves a Shader Preset as a .zooScene file with the generic shader JSON file (.zooGShad). No other data is saved.

Parameters:
  • zooSceneFullPath (str) – The full path including the filename

  • shaderInScene (str) – The shader name that will be read from the scene, it’s data will be saved

  • shaderName (str) – The name of the shader that will be saved in the shader JSON file, can differ from shaderInScene

Return zooSceneFullPath:

The full path of the .zooScene file saved

Rtype zooSceneFullPath:

str

Return gShaderFullPath:

The full path of the shader JSON file saved (.zooGShad)

Rtype gShaderFullPath:

str

saveShaderInstanceZooScene(zooSceneFullPath, shaderName, shaderInstance)

Saves a Shader Preset as a .zooScene file with the generic shader JSON file (.zooGShad). No other data is saved.

Uses Zoo shaderInstance as the input, it must already exist in the scene.

Parameters:
  • zooSceneFullPath (str) – The full file path including the filename

  • shaderName (str) – The name of the shader as saved. Can be different from the shaderInstance.shaderName()

  • shaderInstance (zoo.libs.maya.cmds.shaders.shadertypes.shaderbase.ShaderBase) – The shader name that will be read from the scene, it’s data will be saved

Return zooSceneFullPath:

The full path of the .zooScene file saved

Rtype zooSceneFullPath:

str

Return gShaderFullPath:

The full path of the shader JSON file saved (.zooGShad)

Rtype gShaderFullPath:

str

Multi Renderer Settings

currentRenderer()

Returns the current renderer that is set in Zoo Tools.

returns

“Arnold” or Redshift” or “Renderman”

Return renderer:

Returns the nice name of the currently active renderer in Zoo Tools

Rtype renderer:

str

changeRenderer(renderer, setDefault=True, load=True, message=True)

Change renderer for the whole of Zoo Tools Pro:

“Arnold” or Redshift” or “Renderman”

Parameters:
  • renderer (str) – The renderer nice name

  • load (bool) – If True also try to load the renderer if it is not already loaded

  • setDefault (bool) – If True set the renderer to the Zoo Tools default settings

  • message (bool) – Report he message to the user?

Return generalSettingsPrefsData:

The prefs data as a dict, now updated

Rtype generalSettingsPrefsData:

dict

setDefaultRenderSettings(renderer, message=True)

Sets the default Zoo render settings for each renderer

Parameters:
  • renderer (str) – The renderer nice name

  • message (bool) – Report messages to the user

setRenderGlobals(renderer)
Parameters:

renderer (str) – The renderer nice name

Returns:

Return type:

loadRenderer(renderer, bypassWindow=False)

Loads the given renderer with a confirmation popup window.

Parameters:
  • renderer (str) – The renderer nice name

  • bypassWindow (bool) – If True don’t show the popup window, just return if the renderer is loaded or not

Return success:

True if the renderer was loaded

Rtype success:

bool

setDefaultRenderSettingsAuto()

Sets the default render settings on the currently selected renderer

openRenderview(renderer, final=False, ipr=False)

Opens a render view window and optionally starts rendering a final fame or IPR for the given renderer.

Parameters:
  • renderer (str) – The renderer nice name

  • final (bool) – True will immediately start final rendering an image

  • ipr (bool) – True will immediately start IPR rendering an image

openRenderviewAuto(final=False, ipr=False)

Opens a render view window and optionally starts rendering a final fame or IPR for the current renderer.

Parameters:
  • final (bool) – True will immediately start final rendering an image

  • ipr (bool) – True will immediately start IPR rendering an image

Redshift Render Settings

setGlobalsRedshift()

Sets the current renderer in the render globals to Redshift and builds the core options

loadRendererRedshift(setZooDefaults=True)

Loads the Redshift renderer and sets the render settings to Redshift too

setBounces(bounces=3, primaryEngine=4, secondaryEngine=4, message=True)

Sets the GI bounces in Redshift

Primary Engine:

0: None 1: Photon Map 3: Irradiance Cache 4: Brute Force

Secondary Engine:

0: None 1: Photon Map 2: Irradiance Point Cloud 4: Brute Force

Parameters:
  • bounces (int) – The number of bounces

  • primaryEngine (int) – The primary engine to use, see documentation above, represents the combo box

  • secondaryEngine (int) – The secondary engine to use, see documentation above, represents the combo box

  • message (float) – Report a message to the user?

Return success:

True if successfully completed, can fail easily if Renderman Globals are not in the scene

Rtype success:

bool

setIPRMaxPasses(passes=256, forceProgressive=1, message=True)

Sets the IPR passes in Redshift

Parameters:
  • passes (int) – The amount of passes to use

  • forceProgressive (int) – The toggle for force progressive checkbox 1 or 0

  • message (float) – Report a message to the user?

Return success:

True if successfully completed, can fail easily if Renderman Globals are not in the scene

Rtype success:

bool

setMinMaxSamples(maxSamples=256, minSamples=64, adaptiveThreshold=0.01, message=True)

Sets the minimum and maximum samples for Redshift

Parameters:
  • minSamples (int) – The minimum samples number under unified sampling

  • maxSamples (int) – The maximum samples number under unified sampling

  • adaptiveThreshold (float) – The Adaptive Error Threshold samples number under unified sampling

  • message (float) – Report a message to the user?

Return success:

True if successfully completed, can fail easily if Renderman Globals are not in the scene

Rtype success:

bool

openRedshiftRenderview(final=False, ipr=False)

Open the redshift render view and optionally start rendering

Parameters:
  • final (bool) – True will immediately start final rendering an image

  • ipr (bool) – True will immediately start IPR rendering an image

Rendererconstants

Rendererload

from zoo.libs.maya.cmds.renderer import rendererload

currentZooRenderer()

Returns primary renderer that Zoo Tools has set in its preferences. Note the renderer may not be loaded in Maya.

“Arnold”, “Redshift”, “Renderman”, “VRay”, “Maya”

Returns:

The currently set renderer as a string

Return type:

str

getRendererIsLoaded(rendererNiceName)

checks if the renderer by nice name is loaded “Arnold”, “Renderman”, “Redshift”

Parameters:

rendererNiceName (str) – the nice name of the renderer “Redshift”, “Arnold”

Return loaded:

is the renderer loaded?

Rtype loaded:

bool

loadRenderer(renderer, setZooDefaults=True)

Load renderer by it’s nice name, “Arnold”, “Renderman”, “Redshift”

“Maya” will be ignored as plugin is not needed.

Parameters:

renderer (str) – renderer nice name “Arnold”, “Renderman”, “Redshift”

Return loaded:

did the renderer get loaded?

Rtype loaded:

bool

getLoadedRenderers()

Returns a nice name renderer list of the renderers currently loaded

Parameters:

rendererNiceNameList (str) – the nice name of the renderer “Redshift”, “Arnold”

unloadRenderer(rendererNiceName, message=True)

Unload renderer by it’s nice name, “Arnold”, “Renderman”, “Redshift”

Parameters:

rendererNiceName (str) – renderer nice name “Arnold”, “Renderman”, “Redshift”

unloadRendererSafe(rendererNiceName)

Safe unloads a renderer by checking if it’s ok to unload, renderer is by nicename “Arnold”, “Renderman”, “Redshift”

Parameters:

rendererNiceName (str) – renderer nice name “Arnold”, “Renderman”, “Redshift”

Return unloaded:

did the renderer get unloaded?

Rtype unloaded:

bool

printLoadedRenderPlugins()

Prints the renderer if it’s loaded, will use the renderer nice name.

safeUnloadAllRenderers()

Turns off all the render plugins, best if this happens in an empty scene, can crash Maya

Renderer Stats

———- Render Stats ————- Enables the user to easily toggle the following modes for render visibility

Example:

from zoo.libs.maya.cmds.renderer import renderstats renderstats.renderStatsSel(vis=False, attr=RS_PRIMARY_VIS)

TODO: Add renderer specific attributes

Author: Andrew Silke

renderStats(shapeList, vis=False, attr='primaryVisibility', message=True)

Sets an attribute to be true or false, used for setting Render Stats though could be used for anything

see globals for attrs to set

Parameters:
  • shapeList (list(str)) – A list of nurbsSurface or mesh shapes

  • vis (bool) – State to set, True/False

  • attr (str) – The attribute to set

  • message (bool) – Report a message to the user?

renderStatsSel(vis=False, attr='primaryVisibility', message=True)

Sets an render stat attribute to be true or false, see globals for attrs to set.

Parameters:
  • vis (bool) – State to set, True/False

  • attr (str) – The attribute to set

  • message (bool) – Report a message to the user?

Renderman Render Settings

setGlobalsRenderman()

Sets the current renderer in the render globals to renderman

loadRendererRenderman(setZooDefaults=True)

Loads the Renderman renderer and sets the render settings to Renderman too

setMinMaxSamples(maxSamples=256, minSamples=0, pixelVariance=0.015, iprMax=256, iprPixelVariance=0.015, message=-1)

Sets the Renderman max and min samples for regular and IPR rendering

Parameters:
  • maxSamples (int) – The maximum samples for full quality Renderman renders

  • minSamples (int) – The minimum samples for full quality Renderman renders

  • pixelVariance (float) – The pixel variance for full quality Renderman renders

  • iprMax (int) – The maximum samples for IPR (interactive) Renderman renders

  • iprPixelVariance (float) – The pixel variance for IPR Renderman renders

  • message (float) – Report a message to the user?

Return success:

True if successfully completed, can fail easily if Renderman Globals are not in the scene

Rtype success:

bool

openRendermanRenderview(final=False, ipr=False)

Open the Renderman render view and optionally start rendering

Parameters:
  • final (bool) – True will immediately start final rendering an image

  • ipr (bool) – True will immediately start IPR rendering an image