Arnoldhdri

This module is the base class for Arnold HDRI Skydomes

HDRI Skydomes have these properties.

  • name: The name of the light (str)

  • shapeName: The name of the light (str)

  • nodetype: The node type of the HDRI Skydome (str)

  • lightSuffix: The optional suffix of the light

  • intensity: The intensity of the light

  • rotate: The rotation values in 3d space

  • translate: The translation values in 3d space

  • scale: The scale values in 3d space

  • imagePath: The path to the skydome image on disk

  • invert: Is the HDRI image inverted for text etc?

  • backgroundVis: Is the skydome visible in the scene?

  • tintColor: The tint offset of the skydome (not yet supported)

Example use (base class will not build lights):

from zoo.libs.maya.cmds.lighting.hdritypes import arnoldhdri
hdriInst = arnoldhdri.ArnoldHdri("hdriSkydomeName", create=True, suffix=False)  # creates a new HDRI Skydome light

hdriInst.setName("myHdriSkydomeLight")  # sets name of the light
hdriInst.setIntensity(1.5)
hdriInst.setBackgroundVis(False)  # sets the background to be invisible in renders
hdriInst.setRotate([0.0, 95.3, 0.0])  # rotates the HDRI light 90 degrees

hdriInst = arnoldhdri.ArnoldHdri(name="existingSkydome", create=False, ingest=True)  # ingest an existing skydome

Default HDRI dictionary example from zoo.libs.maya.cmds.lighting.lightconstants:

HDRI_DEFAULT_VALUES = {HDRI_NAME: “hdriSkydome”,

HDRI_INTENSITY: 1.0, HDRI_ROTATE: [0.0, 0.0, 0.0], HDRI_TRANSLATE: [0.0, 0.0, 0.0], HDRI_SCALE: [1.0, 1.0, 1.0], HDRI_TEXTURE: “”, HDRI_INVERT: False, HDRI_LIGHTVISIBILITY: True, HDRI_TINT: [1.0, 1.0, 1.0]}

Author: Andrew Silke

class ArnoldHdri(name='', genAttrDict=None, node=None, create=False, ingest=False, suffixName=False, message=True)

Bases: HdriBase

Main class that manages a HDRI Skydome Light

nodetype = 'aiSkyDomeLight'
lightSuffix = 'ARN'
intensityAttr = 'intensity'
rotateAttr = 'rotate'
translateAttr = 'translate'
scaleAttr = 'scale'
imagePathAttr = 'fileTextureName'
invertAttr = ''
backgroundVisAttr = 'camera'
tintColorAttr = ''
scaleMultiply = 1.0
initTextureInstance(autoCreate=True, ingest=False)

Creates and starts the self.txtrInst instance that manages the texture connections.

Arnold skydomes use Maya’s file texture nodes for HDRI images. Could add Arnold file textures later.

Parameters:
  • autoCreate (bool) – If True will auto build the node network if nothing found otherwise ingest

  • ingest (bool) – If True will only try and ingest an existing node network

delete()

Deletes the transform node and any connected textures

renderer()

Returns the current renderer as a string

setIntensity(intensity)

Sets the intensity (brightness) of the HDRI Skydome light.

Parameters:

intensity (float) – The intensity of the light in Zoo generic units

intensity()

Gets the intensity (brightness) of the HDRI Skydome light.

Return intensity:

The intensity of the light in generic Zoo units

Rtype intensity:

float

setImagePath(imagePath)

Sets the image path while handling the texture connections

Parameters:

imagePath (str) – The fullpath to the image file

imagePath()

Returns the full path of the image texture on disk, can be “” if not used.

Return imagePath:

The full path of the image texture on disk, can be “” if not used.

Rtype imagePath:

str

setBackgroundVis(backgroundVis)
backgroundVis()
setTint(tint)
tint()

Hdribase

This module is the base class for hdri skydomes

This class needs to be extended/overridden by each renderer type. Provides base functionality.

A HDRI Skydome has these properties:

  • name: The name of the light (str)

  • shapeName: The name of the light (str)

  • nodetype: The node type of the HDRI Skydome (str)

  • lightSuffix: The optional suffix of the light

  • intensity: The intensity of the light

  • rotate: The rotation values in 3d space

  • translate: The translation values in 3d space

  • scale: The scale values in 3d space

  • imagePath: The path to the skydome image on disk

  • invert: Is the HDRI image inverted for text etc?

  • backgroundVis: Is the skydome visible in the scene?

  • tintColor: The tint offset of the skydome

Example use (base class will not build lights):

from zoo.libs.maya.cmds.lighting.hdritypes import hdribase
hdriInst = hdribase.HdriBase("hdriSkydomeName", create=True, suffix=False)  # creates a new HDRI Skydome light

hdriInst.setName("myHdriSkydomeLight")  # sets name of the light
hdriInst.setIntensity(1.5)
hdriInst.setBackgroundVis(False)  # sets the background to be invisible in renders
hdriInst.setRotate([0.0, 95.3, 0.0])  # rotates the HDRI light 90 degrees

hdriInst = hdribase.HdriBase(name="existingSkydome", create=False, ingest=True)  # ingest an existing skydome

Default HDRI dictionary example from zoo.libs.maya.cmds.lighting.lightconstants:

HDRI_DEFAULT_VALUES = {HDRI_NAME: “hdriSkydome”,

HDRI_INTENSITY: 1.0, HDRI_ROTATE: [0.0, 0.0, 0.0], HDRI_TRANSLATE: [0.0, 0.0, 0.0], HDRI_SCALE: [1.0, 1.0, 1.0], HDRI_TEXTURE: “”, HDRI_INVERT: False, HDRI_LIGHTVISIBILITY: True, HDRI_TINT: [1.0, 1.0, 1.0]}

Author: Andrew Silke

class HdriBase(name='', genAttrDict=None, node=None, create=False, ingest=False, suffixName=False, message=True)

Bases: LightsBase

Main class that manages a HDRI Skydome Light

nodetype = ''
lightSuffix = ''
intensityAttr = ''
rotateAttr = 'rotate'
translateAttr = 'translate'
scaleAttr = 'scale'
imagePathAttr = ''
invertAttr = ''
backgroundVisAttr = ''
tintColorAttr = ''
intensityMultiplyAttr = 'zooIntensityMultiply'
rotateOffsetAttr = 'zooRotateOffset'
rotOffset = 0.0
intensityOffset = 0.0
scaleMultiply = 1.0
createSkydomeLight()

Creates the skydome light with no settings. Designed to be changed after creation.

Return lightTransformName:

The light’s transform name

Rtype lightTransformName:

str

Return shapeNodeName:

The light’s shape node name

Rtype shapeNodeName:

str

create(message=True)

Creates the HDRI Skydome light

Parameters:

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

shapeAttributeNames()

Generic attributes are the keys and the shader’s attributes are the values.

Returns:

A dictionary with strings as keys and attribute string names as values.

Return type:

dict

transformAttributeNames()

Generic attributes are the keys and the HDRI’s attributes are the values.

Returns:

A dictionary with strings as keys and attribute string names as values.

Return type:

dict

setDefaults(apply=True, setName=False)

Sets the defaults internally, the shader does not need to be created unless apply=True

Parameters:

apply (bool) – If True then apply the settings to the shader, otherwise is just changed in the class instance.

setFromDict(genAttrDict, setName=False, apply=True, noneIsDefault=True)

Sets the hdri light from a generic attribute dictionary. Values as attribute values.

Handles None-values in the dictionary and also missing keys.

None-values and missing keys can either pass or be replaced with default values.

Parameters:
  • genAttrDict (dict(str)) – The generic attribute dictionary with values as attribute values

  • apply (bool) – Will apply the dict to the current shader, must exist

  • noneIsDefault (bool) – Will apply defaults if the value of the key is None

applyCurrentSettings(applyName=False)

Applies the current settings to the normal map’s texture network

pullSettings(includeName=False)

Pulls the current attributes from the current shader, shader must exist

setIntensity(intensity)
intensity()
setRotate(rotate)

Sets the rotation of the HDRI Skydome light.

Note values are in generic units to account for offsets between renderers.

Parameters:

rotate (list(float)) – The rotation values in degrees [0.0, 90.0, 0.0]

setRotateLean(rotate, transform)

Fast hardcoded rotate code run for slider code so its as lean as possible. No safety checks.

Parameters:

rotate (list(float)) – The rotation values in degrees [0.0, 90.0, 0.0]

rotate()
setTranslate(translate)
translate()
setScale(scale, invert=False)
scale()
setImagePath(imagePath)
imagePath()
setInvert(invert)
invert()
setBackgroundVis(backgroundVis)
backgroundVis()
setTint(tint)
tint()
setIntensityMultiply(intensityMultiply)

Sets the zoo intensity multiply attribute, this is a custom attribute and will create it if it doesn’t exist.

IntensityMultiply is an optional custom attribute controlled by the Zoo HDRI Skydome UI

Parameters:

intensityMultiply (float) – The value of the intensityMultiply attribute

intensityMultiply()

Returns the value of the zoo intensity multiply custom attribute. Will return None if it doesn’t exist.

IntensityMultiply is an optional custom attribute controlled by the Zoo HDRI Skydome UI

Return intensityMultiply:

The value of the intensityMultiply attribute, will be None if doesn’t exist

Rtype intensityMultiply:

float

setIntensityAndMultiply(intensity, intensityMultiply)

Sets both the intensity and the intensity multiply values usually from a UI

IntensityMultiply is an optional custom attribute controlled by the Zoo HDRI Skydome UI

Parameters:
  • intensity (float) – The intensity value from a UI

  • intensityMultiply (float) – The intensity multiply value from a UI

intensityAndMultiply()

Returns both the intensity and intensity multiply value. Usually for a UI.

IntensityMultiply is an optional custom attribute controlled by the Zoo HDRI Skydome UI

Return intensity:

The intensity value of the light divided by intensityMultiply

Rtype intensity:

float

Return intensityMultiply:

The multiplication value of the intensity

Rtype intensityMultiply:

float

setRotateOffset(rotateOffset)

Sets the zoo rotate offset attribute, this is a custom attribute and will create it if it doesn’t exist.

RotateOffset is an optional custom attribute controlled by the Zoo HDRI Skydome UIs

Parameters:

rotateOffset (float) – The value of the rotateOffset attribute

rotateOffset()

Returns the value of the zoo rotate offset custom attribute. Will return None if it doesn’t exist.

RotateOffset is an optional custom attribute controlled by the Zoo HDRI Skydome UIs

Return rotateOffset:

The value of the rotateOffset attribute, will be None if it doesn’t exist

Rtype rotateOffset:

float

setRotateAndOffset(rotate, rotateOffset)

Sets both the rotate and rotate offset values, usually from a UI.

RotateOffset is an optional custom attribute controlled by the Zoo HDRI Skydome UIs

Parameters:
  • rotate (list(float)) – The rotation value usually from a UI

  • rotateOffset (float) – The rotate offset value

rotateAndOffset()

Returns both the rotate and rotate offset values, usually for a UI.

RotateOffset is an optional custom attribute controlled by the Zoo HDRI Skydome UIs

Return rotate:

The rotate value with the rotate offset value taken from the y rotation

Rtype rotate:

list(float)

Return rotateOffset:

The Y Rotate offset value

Rtype rotateOffset:

float

connectedAttrs()

Checks if any of the supported attributes have connections, if so returns:

connectionDict: generic attributes as the keys and “node.attr” as connection values.

Return connectionDict:

Dictionary with generic attributes as the keys and “node.attr” as connection values

Rtype connectionDict:

dict(str)

Redshifthdri

This module is the base class for Redshift HDRI Skydomes

HDRI Skydomes have these properties.

  • name: The name of the light (str)

  • shapeName: The name of the light (str)

  • nodetype: The node type of the HDRI Skydome (str)

  • lightSuffix: The optional suffix of the light

  • intensity: The intensity of the light

  • rotate: The rotation values in 3d space

  • translate: The translation values in 3d space

  • scale: The scale values in 3d space

  • imagePath: The path to the skydome image on disk

  • invert: Is the HDRI image inverted for text etc?

  • backgroundVis: Is the skydome visible in the scene?

  • tintColor: The tint offset of the skydome

Example use (base class will not build lights):

from zoo.libs.maya.cmds.lighting.hdritypes import redshifthdri
hdriInst = redshifthdri.RedshiftHdri("hdriSkydomeName", create=True, suffix=False)  # creates a new HDRI light

hdriInst.setName("myHdriSkydomeLight")  # sets name of the light
hdriInst.setIntensity(1.5)
hdriInst.setBackgroundVis(False)  # sets the background to be invisible in renders
hdriInst.setRotate([0.0, 95.3, 0.0])  # rotates the HDRI light 90 degrees

hdriInst = redshifthdri.RedshiftHdri(name="existingSkydome", create=False, ingest=True)  # ingest an existing skydome

Default HDRI dictionary example from zoo.libs.maya.cmds.lighting.lightconstants:

HDRI_DEFAULT_VALUES = {HDRI_NAME: “hdriSkydome”,

HDRI_INTENSITY: 1.0, HDRI_ROTATE: [0.0, 0.0, 0.0], HDRI_TRANSLATE: [0.0, 0.0, 0.0], HDRI_SCALE: [1.0, 1.0, 1.0], HDRI_TEXTURE: “”, HDRI_INVERT: False, HDRI_LIGHTVISIBILITY: True, HDRI_TINT: [1.0, 1.0, 1.0]}

Author: Andrew Silke

class RedshiftHdri(name='', genAttrDict=None, node=None, create=False, ingest=False, suffixName=False, message=True)

Bases: HdriBase

Main class that manages a HDRI Skydome Light

nodetype = 'RedshiftDomeLight'
lightSuffix = 'RS'
intensityAttr = 'color'
rotateAttr = 'rotate'
translateAttr = 'translate'
scaleAttr = 'scale'
imagePathAttr = 'tex0'
invertAttr = ''
backgroundVisAttr = 'background_enable'
tintColorAttr = 'color'
rotOffset = -90.0
scaleMultiply = 1.0
renderer()

Returns the current renderer as a string

setIntensity(intensity)

Sets the intensity (brightness) of the HDRI Skydome light.

Parameters:

intensity (float) – The intensity of the light in Zoo generic units

intensity()

Gets the intensity (brightness) of the HDRI Skydome light.

Return intensity:

The intensity of the light in generic Zoo units

Rtype intensity:

float

rotate()

Redshift is 90 degrees out from Arnold (generic) so compensate Full gimbal is not well supported so orientations can mismatch.

Return rotate:

The rotation value generic value for UIs

Rtype rotate:

list(float)

setRotate(rotate)

Redshift is 90 degrees out from Arnold (generic) so compensate Full gimbal is not well supported so orientations can mismatch.

Parameters:

rotate (list(float)) – The rotation value generic value for UIs

setImagePath(imagePath)
imagePath()
setBackgroundVis(backgroundVis)
backgroundVis()
setTint(tint)
tint()

Rendermanhdri

This module is the base class for Renderman HDRI Skydomes

Author: Andrew Silke

HDRI Skydomes have these properties.

  • name: The name of the light (str)

  • shapeName: The name of the light (str)

  • nodetype: The node type of the HDRI Skydome (str)

  • lightSuffix: The optional suffix of the light

  • intensity: The intensity of the light

  • rotate: The rotation values in 3d space

  • translate: The translation values in 3d space

  • scale: The scale values in 3d space

  • imagePath: The path to the skydome image on disk

  • invert: Is the HDRI image inverted for text etc?

  • backgroundVis: Is the skydome visible in the scene?

  • tintColor: The tint offset of the skydome

Example use (base class will not build lights):

from zoo.libs.maya.cmds.lighting.hdritypes import rendermanhdri
hdriInst = rendermanhdri.RendermanHdri("hdriSkydomeName", create=True, suffix=False)  # creates a new HDRI light

hdriInst.setName("myHdriSkydomeLight")  # sets name of the light
hdriInst.setIntensity(1.5)
hdriInst.setBackgroundVis(False)  # sets the background to be invisible in renders
hdriInst.setRotate([0.0, 95.3, 0.0])  # rotates the HDRI light 90 degrees

hdriInst = rendermanhdri.RendermanHdri(name="existingSkydome", create=False, ingest=True)  # ingest a skydome

Default HDRI dictionary example from zoo.libs.maya.cmds.lighting.lightconstants:

HDRI_DEFAULT_VALUES = {HDRI_NAME: “hdriSkydome”,

HDRI_INTENSITY: 1.0, HDRI_ROTATE: [0.0, 0.0, 0.0], HDRI_TRANSLATE: [0.0, 0.0, 0.0], HDRI_SCALE: [1.0, 1.0, 1.0], HDRI_TEXTURE: “”, HDRI_INVERT: False, HDRI_LIGHTVISIBILITY: True, HDRI_TINT: [1.0, 1.0, 1.0]}

Author: Andrew Silke

class RendermanHdri(name='', genAttrDict=None, node=None, create=False, ingest=False, suffixName=False, message=True)

Bases: HdriBase

Main class that manages a HDRI Skydome Light

nodetype = 'PxrDomeLight'
lightSuffix = 'PXR'
intensityAttr = 'intensity'
rotateAttr = 'rotate'
translateAttr = 'translate'
scaleAttr = 'scale'
imagePathAttr = 'lightColorMap'
invertAttr = ''
backgroundVisAttr = 'primaryVisibility'
tintColorAttr = 'lightColor'
rotOffset = 180
scaleMultiply = 0.4
renderer()

Returns the current renderer as a string

setIntensity(intensity)

Sets the intensity (brightness) of the HDRI Skydome light.

Parameters:

intensity (float) – The intensity of the light in Zoo generic units

intensity()

Gets the intensity (brightness) of the HDRI Skydome light.

Return intensity:

The intensity of the light in generic Zoo units

Rtype intensity:

float

rotate()

Old Renderman was out 180 degrees out from Arnold (generic) so compensate Full gimbal is not well supported so orientations can mismatch.

Newer versions of Renderman match perfectly with Arnold so all good 22 and above.

Return rotate:

The rotation value generic value for UIs

Rtype rotate:

list(float)

setRotate(rotate)

Old Renderman was out 180 degrees out from Arnold (generic) so compensate Full gimbal is not well supported so orientations can mismatch.

Newer versions of Renderman match perfectly with Arnold so all good 22 and above.

Parameters:

rotate (list(float)) – The rotation value generic value for UIs

scale()

Retrieves the scale value while compensating for Renderman’s scale differences. Result is generic units.

Return scale:

Scale of the light in generic units (UI)

Return scale:

list(float)

setScale(scale, invert=False)

Scales the HDRI light while compensating for Renderman’s scale differences

Parameters:
  • scale (list(float)) – Scale of the light in generic units (UI)

  • invert (bool) – Negatively scale the HDRI light on Z

setImagePath(imagePath)
imagePath()
setBackgroundVis(backgroundVis)
backgroundVis()
setTint(tint)
tint()

Vrayhdri

This module is the base class for VRay HDRI Skydomes

HDRI Skydomes have these properties.

  • name: The name of the light (str)

  • shapeName: The name of the light (str)

  • nodetype: The node type of the HDRI Skydome (str)

  • lightSuffix: The optional suffix of the light

  • intensity: The intensity of the light

  • rotate: The rotation values in 3d space

  • translate: The translation values in 3d space

  • scale: The scale values in 3d space

  • imagePath: The path to the skydome image on disk

  • invert: Is the HDRI image inverted for text etc?

  • backgroundVis: Is the skydome visible in the scene?

  • tintColor: The tint offset of the skydome

Example use (base class will not build lights):

from zoo.libs.maya.cmds.lighting.hdritypes import vrayhdri
hdriInst = vrayhdri.VRayHdri("hdriSkydomeName", create=True, suffix=False)  # creates a new HDRI light

hdriInst.setName("myHdriSkydomeLight")  # sets name of the light
hdriInst.setIntensity(1.5)
hdriInst.setBackgroundVis(False)  # sets the background to be invisible in renders
hdriInst.setRotate([0.0, 95.3, 0.0])  # rotates the HDRI light 90 degrees

hdriInst = vrayhdri.VRayHdri(name="existingSkydome", create=False, ingest=True)  # ingest an existing skydome

Default HDRI dictionary example from zoo.libs.maya.cmds.lighting.lightconstants:

HDRI_DEFAULT_VALUES = {HDRI_NAME: “hdriSkydome”,

HDRI_INTENSITY: 1.0, HDRI_ROTATE: [0.0, 0.0, 0.0], HDRI_TRANSLATE: [0.0, 0.0, 0.0], HDRI_SCALE: [1.0, 1.0, 1.0], HDRI_TEXTURE: “”, HDRI_INVERT: False, HDRI_LIGHTVISIBILITY: True, HDRI_TINT: [1.0, 1.0, 1.0]}

Author: Andrew Silke

class VRayHdri(name='', genAttrDict=None, node=None, create=False, ingest=False, suffixName=False, message=True)

Bases: HdriBase

Main class that manages a HDRI Skydome Light

nodetype = 'VRayLightDomeShape'
lightSuffix = 'VRAY'
intensityAttr = 'intensityMult'
rotateAttr = 'rotate'
translateAttr = 'translate'
scaleAttr = 'scale'
imagePathAttr = 'fileTextureName'
invertAttr = ''
backgroundVisAttr = 'invisible'
tintColorAttr = 'lightColor'
rotOffset = 90.0
scaleMultiply = 1.0
delete()

Deletes the transform node and any connected textures

renderer()

Returns the current renderer as a string

create(message=True)

Creates the HDRI Skydome light

Parameters:

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

setIntensity(intensity)

Sets the intensity (brightness) of the HDRI Skydome light.

Parameters:

intensity (float) – The intensity of the light in Zoo generic units

intensity()

Gets the intensity (brightness) of the HDRI Skydome light.

Return intensity:

The intensity of the light in generic Zoo units

Rtype intensity:

float

rotate()

VRay is 90 degrees out from Arnold (generic) so compensate Full gimbal is not well supported so orientations can mismatch.

Return rotate:

The rotation value generic value for UIs

Rtype rotate:

list(float)

setRotate(rotate)

VRay is 90 degrees out from Arnold (generic) so compensate Full gimbal is not well supported so orientations can mismatch.

Parameters:

rotate (list(float)) – The rotation value generic value for UIs

setImagePath(imagePath)

Sets the image path while handling the texture connections

imagePath()

Returns the full path of the image texture on disk, can be “” if not used.

Return imagePath:

The full path of the image texture on disk, can be “” if not used.

Rtype imagePath:

str

setBackgroundVis(backgroundVis)
backgroundVis()
setTint(tint)
tint()