Arnoldstandardsurface¶
This module creates and manages an Arnold aiStandardSurface shader.
This class is a subclass of shaderbase and inherits all functionality where applicable.
Example use:
from zoo.libs.maya.cmds.shaders.shadertypes import arnoldstandardsurface
shadInst = arnoldstandardsurface.AiStandardSurface("shaderName", create=True) # creates a new shader
shadInst.setDiffuse([0.0, 0.0, 1.0]) # sets diffuse color to blue
shadInst.setDiffuseWeight(1.0)
shadInst.setMetalness(1.0) # sets metalness to be on
shadInst.setSpecWeight(1.0)
shadInst.setSpecColor([1, 1, 1])
shadInst.setSpecRoughness(1.0)
shadInst.setSpecIOR(1.3)
shadInst.setCoatWeight(0.0)
shadInst.setCoatIOR(1.5)
shadInst.setCoatRoughness(.1)
shadInst.setCoatColor([1, 1, 1])
shadInst2 = rendermanpxrlayersurface.AiStandardSurface("rocketShader", ingest=True) # Loads existing "rocketShader" as instance
shadInst2.assignSelected()
shadInst2.setShaderName("newNameY")
print(shadInst2.shaderName())
Author: Andrew Silke
- class AiStandardSurface(shaderName='', node=None, genAttrDict=None, create=False, ingest=False, suffixName=False, message=True)¶
Bases:
ShaderBase
Manages the creation and set/get attribute values for the aiStandardSurface
- nodetype = 'aiStandardSurface'¶
- suffix = 'ARN'¶
- outColorAttr = 'outColor'¶
- diffuseWeightAttr = 'base'¶
- diffuseColorAttr = 'baseColor'¶
- diffuseRoughnessAttr = 'diffuseRoughness'¶
- metalnessAttr = 'metalness'¶
- specularWeightAttr = 'specular'¶
- specularColorAttr = 'specularColor'¶
- specularRoughnessAttr = 'specularRoughness'¶
- specularIorAttr = 'specularIOR'¶
- coatWeightAttr = 'coat'¶
- coatcolorAttr = 'coatColor'¶
- coatRoughnessAttr = 'coatRoughness'¶
- coatIorAttr = 'coatIOR'¶
- emissionAttr = 'emissionColor'¶
- emissionWeightAttr = 'emission'¶
- normalAttr = 'normalCamera'¶
- bumpAttr = 'normalCamera'¶
- knownShader()¶
Returns True as this shader is supported by Zoo Tools
- Returns:
True if this shader is supported by Zoo Tools Flase if not.
- Return type:
- renderer()¶
Returns the current renderer as a string in this case “Arnold”.
- Returns:
Returns the current renderer as a string in this case “Arnold”.
- Return type:
- createShader(message=True)¶
Creates a aiSurfaceStandard node network and loads the nodes as class variables
Overridden method.
- Parameters:
message (bool) – Report a message to the user when the shader is created
- setDiffuseWeight(value)¶
Sets the diffuse weight value.
- Parameters:
value (float) – The diffuse weight value 0.0-1.0
- diffuseWeight()¶
Returns the current diffuse weight value.
- Returns:
The diffuse weight value 0-1.0, None if textured/connected
- Return type:
- setDiffuse(color)¶
Sets the diffuse color.
- Parameters:
color (list(float)) – The color as rendering space float color, (0.5, 1.0, 0.0)
- diffuse()¶
Returns the diffuse color.
- Returns:
The diffuse color as linear float rgb (0.1, 0.5, 1.0), None if textured/connected
- Return type:
list(float)
- setDiffuseRoughness(value)¶
Sets the diffuse weight value.
- Parameters:
value (float) – The diffuse weight value 0.0-1.0
- diffuseRoughness()¶
Returns the current diffuse weight value.
- Returns:
The diffuse weight value 0-1.0, None if textured/connected
- Return type:
- setMetalness(value)¶
Sets the metalness value.
- Parameters:
value (float) – The metalness value 0-1.0
- metalness()¶
Returns the metalness value.
- Returns:
The metalness value 0-1.0, None if textured/connected
- Return type:
- setSpecWeight(value)¶
Sets the specular weight value.
- Parameters:
value (float) – Specular Weight value 0-1.0
- specWeight()¶
Returns the specular weight value.
- Returns:
Specular Weight value 0-1.0, None if textured/connected
- Return type:
- setSpecColor(color)¶
Sets the specular color.
- Parameters:
color (list(float)) – Specular color as rendering space float rgb (0.5, 1.0, 0.0)
- specColor()¶
Returns the specular color.
- Returns:
Specular color as rendering space float rgb (0.5, 1.0, 0.0), None if textured/connected
- Return type:
list(float)
- setSpecRoughness(value)¶
Sets the specular roughness value.
- Parameters:
value (float) – The specular roughness value 0-1.0
- specRoughness()¶
Returns the specular roughness value.
- Return value:
The specular roughness value 0-1.0, None if textured/connected
- Rtype value:
float
- setSpecIOR(value)¶
Sets the specular IOR value.
- Parameters:
value (float) – The specular IOR value, 1.0 - 20.0
- specIOR()¶
Sets the specular IOR.
- Returns:
The specular IOR value, 1.0 - 20.0, None if textured/connected
- Return type:
- setCoatWeight(value)¶
Sets the clear coat weight.
- Parameters:
value (float) – The clear coat weight value 0-1.0
- coatWeight()¶
Returns the clear coat weight.
- Returns:
The clear coat weight value 0-1.0, None if textured/connected
- Return type:
- setCoatColor(color)¶
Sets the clear coat color.
- Parameters:
color (list(float)) – Clear coat color as rendering space float rgb (0.5, 1.0, 0.0)
- coatColor()¶
Returns the clear coat color.
- Returns:
Clear coat color as rendering space float rgb (0.5, 1.0, 0.0), None if textured/connected
- Return type:
list(float)
- setCoatRoughness(value)¶
Sets the clear coat roughness value.
- Parameters:
value (float) – The clear coat roughness value 0 -1.0
- coatRoughness()¶
Returns the clear coat roughness value.
- Returns:
The clear coat roughness value 0 -1.0, None if textured/connected
- Return type:
- setCoatIOR(value)¶
Sets the clear coat IOR value.
- Parameters:
value (float) – The clear coat IOR value, 1.0 - 20.0
- coatIOR()¶
Returns the clear coat IOR value.
- Returns:
The clear coat IOR value, 1.0 - 20.0, None if textured/connected
- Return type:
- setEmission(color)¶
Sets the emission (self illumination) color.
- Parameters:
color (list(float)) – Emission color as rendering space float rgb (0.5, 1.0, 0.0)
- emission()¶
Returns the emission (self illumination) color.
- Returns:
Emission color as rendering space float rgb (0.5, 1.0, 0.0), None if textured/connected
- Return type:
list(float)
Mayablinn¶
This module creates and manages a blinn shader, many regular shader attributes are not used.
This class is a subclass of shaderbase and inherits all functionality where applicable.
Example use:
from zoo.libs.maya.cmds.shaders.shadertypes import mayablinn
shadInst = mayablinn.Blinn("shaderName", create=True) # creates a new shader
shadInst.setDiffuse([0.0, 0.0, 1.0]) # sets diffuse color to blue
shadInst.setDiffuseWeight(1.0)
shadInst2 = mayablinn.Blinn("rocketShader", ingest=True) # Loads existing "rocketShader" as instance
shadInst2.assignSelected()
shadInst2.setShaderName("newNameY")
print(shadInst2.shaderName())
Author: Andrew Silke
- class Blinn(shaderName='', node=None, genAttrDict=None, create=False, ingest=False, suffixName=False, message=True)¶
Bases:
ShaderBase
Manages the creation and set/get attribute values for the Blinn
- nodetype = 'blinn'¶
- suffix = 'BLNN'¶
- outColorAttr = 'outColor'¶
- diffuseWeightAttr = 'diffuse'¶
- diffuseColorAttr = 'color'¶
- diffuseRoughnessAttr = ''¶
- metalnessAttr = ''¶
- specularWeightAttr = 'specularRollOff'¶
- specularColorAttr = 'specularColor'¶
- specularRoughnessAttr = 'eccentricity'¶
- specularIorAttr = ''¶
- coatWeightAttr = ''¶
- coatcolorAttr = ''¶
- coatRoughnessAttr = ''¶
- coatIorAttr = ''¶
- emissionAttr = 'incandescence'¶
- emissionWeightAttr = ''¶
- normalAttr = 'normalCamera'¶
- bumpAttr = 'normalCamera'¶
- knownShader()¶
Returns True as this shader is supported by Zoo Tools
- renderer()¶
Returns the current renderer as a string
- createShader(message=True)¶
Creates a blinn node network and loads the nodes as class variables
Overridden method.
- Parameters:
message (bool) – Report a message to the user when the shader is created
- setDiffuseWeight(value)¶
Sets the diffuse weight
- Parameters:
value (float) – The diffuse weight value 0.0-1.0
- diffuseWeight()¶
Returns the current diffuse weight
- Return value:
The diffuse weight value 0-1.0, None if textured/connected
- Rtype value:
float
- setDiffuse(color)¶
Sets the diffuse color
- Parameters:
color (list(float)) – The color as rendering space float color, (0.5, 1.0, 0.0)
- diffuse()¶
Returns the diffuse color
- Return color:
The diffuse color as linear float rgb (0.1, 0.5, 1.0), None if textured/connected
- Rtype color:
list(float)
- setSpecColor(color)¶
Sets the specular color
- Parameters:
color (list(float)) – The specular color as rendering space float color, (0.5, 1.0, 0.0)
- specColor()¶
Returns the specular color
- Return value:
The specular color as linear float rgb (0.1, 0.5, 1.0), None if textured/connected
- Rtype value:
list(float)
- setSpecRoughness(value)¶
Sets the specular roughness value.
Blinn this is the eccentricity attribute.
- Parameters:
value (float) – The specular roughness value 0-1.0, None if textured/connected
- specRoughness()¶
Returns the specular roughness value.
Blinn this is the eccentricity attribute.
- Return value:
The specular roughness value 0-1.0, None if textured/connected
- Rtype value:
float
- setSpecWeight(value)¶
Sets the specular weight value
Blinn this is the specularRollOff attribute.
- Parameters:
value (float) – Specular Weight value 0-1.0
- specWeight()¶
Returns the specular weight value
Blinn this is the specularRollOff attribute.
- Return value:
Specular Weight value 0-1.0, None if textured/connected
- Rtype value:
float
- setEmission(color)¶
Sets the emission (self illumination) color
- Parameters:
color (list(float)) – Emission color as rendering space float rgb (0.5, 1.0, 0.0)
- emission()¶
Returns the emission (self illumination) color
- Return color:
Emission color as rendering space float rgb (0.5, 1.0, 0.0), None if textured/connected
- Rtype color:
list(float)
Mayalambert¶
This module creates and manages a lambert shader, many regular shader attributes are not used.
This class is a subclass of shaderbase and inherits all functionality where applicable.
Example use:
from zoo.libs.maya.cmds.shaders.shadertypes import mayalambert
shadInst = mayalambert.Lambert("shaderName", create=True) # creates a new shader
shadInst.setDiffuse([0.0, 0.0, 1.0]) # sets diffuse color to blue
shadInst.setDiffuseWeight(1.0)
shadInst2 = mayalambert.Lambert("rocketShader", ingest=True) # Loads existing "rocketShader" as instance
shadInst2.assignSelected()
shadInst2.setShaderName("newNameY")
print(shadInst2.shaderName())
- class Lambert(shaderName='', node=None, genAttrDict=None, create=False, ingest=False, suffixName=False, message=True)¶
Bases:
ShaderBase
Manages the creation and set/get attribute values for the Lambert
- nodetype = 'lambert'¶
- suffix = 'LMBT'¶
- outColorAttr = 'outColor'¶
- diffuseWeightAttr = 'diffuse'¶
- diffuseColorAttr = 'color'¶
- diffuseRoughnessAttr = ''¶
- metalnessAttr = ''¶
- specularWeightAttr = ''¶
- specularColorAttr = ''¶
- specularRoughnessAttr = ''¶
- specularIorAttr = ''¶
- coatWeightAttr = ''¶
- coatcolorAttr = ''¶
- coatRoughnessAttr = ''¶
- coatIorAttr = ''¶
- emissionAttr = 'incandescence'¶
- emissionWeightAttr = ''¶
- normalAttr = 'normalCamera'¶
- bumpAttr = 'normalCamera'¶
- knownShader()¶
Returns True as this shader is supported by Zoo Tools
- renderer()¶
Returns the current renderer as a string
- createShader(message=True)¶
Creates a lambert node network and loads the nodes as class variables
Overridden method.
- Parameters:
message (bool) – Report a message to the user when the shader is created
- setDiffuseWeight(value)¶
Sets the diffuse weight
- Parameters:
value (float) – The diffuse weight value 0.0-1.0
- diffuseWeight()¶
Returns the current diffuse weight
- Return value:
The diffuse weight value 0-1.0, None if textured/connected
- Rtype value:
float
- setDiffuse(color)¶
Sets the diffuse color
- Parameters:
color (list(float)) – The color as rendering space float color, (0.5, 1.0, 0.0)
- diffuse()¶
Returns the diffuse color
- Return value:
The diffuse color as linear float rgb (0.1, 0.5, 1.0), None if textured/connected
- Rtype value:
list(float)
- specColor()¶
Returns the specular color, for lambert it’s always 0, 0, 0
No set function for lambert
- Return color:
Specular color as rendering space float rgb (0.5, 1.0, 0.0), None if textured/connected
- Rtype color:
list(float)
- setEmission(color)¶
Sets the emission (self illumination) color
- Parameters:
color (list(float)) – Emission color as rendering space float rgb (0.5, 1.0, 0.0)
- emission()¶
Returns the emission (self illumination) color
- Return color:
Emission color as rendering space float rgb (0.5, 1.0, 0.0), None if textured/connected
- Rtype color:
list(float)
Mayaphong¶
This module creates and manages a phong shader, many regular shader attributes are not used.
This class is a subclass of shaderbase and inherits all functionality where applicable.
Example use:
from zoo.libs.maya.cmds.shaders.shadertypes import mayaphong
shadInst = mayaphong.Phong("shaderName", create=True) # creates a new shader
shadInst.setDiffuse([0.0, 0.0, 1.0]) # sets diffuse color to blue
shadInst.setDiffuseWeight(1.0)
shadInst2 = mayaphong.Phong("rocketShader", ingest=True) # Loads existing "rocketShader" as instance
shadInst2.assignSelected()
shadInst2.setShaderName("newNameY")
print(shadInst2.shaderName())
- class Phong(shaderName='', node=None, genAttrDict=None, create=False, ingest=False, suffixName=False, message=True)¶
Bases:
ShaderBase
Manages the creation and set/get attribute values for the Phong
- nodetype = 'phong'¶
- suffix = 'PHNG'¶
- outColorAttr = 'outColor'¶
- diffuseWeightAttr = 'diffuse'¶
- diffuseColorAttr = 'color'¶
- diffuseRoughnessAttr = ''¶
- metalnessAttr = ''¶
- specularWeightAttr = ''¶
- specularColorAttr = 'specularColor'¶
- specularRoughnessAttr = 'cosinePower'¶
- specularIorAttr = ''¶
- coatWeightAttr = ''¶
- coatcolorAttr = ''¶
- coatRoughnessAttr = ''¶
- coatIorAttr = ''¶
- emissionAttr = 'incandescence'¶
- emissionWeightAttr = ''¶
- normalAttr = 'normalCamera'¶
- bumpAttr = 'normalCamera'¶
- knownShader()¶
Returns True as this shader is supported by Zoo Tools
- renderer()¶
Returns the current renderer as a string
- createShader(message=True)¶
Creates a phong node network and loads the nodes as class variables
Overridden method.
- Parameters:
message (bool) – Report a message to the user when the shader is created
- setDiffuseWeight(value)¶
Sets the diffuse weight
- Parameters:
value (float) – The diffuse weight value 0.0-1.0
- diffuseWeight()¶
Returns the current diffuse weight
- Return value:
The diffuse weight value 0-1.0, None if textured/connected
- Rtype value:
float
- setDiffuse(color)¶
Sets the diffuse color
- Parameters:
color (list(float)) – The color as rendering space float color, (0.5, 1.0, 0.0)
- diffuse()¶
Returns the diffuse color
- Return color:
The diffuse color as linear float rgb (0.1, 0.5, 1.0), None if textured/connected
- Rtype color:
list(float)
- setSpecColor(color)¶
Sets the specular color
- Parameters:
color (list(float)) – The specular color as rendering space float color, (0.5, 1.0, 0.0)
- specColor()¶
Returns the specular color
- Return value:
The specular color as linear float rgb (0.1, 0.5, 1.0), None if textured/connected
- Rtype value:
list(float)
- setSpecRoughness(value)¶
Sets the specular roughness value. In the Phong’s case it’s setting cosinePower.
Phong this value is inverted and falls in a range of 2.0 - 100, 100 is sharp, 2.0 is rough
- Parameters:
value (float) – The specular roughness value 0-1.0, None if textured/connected
- specRoughness()¶
Returns the specular roughness value. In the Phong’s case it’s setting cosinePower.
Phong this value is inverted and falls in a range of 2.0 - 100, 100 is sharp, 2.0 is rough So this function does the math to convert into a 0.0-1.0 range
- Return value:
The specular roughness value 0-1.0, None if textured/connected
- Rtype value:
float
- setEmission(color)¶
Sets the emission (self illumination) color
- Parameters:
color (list(float)) – Emission color as rendering space float rgb (0.5, 1.0, 0.0)
- emission()¶
Returns the emission (self illumination) color
- Return color:
Emission color as rendering space float rgb (0.5, 1.0, 0.0), None if textured/connected
- Rtype color:
list(float)
Mayaphonge¶
This module creates and manages a phongE shader, many regular shader attributes are not used.
This class is a subclass of shaderbase and inherits all functionality where applicable.
Example use:
from zoo.libs.maya.cmds.shaders.shadertypes import mayaphonge
shadInst = mayaphonge.PhongE("shaderName", create=True) # creates a new shader
shadInst.setDiffuse([0.0, 0.0, 1.0]) # sets diffuse color to blue
shadInst.setDiffuseWeight(1.0)
shadInst2 = mayaphonge.PhongE("rocketShader", ingest=True) # Loads existing "rocketShader" as instance
shadInst2.assignSelected()
shadInst2.setShaderName("newNameY")
print(shadInst2.shaderName())
- class PhongE(shaderName='', node=None, genAttrDict=None, create=False, ingest=False, suffixName=False, message=True)¶
Bases:
ShaderBase
Manages the creation and set/get attribute values for the PhongE
- nodetype = 'phongE'¶
- suffix = 'PNGE'¶
- outColorAttr = 'outColor'¶
- diffuseWeightAttr = 'diffuse'¶
- diffuseColorAttr = 'color'¶
- diffuseRoughnessAttr = ''¶
- metalnessAttr = ''¶
- specularWeightAttr = ''¶
- specularColorAttr = 'specularColor'¶
- specularRoughnessAttr = 'roughness'¶
- specularIorAttr = ''¶
- coatWeightAttr = ''¶
- coatcolorAttr = ''¶
- coatRoughnessAttr = ''¶
- coatIorAttr = ''¶
- emissionAttr = 'incandescence'¶
- emissionWeightAttr = ''¶
- normalAttr = 'normalCamera'¶
- bumpAttr = 'normalCamera'¶
- knownShader()¶
Returns True as this shader is supported by Zoo Tools
- renderer()¶
Returns the current renderer as a string
- createShader(message=True)¶
Creates a phongE node network and loads the nodes as class variables
Overridden method.
- Parameters:
message (bool) – Report a message to the user when the shader is created
- setDiffuseWeight(value)¶
Sets the diffuse weight
- Parameters:
value (float) – The diffuse weight value 0.0-1.0
- diffuseWeight()¶
Returns the current diffuse weight
- Return value:
The diffuse weight value 0-1.0, None if textured/connected
- Rtype value:
float
- setDiffuse(color)¶
Sets the diffuse color
- Parameters:
color (list(float)) – The color as rendering space float color, (0.5, 1.0, 0.0)
- diffuse()¶
Returns the diffuse color
- Return color:
The diffuse color as linear float rgb (0.1, 0.5, 1.0), None if textured/connected
- Rtype color:
list(float)
- setSpecColor(color)¶
Sets the specular color
- Parameters:
color (list(float)) – The specular color as rendering space float color, (0.5, 1.0, 0.0)
- specColor()¶
Returns the specular color
- Return value:
The specular color as linear float rgb (0.1, 0.5, 1.0), None if textured/connected
- Rtype value:
list(float)
- setSpecRoughness(value)¶
Sets the specular roughness value.
- Parameters:
value (float) – The specular roughness value 0-1.0, None if textured/connected
- specRoughness()¶
Returns the specular roughness value.
PhongE this value is inverted and falls in a range of 2.0 - 100, 100 is sharp, 2.0 is rough So this function does the math to convert into a 0.0-1.0 range
- Return value:
The specular roughness value 0-1.0, None if textured/connected
- Rtype value:
float
- setEmission(color)¶
Sets the emission (self illumination) color
- Parameters:
color (list(float)) – Emission color as rendering space float rgb (0.5, 1.0, 0.0)
- emission()¶
Returns the emission (self illumination) color
- Return color:
Emission color as rendering space float rgb (0.5, 1.0, 0.0), None if textured/connected
- Rtype color:
list(float)
Mayastandardsurface¶
This module creates and manages Maya’s standardSurface shader.
This class is a subclass of shaderbase and inherits all functionality where applicable.
Example use:
from zoo.libs.maya.cmds.shaders.shadertypes import mayastandardsurface
shadInst = mayastandardsurface.StandardSurface("shaderName", create=True) # creates a new shader
shadInst.setDiffuse([0.0, 0.0, 1.0]) # sets diffuse color to blue
shadInst.setDiffuseWeight(1.0)
shadInst.setMetalness(1.0) # sets metalness to be on
shadInst.setSpecWeight(1.0)
shadInst.setSpecColor([1, 1, 1])
shadInst.setSpecRoughness(1.0)
shadInst.setSpecIOR(1.3)
shadInst.setCoatWeight(0.0)
shadInst.setCoatIOR(1.5)
shadInst.setCoatRoughness(.1)
shadInst.setCoatColor([1, 1, 1])
shadInst2 = mayastandardsurface.StandardSurface("rocketShader", ingest=True) # Loads existing "rocketShader" as instance
shadInst2.assignSelected()
shadInst2.setShaderName("newNameY")
print(shadInst2.shaderName())
- class StandardSurface(shaderName='', node=None, genAttrDict=None, create=False, ingest=False, suffixName=False, message=True)¶
Bases:
ShaderBase
Manages the creation and set/get attribute values for the StandardSurface
- nodetype = 'standardSurface'¶
- suffix = 'STRD'¶
- outColorAttr = 'outColor'¶
- diffuseWeightAttr = 'base'¶
- diffuseColorAttr = 'baseColor'¶
- diffuseRoughnessAttr = 'diffuseRoughness'¶
- metalnessAttr = 'metalness'¶
- specularWeightAttr = 'specular'¶
- specularColorAttr = 'specularColor'¶
- specularRoughnessAttr = 'specularRoughness'¶
- specularIorAttr = 'specularIOR'¶
- coatWeightAttr = 'coat'¶
- coatcolorAttr = 'coatColor'¶
- coatRoughnessAttr = 'coatRoughness'¶
- coatIorAttr = 'coatIOR'¶
- emissionAttr = 'emissionColor'¶
- emissionWeightAttr = 'emission'¶
- normalAttr = 'normalCamera'¶
- bumpAttr = 'normalCamera'¶
- knownShader()¶
Returns True as this shader is supported by Zoo Tools
- renderer()¶
Returns the current renderer as a string
- setFromDict(genAttrDict, apply=True, noneIsDefault=True, colorsAreSrgb=False)¶
Sets the shader from a generic attribute dictionary. Values as attribute values. Fix Clear Coat issues where standardSurface can apply as grey color, should always be white 100% bright
Colors are linear by default, use the colorsAreSrgb flag if SRGB.
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
colorsAreSrgb (bool) – Set to True if the incoming colors are SRGB such as from a UI.
- createShader(message=True)¶
Creates a aiSurfaceStandard node network and loads the nodes as class variables
Overridden method.
- Parameters:
message (bool) – Report a message to the user when the shader is created
- setDiffuseWeight(value)¶
Sets the diffuse weight
- Parameters:
value (float) – The diffuse weight value 0.0-1.0
- diffuseWeight()¶
Returns the current diffuse weight
- Return value:
The diffuse weight value 0-1.0, None if textured/connected
- Rtype value:
float
- setDiffuse(color)¶
Sets the diffuse color
- Parameters:
color (list(float)) – The diffuse color as rendering space float color, (0.5, 1.0, 0.0)
- diffuse()¶
Returns the diffuse color
- Return value:
The diffuse color as rendering space float rgb (0.1, 0.5, 1.0), None if textured/connected
- Rtype value:
list(float)
- setDiffuseRoughness(value)¶
Sets the diffuse weight
- Parameters:
value (float) – The diffuse weight value 0.0-1.0
- diffuseRoughness()¶
Returns the current diffuse weight
- Return value:
The diffuse weight value 0-1.0, None if textured/connected
- Rtype value:
float
- metalness()¶
Returns the metalness value
- Return value:
The metalness value 0-1.0, None if textured/connected
- Rtype value:
float
- setSpecWeight(value)¶
Sets the specular weight value
- Parameters:
value (float) – Specular Weight value 0-1.0
- specWeight()¶
Returns the specular weight value
- Return value:
Specular Weight value 0-1.0, None if textured/connected
- Rtype value:
float
- setSpecColor(color)¶
Sets the specular color
- Parameters:
color (list(float)) – Specular color as rendering space float rgb (0.5, 1.0, 0.0)
- specColor()¶
Returns the specular color
- Return color:
Specular color as rendering space float rgb (0.5, 1.0, 0.0), None if textured/connected
- Rtype color:
list(float)
- setSpecRoughness(value)¶
Sets the specular roughness value
- Parameters:
value (float) – The specular roughness value 0-1.0
- specRoughness()¶
Returns the specular roughness value
- Return value:
The specular roughness value 0-1.0, None if textured/connected
- Rtype value:
float
- setSpecIOR(value)¶
Sets the specular IOR value
- Parameters:
value (float) – The specular IOR value, 1.0 - 20.0
- specIOR()¶
Sets the specular IOR
- Return value:
The specular IOR value, 1.0 - 20.0, None if textured/connected
- Rtype value:
float
- setCoatWeight(value)¶
Sets the clear coat weight
- Parameters:
value (float) – The clear coat weight value 0-1.0
- coatWeight()¶
Returns the clear coat weight
- Return value:
The clear coat weight value 0-1.0, None if textured/connected
- Rtype value:
float
- setCoatColor(color)¶
Sets the clear coat color
- Parameters:
color (list(float)) – Clear coat color as rendering space float rgb (0.5, 1.0, 0.0)
- coatColor()¶
Returns the clear coat color
- Return color:
Clear coat color as rendering space float rgb (0.5, 1.0, 0.0), None if textured/connected
- Rtype color:
list(float)
- setCoatRoughness(value)¶
Sets the clear coat roughness value
- Parameters:
value (float) – The clear coat roughness value 0 -1.0
- coatRoughness()¶
Returns the clear coat roughness value
- Return value:
The clear coat roughness value 0 -1.0, None if textured/connected
- Rtype value:
float
- setCoatIOR(value)¶
Sets the clear coat IOR value
- Parameters:
value (float) – The clear coat IOR value, 1.0 - 20.0
- coatIOR()¶
Returns the clear coat IOR value
- Return value:
The clear coat IOR value, 1.0 - 20.0, None if textured/connected
- Rtype value:
float
- setEmission(color)¶
Sets the emission (self illumination) color
- Parameters:
color (list(float)) – Emission color as rendering space float rgb (0.5, 1.0, 0.0)
- emission()¶
Returns the emission (self illumination) color
- Return color:
Emission color as rendering space float rgb (0.5, 1.0, 0.0), None if textured/connected
- Rtype color:
list(float)
- setEmissionWeight(value)¶
Sets the emission weight value
- Parameters:
value (float) – Emission weight value, 1.0 and above
- emissionWeight()¶
Returns the emission weight value
- Return value:
Emission weight value, 1.0 and above, None if textured/connected
- Rtype value:
float
Redshiftredshiftmaterial¶
This module creates and manages a Redshift Material shader.
This class is a subclass of shaderbase and inherits all functionality where applicable.
Example use:
from zoo.libs.maya.cmds.shaders.shadertypes import redshiftredshiftmaterial
shadInst = redshiftredshiftmaterial.RedshiftMaterial("shaderName", create=True) # creates a new shader
shadInst.setDiffuse([0.0, 0.0, 1.0]) # sets diffuse color to blue
shadInst.setDiffuseWeight(1.0)
shadInst.setMetalness(1.0) # sets metalness to be on
shadInst.setSpecWeight(1.0)
shadInst.setSpecColor([1, 1, 1])
shadInst.setSpecRoughness(1.0)
shadInst.setSpecIOR(1.3)
shadInst.setCoatWeight(0.0)
shadInst.setCoatIOR(1.5)
shadInst.setCoatRoughness(.1)
shadInst.setCoatColor([1, 1, 1])
shadInst2 = redshiftredshiftmaterial.RedshiftMaterial("rocketShader", ingest=True) # Loads existing "rocketShader" as instance
shadInst2.assignSelected()
shadInst2.setShaderName("newNameY")
print(shadInst2.shaderName())
- class RedshiftMaterial(shaderName='', node=None, genAttrDict=None, create=False, ingest=False, suffixName=False, message=True)¶
Bases:
ShaderBase
Manages the creation and set/get attribute values for the RedshiftMaterial
- nodetype = 'RedshiftMaterial'¶
- suffix = 'RS'¶
- outColorAttr = 'outColor'¶
- diffuseWeightAttr = 'diffuse_weight'¶
- diffuseColorAttr = 'diffuse_color'¶
- diffuseRoughnessAttr = 'diffuse_roughness'¶
- metalnessAttr = 'refl_metalness'¶
- specularWeightAttr = 'refl_weight'¶
- specularColorAttr = 'refl_color'¶
- specularRoughnessAttr = 'refl_roughness'¶
- specularIorAttr = 'refl_ior'¶
- coatWeightAttr = 'coat_weight'¶
- coatcolorAttr = 'coat_color'¶
- coatRoughnessAttr = 'coat_roughness'¶
- coatIorAttr = 'coat_ior'¶
- emissionAttr = 'emission_color'¶
- emissionWeightAttr = 'emission_weight'¶
- normalAttr = 'normalCamera'¶
- bumpAttr = 'normalCamera'¶
- knownShader()¶
Returns True as this shader is supported by Zoo Tools
- renderer()¶
Returns the current renderer as a string
- createShader(message=True)¶
Creates a redshiftMaterial node network and loads the nodes as class variables
Overridden method.
- Parameters:
message (bool) – Report a message to the user when the shader is created
- setDiffuseWeight(value)¶
Sets the diffuse weight
- Parameters:
value (float) – The diffuse weight value 0.0-1.0
- diffuseWeight()¶
Returns the current diffuse weight
- Return value:
The diffuse weight value 0-1.0, None if textured/connected
- Rtype value:
float
- setDiffuse(color)¶
Sets the diffuse color
- Parameters:
color (list(float)) – The color as rendering space float color, (0.5, 1.0, 0.0)
- diffuse()¶
Returns the diffuse color
- Return value:
The diffuse color as linear float rgb (0.1, 0.5, 1.0), None if textured/connected
- Rtype value:
list(float)
- setDiffuseRoughness(value)¶
Sets the diffuse weight
- Parameters:
value (float) – The diffuse weight value 0.0-1.0
- diffuseRoughness()¶
Returns the current diffuse weight
- Return value:
The diffuse weight value 0-1.0, None if textured/connected
- Rtype value:
float
- metalness()¶
Returns the metalness value
- Return value:
The metalness value 0-1.0, None if textured/connected
- Rtype value:
float
- setSpecWeight(value)¶
Sets the specular weight value
- Parameters:
value (float) – Specular Weight value 0-1.0
- specWeight()¶
Returns the specular weight value
- Return value:
Specular Weight value 0-1.0, None if textured/connected
- Rtype value:
float
- setSpecColor(color)¶
Sets the specular color
- Parameters:
color (list(float)) – Specular color as rendering space float rgb (0.5, 1.0, 0.0)
- specColor()¶
Returns the specular color
- Return color:
Specular color as rendering space float rgb (0.5, 1.0, 0.0), None if textured/connected
- Rtype color:
list(float)
- setSpecRoughness(value)¶
Sets the specular roughness value
- Parameters:
value (float) – The specular roughness value 0-1.0
- specRoughness()¶
Returns the specular roughness value
- Return value:
The specular roughness value 0-1.0, None if textured/connected
- Rtype value:
float
- setSpecIOR(value)¶
Sets the specular IOR value
- Parameters:
value (float) – The specular IOR value, 1.0 - 20.0
- specIOR()¶
Sets the specular IOR
- Return value:
The specular IOR value, 1.0 - 20.0, None if textured/connected
- Rtype value:
float
- setCoatWeight(value)¶
Sets the clear coat weight
- Parameters:
value (float) – The clear coat weight value 0-1.0
- coatWeight()¶
Returns the clear coat weight
- Return value:
The clear coat weight value 0-1.0, None if textured/connected
- Rtype value:
float
- setCoatColor(color)¶
Sets the clear coat color
- Parameters:
color (list(float)) – Clear coat color as rendering space float rgb (0.5, 1.0, 0.0)
- coatColor()¶
Returns the clear coat color
- Return color:
Clear coat color as rendering space float rgb (0.5, 1.0, 0.0), None if textured/connected
- Rtype color:
list(float)
- setCoatRoughness(value)¶
Sets the clear coat roughness value
- Parameters:
value (float) – The clear coat roughness value 0 -1.0
- coatRoughness()¶
Returns the clear coat roughness value
- Return value:
The clear coat roughness value 0 -1.0, None if textured/connected
- Rtype value:
float
- setCoatIOR(value)¶
Sets the clear coat IOR value
- Parameters:
value (float) – The clear coat IOR value, 1.0 - 20.0
- coatIOR()¶
Returns the clear coat IOR value
- Return value:
The clear coat IOR value, 1.0 - 20.0, None if textured/connected
- Rtype value:
float
- setEmission(color)¶
Sets the emission (self illumination) color
- Parameters:
color (list(float)) – Emission color as rendering space float rgb (0.5, 1.0, 0.0)
- emission()¶
Returns the emission (self illumination) color
- Return color:
Emission color as rendering space float rgb (0.5, 1.0, 0.0), None if textured/connected
- Rtype color:
list(float)
- setEmissionWeight(value)¶
Sets the emission weight value
- Parameters:
value (float) – Emission weight value, 1.0 and above
- emissionWeight()¶
Returns the emission weight value
- Return value:
Emission weight value, 1.0 and above, None if textured/connected
- Rtype value:
float
Rendermanpxrlayersurface¶
This module creates and manages a Renderman pxr layer shader.
This class is a subclass of shaderbase and inherits all functionality where applicable.
Example use:
from zoo.libs.maya.cmds.shaders.shadertypes import rendermanpxrlayersurface
shadInst = rendermanpxrlayersurface.PxrLayerMetalness("shaderName", create=True) # creates a new shader
shadInst.setDiffuse([0.0, 0.0, 1.0]) # sets diffuse color to blue
shadInst.setDiffuseWeight(1.0)
shadInst.setMetalness(1.0) # sets metalness to be on
shadInst.setSpecWeight(1.0)
shadInst.setSpecColor([1, 1, 1])
shadInst.setSpecRoughness(1.0)
shadInst.setSpecIOR(1.3)
shadInst.setCoatWeight(0.0)
shadInst.setCoatIOR(1.5)
shadInst.setCoatRoughness(.1)
shadInst.setCoatColor([1, 1, 1])
shadInst2 = rendermanpxrlayersurface.PxrLayerMetalness("rocketShader", ingest=True) # Loads existing "rocketShader" as instance
shadInst2.assignSelected()
shadInst2.setShaderName("newNameY")
print(shadInst.shaderName())
- class PxrLayerMetalness(shaderName='', node=None, genAttrDict=None, create=False, ingest=False, suffixName=False, message=True)¶
Bases:
ShaderBase
Manages the creation and set/get attribute values for the PXR layer shader supporting a hacked metalness input
- diffuseWeightAttr = ''¶
- diffuseColorAttr = ''¶
- diffuseRoughnessAttr = ''¶
- metalnessAttr = ''¶
- specularWeightAttr = ''¶
- specularColorAttr = ''¶
- specularRoughnessAttr = ''¶
- specularIorAttr = ''¶
- coatWeightAttr = ''¶
- coatcolorAttr = ''¶
- coatRoughnessAttr = ''¶
- coatIorAttr = ''¶
- emissionAttr = ''¶
- emissionWeightAttr = ''¶
- knownShader()¶
Returns True as this shader is supported by Zoo Tools
- renderer()¶
Returns the current renderer as a string
- createShader(shaderName='shader_PXR', genAttrDict=None, message=True)¶
Creates a pxrLayeredShader node network and loads the nodes as class variables
Overridden method.
- deleteShader()¶
Deletes the shader and all of it’s nodes
Overridden method.
- assign(objFaceList)¶
Assign the shader to a list of geometry or components.
- Parameters:
objFaceList (list(str)) – A list of objects or faces or both
- assignSelected()¶
Assign the shader to selected geo
- setFromDict(genAttrDict, apply=True, noneIsDefault=True)¶
Sets the shader with attribute values from a generic shader dictionary, keys are from shdmultconstants
- shaderValues()¶
Returns values of the shader attribute in a generic shader dictionary, keys are from shdmultconstants
- Return genAttrDict:
A dictionary of generic shader keys with values as per shdmultconstants
- Rtype genAttrDict:
dict(str)
- setShaderName(newName)¶
Renames the shader and all nodes in the network
Overridden method.
- Parameters:
newName (str) – The new name of the shader
- shaderName()¶
Returns the shader’s name as a string
- Return shaderName:
The shader’s name
- Rtype shaderName:
str
- setDiffuse(value)¶
Sets the diffuse color attr for both self.layer1Node and the metal node self.layer2Node
- Parameters:
value (list(float)) – The color as rendering space float color, (0.5, 1.0, 0.0)
- diffuse()¶
Returns the value of the diffuse color as rendering space float, (0.5, 1.0, 0.0)
- Return value:
The diffuse color as linear float rgb (0.1, 0.5, 1.0)
- Rtype value:
list(float)
- setDiffuseWeight(value)¶
Sets the diffuse weight, only on the layer1 node
- Parameters:
value (float) – The diffuse weight value 0.0-1.0
- diffuseWeight()¶
Returns the current diffuse weight
- Return value:
The diffuse weight value 0-1.0
- Rtype value:
float
- metalness()¶
Returns the metalness value
- Return value:
The metalness value 0-1.0
- Rtype value:
float
- setSpecWeight(value)¶
Sets the specular weight value
- Parameters:
value (float) – Specular Weight value 0-1.0
- specWeight()¶
Returns the specular weight value
- Return value:
Specular Weight value 0-1.0
- Rtype value:
float
- setSpecColor(value)¶
Sets the specular color as rendering space float rgb (0.5, 1.0, 0.0)
- Parameters:
value (list(float)) – Specular color as rendering space float rgb (0.5, 1.0, 0.0)
- specColor()¶
Returns the specular color as rendering space float rgb (0.5, 1.0, 0.0)
- Return value:
Specular color as rendering space float rgb (0.5, 1.0, 0.0)
- Rtype value:
list(float)
- setSpecRoughness(value)¶
Sets the specular roughness value
- Parameters:
value (float) – The specular roughness value 0-1.0
- specRoughness()¶
Returns the specular roughness value
- Return value:
The specular roughness value 0-1.0
- Rtype value:
float
- setSpecIOR(value)¶
Sets the specular IOR value 1 - 20.0
- Parameters:
value (float) – The specular IOR value, 1.0 - 20.0
- specIOR()¶
Sets the specular IOR value 1 - 20.0
- Return value:
The specular IOR value, 1.0 - 20.0
- Rtype value:
float
- setCoatColor(value)¶
Sets the clear coat color as rendering space float rgb (0.5, 1.0, 0.0)
- Parameters:
value (list(float)) – Clear coat color as rendering space float rgb (0.5, 1.0, 0.0)
- coatColor()¶
Returns the clear coat color as rendering space float rgb (0.5, 1.0, 0.0)
- Return value:
Clear coat color as rendering space float rgb (0.5, 1.0, 0.0)
- Rtype value:
list(float)
- setCoatWeight(value)¶
Sets the clear coat weight 0-1.0
- Parameters:
value (float) – The clear coat weight value 0-1.0
- coatWeight()¶
Returns the clear coat weight 0-1.0
- Return value:
The clear coat weight value 0-1.0
- Rtype value:
float
- setCoatRoughness(value)¶
Sets the clear coat roughness value 0 - 1.0
- Parameters:
value (float) – The clear coat roughness value 0 -1.0
- coatRoughness()¶
Returns the clear coat roughness value 0 - 1.0
- Return value:
The clear coat roughness value 0 -1.0
- Rtype value:
float
- setCoatIOR(value)¶
Sets the clear coat IOR value 1 - 20.0
- Parameters:
value (float) – The clear coat IOR value, 1.0 - 20.0
- coatIOR()¶
Returns the clear coat IOR value 1 - 20.0
- Return value:
The clear coat IOR value, 1.0 - 20.0
- Rtype value:
float
Rendermanpxrsurface¶
This module creates and manages a pxr surface shader.
This class is a subclass of shaderbase and inherits all functionality where applicable.
Example use:
from zoo.libs.maya.cmds.shaders.shadertypes import rendermanpxrsurface
shadInst = rendermanpxrsurface.PxrSurface("shaderName", create=True) # creates a new shader
shadInst.setDiffuse([0.0, 0.0, 1.0]) # sets diffuse color to blue
shadInst.setDiffuseWeight(1.0)
shadInst.setMetalness(1.0) # sets metalness to be on
shadInst.setSpecWeight(1.0)
shadInst.setSpecColor([1, 1, 1])
shadInst.setSpecRoughness(1.0)
shadInst.setSpecIOR(1.3)
shadInst.setCoatWeight(0.0)
shadInst.setCoatIOR(1.5)
shadInst.setCoatRoughness(.1)
shadInst.setCoatColor([1, 1, 1])
shadInst2 = rendermanshaders.PxrSurface("rocketShader", ingest=True) # Loads existing "rocketShader" as instance
shadInst2.assignSelected()
shadInst2.setShaderName("newNameY")
print(shadInst2.shaderName())
- class PxrSurface(shaderName='', node=None, genAttrDict=None, create=False, ingest=False, suffixName=False, message=True)¶
Bases:
ShaderBase
Manages the creation and set/get attribute values for the PxrSurface
- nodetype = 'PxrSurface'¶
- suffix = 'PXR'¶
- outColorAttr = 'outColor'¶
- diffuseWeightAttr = None¶
- diffuseColorAttr = 'diffuseColor'¶
- diffuseRoughnessAttr = 'diffuseRoughness'¶
- metalnessAttr = None¶
- specularWeightAttr = None¶
- specularColorAttr = 'specularEdgeColor'¶
- specularRoughnessAttr = 'specularRoughness'¶
- specularIorAttr = 'specularIor'¶
- coatWeightAttr = None¶
- coatcolorAttr = 'clearcoatEdgeColor'¶
- coatRoughnessAttr = 'clearcoatRoughness'¶
- coatIorAttr = 'clearcoatIor'¶
- emissionAttr = 'glowColor'¶
- emissionWeightAttr = 'glowGain'¶
- normalAttr = 'bumpNormal'¶
- bumpAttr = 'bumpNormal'¶
- knownShader()¶
Returns True as this shader is supported by Zoo Tools
- renderer()¶
Returns the current renderer as a string
- createShader(message=True)¶
Creates a PxrSurface node network and loads the nodes as class variables
Overridden method.
- Parameters:
message (bool) – Report a message to the user when the shader is created
- setDiffuse(color)¶
Sets the diffuse color
- Parameters:
color (list(float)) – The color as rendering space float color, (0.5, 1.0, 0.0)
- diffuse()¶
Returns the diffuse color
- Return color:
The diffuse color as linear float rgb (0.1, 0.5, 1.0), None if textured/connected
- Rtype color:
list(float)
- setDiffuseRoughness(value)¶
Sets the diffuse weight
- Parameters:
value (float) – The diffuse weight value 0.0-1.0
- diffuseRoughness()¶
Returns the current diffuse weight
- Return value:
The diffuse weight value 0-1.0, None if textured/connected
- Rtype value:
float
- setSpecColor(color)¶
Sets the specular color
- Parameters:
color (list(float)) – Specular color as rendering space float rgb (0.5, 1.0, 0.0)
- specColor()¶
Returns the specular color
- Return color:
Specular color as rendering space float rgb (0.5, 1.0, 0.0), None if textured/connected
- Rtype color:
list(float)
- setSpecRoughness(value)¶
Sets the specular roughness value
- Parameters:
value (float) – The specular roughness value 0-1.0
- specRoughness()¶
Returns the specular roughness value
- Return value:
The specular roughness value 0-1.0, None if textured/connected
- Rtype value:
float
- setSpecIOR(value)¶
Sets the specular IOR value
- Parameters:
value (float) – The specular IOR value, 1.0 - 20.0
- specIOR()¶
Sets the specular IOR
- Return value:
The specular IOR value, 1.0 - 20.0, None if textured/connected
- Rtype value:
float
- setCoatColor(color)¶
Sets the clear coat color
- Parameters:
color (list(float)) – Clear coat color as rendering space float rgb (0.5, 1.0, 0.0)
- coatColor()¶
Returns the clear coat color
- Return color:
Clear coat color as rendering space float rgb (0.5, 1.0, 0.0), None if textured/connected
- Rtype color:
list(float)
- setCoatRoughness(value)¶
Sets the clear coat roughness value
- Parameters:
value (float) – The clear coat roughness value 0 -1.0
- coatRoughness()¶
Returns the clear coat roughness value
- Return value:
The clear coat roughness value 0 -1.0, None if textured/connected
- Rtype value:
float
- setCoatIOR(value)¶
Sets the clear coat IOR value
- Parameters:
value (float) – The clear coat IOR value, 1.0 - 20.0
- coatIOR()¶
Returns the clear coat IOR value
Renderman stores IOR as a color, in our case we just apply the IOR to all color channels.
- Return value:
The clear coat IOR value, 1.0 - 20.0, None if textured/connected
- Rtype value:
float
- setEmission(color)¶
Sets the emission (self illumination) color
- Parameters:
color (list(float)) – Emission color as rendering space float rgb (0.5, 1.0, 0.0)
- emission()¶
Returns the emission (self illumination) color
- Return color:
Emission color as rendering space float rgb (0.5, 1.0, 0.0), None if textured/connected
- Rtype color:
list(float)
- setEmissionWeight(value)¶
Sets the emission weight value
- Parameters:
value (float) – Emission weight value, 1.0 and above
- emissionWeight()¶
Returns the emission weight value
- Return value:
Emission weight value, 1.0 and above, None if textured/connected
- Rtype value:
float
Shaderbase¶
This module is the base class that creates and manages a shader with generic inputs.
This class is intended to be extended/overidden by each shader type. Provides base functionality.
Example use overridden with mayastandardsurface:
from zoo.libs.maya.cmds.shaders.shadertypes import mayastandardsurface
shadInst = mayastandardsurface.StandardSurface("shaderName", create=True) # creates a new shader
shadInst.setDiffuse([0.0, 0.0, 1.0]) # sets diffuse color to blue
shadInst.setDiffuseWeight(1.0)
shadInst.setMetalness(1.0) # sets metalness to be on
shadInst.setSpecWeight(1.0)
shadInst.setSpecColor([1, 1, 1])
shadInst.setSpecRoughness(1.0)
shadInst.setSpecIOR(1.3)
shadInst.setCoatWeight(0.0)
shadInst.setCoatIOR(1.5)
shadInst.setCoatRoughness(.1)
shadInst.setCoatColor([1, 1, 1])
shadInst2 = mayastandardsurface.StandardSurface("rocketShader", ingest=True) # Loads existing "rocketShader" as instance
shadInst2.assignSelected()
shadInst2.setShaderName("newNameY")
print(shadInst2.shaderName())
# Textures
shadInst2.setDiffuseTexture("c:/somePath/aTexture.jpg", colorSpace="sRGB")
- class ShaderBase(shaderName='', node=None, genAttrDict=None, create=False, ingest=False, suffixName=False, message=True)¶
Bases:
NodeMultiBase
Main class that manages the creation setting and getting of attrs for a shader with generic inputs
- nodetype = ''¶
- suffix = ''¶
- outColorAttr = ''¶
- diffuseWeightAttr = ''¶
- diffuseColorAttr = ''¶
- diffuseRoughnessAttr = ''¶
- metalnessAttr = ''¶
- specularWeightAttr = ''¶
- specularColorAttr = ''¶
- specularRoughnessAttr = ''¶
- specularIorAttr = ''¶
- coatWeightAttr = ''¶
- coatcolorAttr = ''¶
- coatRoughnessAttr = ''¶
- coatIorAttr = ''¶
- emissionAttr = ''¶
- emissionWeightAttr = ''¶
- normalAttr = ''¶
- bumpAttr = ''¶
- exists()¶
Tests to see if the shader connected to the instance exists
- Returns:
True if the shader exists in the scene, False if not.
- Return type:
- shaderType()¶
Returns the type of the shader node. Must have been created
- Returns:
The type of the current shader, must be alive. Eg. “standardSurface”
- Return type:
- knownShader()¶
Returns True if the shader is supported by Zoo Tools, should be overridden
- Returns:
Returns True if the shader is supported by Zoo Tools, should be overridden
- Return type:
- renderer()¶
Returns the current renderer as a string. Should be overridden.
- Returns:
Returns the current renderer as a string, will be “” if the renderer unknown.
- Return type:
- attributeNames()¶
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:
- unsupportedAttributes()¶
Returns the generic attribute keys that are not supported by this shader.
- Returns:
A list of generic attributes that are not supported by this shader.
- Return type:
list(str)
- supportedAttributes()¶
Returns the generic attribute keys that are supported by this shader.
- Returns:
A list of generic attributes that are supported by this shader.
- Return type:
list(str)
- setDefaults(apply=False)¶
Sets the shader to default values 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.
- applyCurrentSettings()¶
Applies the current class variables and sets them on the shader.
- pullShaderSettings()¶
Pulls the current attribute values from the current shader. The shader must exist.
- setAttrColor(attributeName, color)¶
Sets a color attribute, returns None if textured or unusable.
- setAttrScalar(attributeName, value)¶
Sets a scalar single value attribute, returns None if textured/connected.
- getAttrColor(attributeName)¶
Gets the color of an attribute, returns None if textured/connected.
- getAttrScalar(attributeName)¶
Gets the value of an float or int attribute
- attrSettable(attributeName)¶
Tests if the attribute name is settable, if False it’s textured or locked.
- Parameters:
attributeName (str) – The maya attribute name
- Return settable:
True and the attribute is settable, False and the attribute is locked or textured
- Rtype settable:
str
- attrDisconnectTexture(attributeName)¶
Disconnects a texture. Should be overridden.
- Parameters:
attributeName (str) – The name of an attribute to disconnect.
- createShader(message=True)¶
Creates the shader. Should be overridden.
- Parameters:
message (bool) – Report a message to the user?
- deleteShader()¶
Deletes the shader.
Should be overridden if multiple nodes in the shader need to be deleted.
- assign(objFaceList, message=False)¶
Assigns the current shader to an object list.
- assignSelected(message=False)¶
Assign the shader to the current selection.
- selectShader(message=True)¶
Selects the current shader inside Maya, can be viewed in the Attribute Editor.
- Parameters:
message (bool) – Report a message to the user?
- setFromDict(genAttrDict, apply=True, noneIsDefault=True, colorsAreSrgb=False)¶
Sets the shader from a generic attribute dictionary. Values as attribute values.
Colors are linear by default, use the colorsAreSrgb flag if SRGB.
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
colorsAreSrgb (bool) – Set to True if the incoming colors are SRGB such as from a UI.
- shaderValues(removeNone=False, convertToDisplay=False)¶
Returns values of the shader attribute in a generic shader dictionary, keys are from shdmultconstants
Color values are all as rendering space color.
- convertDictSrgb(genAttrDict)¶
Converts a shader value dictionary from linear to srgb colors.
- convertDictLinear(genAttrDict)¶
Converts a shader value dictionary from srgb to linear colors
- convertDictRendering(genAttrDict)¶
Converts a shader value dictionary from rendering color to display space colors
- convertDictDisplay(genAttrDict)¶
Converts a shader value dictionary from display color to rendering space colors
- addSuffix()¶
Adds the automatic suffix of the renderer eg _STRD to the shaders name, suffixes are per shaderType
- Return renamed:
True if the name was changed, False if not.
- Rtype renamed:
bool
- removeSuffix()¶
Removes the auto suffix on a shader name:
shader_01_ARN if not unique becomes shader_01
- Return shaderName:
The potentially changed shader name
- Rtype shaderName:
str
- setShaderName(newName, uniqueNumberSuffix=True, addSuffix=True)¶
Renames the shader, auto handles suffixing with the shader type and unique names:
shader_01_ARN if not unique becomes shader_02_ARN
- Parameters:
newName (ste) – The name to rename the current shader
uniqueNumberSuffix – shader_01_ARN if not unique becomes shader_02_ARN or next unique name
addSuffix –
- Returns:
The new name of the shader
- Return type:
- shaderName()¶
Returns and updates the shader’s name.
- Returns:
The name of the current shader
- Return type:
- shaderNameNoSuffix()¶
Returns and updates the shader’s name with the type suffix removed if exists:
“shaderName_PXR” becomes “shaderName” “shaderX” is ignored as not shaderType match so “shaderX”
- Returns:
The name of the current shader without it’s type suffix
- Return type:
- srgbColor(linearColor)¶
Converts linear color to SRGB and handles potential None values.
returns: SRGB Color float eg [0.0, 0.5, 1.0]
- displayColor(renderingColor)¶
Converts the rendering space color (Maya’s default color) to the display space color.
- Parameters:
renderingColor (list(float)) – Maya’s default color space for the current mode. Float color
- Return displayColor:
The color converted to display space usually srgb. Float color
- Rtype displayColor:
list(float)
- setDiffuse(value)¶
Sets the diffuse color as rendering space color space.
Should be overridden.
- Parameters:
value (list(float)) – Float color as rendering space space (0.5, 1.0, 0.0)
- setDiffuseSrgb(value)¶
Sets the diffuse color with srgb color space, converts to linear.
Color space is handled as rendering space space by default inside the class.
- Parameters:
value (list(float)) – Float color in srgb space (0.5, 1.0, 0.0) will be converted to linear color
- setDiffuseDisplay(value)¶
Sets the diffuse color with the display color space, converts to rendering space.
Maya 2023 and above otherwise will take the color as linear and set as srgb
- Parameters:
value (list(float)) – Float color in display space (0.5, 1.0, 0.0) will be converted to rendering space
- diffuse()¶
Returns the diffuse color in float linear color space or None if ignored.
Should be overridden
- Parameters:
value (list(float)) – Diffuse color as rendering space space (0.5, 1.0, 0.0). None if not found.
- diffuseSrgb()¶
Returns the diffuse color in float srgb color space or None if ignored.
- Returns:
Float color in srgb space (0.5, 1.0, 0.0) or None if ignored
- Return type:
list(float)
- diffuseDisplay()¶
Returns the diffuse color in display space usually srgb or None if ignored.
Maya 2023 and above otherwise will convert linear to srgb
- Returns:
Float color in monitor display space (0.5, 1.0, 0.0) or None if ignored
- Return type:
list(float)
- setDiffuseWeight(value)¶
Sets the diffuse weight.
Should be overridden.
- Parameters:
value (float) – The numeric value of the diffuse weight.
- diffuseWeight()¶
Returns the diffuse weight value or None if ignored.
Should be overridden.
- Returns:
The Diffuse weight value, None if not found.
- Return type:
- setDiffuseRoughness(value)¶
Sets the diffuse roughness value.
Should be overridden.
- Parameters:
value (float) – The numeric value of the diffuse roughness.
- diffuseRoughness()¶
Returns the diffuse roughness value or None if ignored.
Should be overridden.
- Returns:
The Diffuse weight value, None if not found.
- Return type:
- setMetalness(value)¶
Sets the metalness value.
Should be overridden.
- Parameters:
value (float) – The numeric value of the metalness.
- metalness()¶
Returns the metalness value or None if ignored.
Should be overridden.
- Returns:
The Diffuse weight value, None if not found.
- Return type:
- setSpecWeight(value)¶
Sets the specular weight value.
Should be overridden.
- Parameters:
value (float) – The numeric value of the specular weight.
- specWeight()¶
Returns the specular weight value or None if ignored.
Should be overridden.
- Returns:
The specular weight weight value, None if not found.
- Return type:
- setSpecColor(value)¶
Returns the specular color in float linear color space or None if ignored.
- Returns:
Float color as rendering space space (0.5, 1.0, 0.0) or None if ignored
- Return type:
list(float)
- setSpecColorSrgb(value)¶
Sets the spec color with srgb color space, converts to linear.
Color space is handled as rendering space space by default inside the class.
- Parameters:
value (list(float)) – Float color in srgb space (0.5, 1.0, 0.0) will be converted to linear color.
- setSpecColorDisplay(value)¶
Sets the specular color with the display color space, converts to rendering space.
Maya 2023 and above otherwise will take the color as linear and set as srgb
- Parameters:
value (list(float)) – Float color in display space (0.5, 1.0, 0.0) will be converted to rendering space
- specColor()¶
Sets the specular color as rendering space color space.
Should be overridden.
- Parameters:
value (list(float)) – Float color as rendering space space (0.5, 1.0, 0.0)
- specColorSrgb()¶
Returns the specular color in float srgb color space or None if ignored.
- Return srgbColor:
Float color in srgb space (0.5, 1.0, 0.0) or None if ignored
- Rtype srgbColor:
list(float)
- specColorDisplay()¶
Returns the diffuse color in monitor display space usually srgb or None if ignored.
Maya 2023 and above otherwise will convert linear to srgb
- Returns:
Float color in display space (0.5, 1.0, 0.0) or None if ignored
- Return type:
list(float)
- setSpecRoughness(value)¶
Sets the specular roughness value.
Should be overridden.
- Parameters:
value (float) – The numeric value of the specular roughness.
- specRoughness()¶
Returns the specular roughness value or None if ignored.
Should be overridden.
- Returns:
The specular roughness weight value, None if not found.
- Return type:
- setSpecIOR(value)¶
Sets the specular IOR value.
Should be overridden.
- Parameters:
value (float) – The numeric value of the specular IOR.
- specIOR()¶
Returns the specular IOR value or None if ignored.
Should be overridden.
- Returns:
The specular weight value, None if not found.
- Return type:
- setCoatColor(value)¶
Returns the clear coat color in float linear color space or None if ignored.
- Returns:
Float color as rendering space space (0.5, 1.0, 0.0) or None if ignored
- Return type:
list(float)
- setCoatColorSrgb(value)¶
Sets the coat color with srgb color space, converts to linear. Color space is handled as rendering space space by default inside the class.
- Parameters:
value (list(float)) – Float color in srgb space (0.5, 1.0, 0.0) will be converted to linear color
- setCoatColorDisplay(value)¶
Sets the coat color with the display color space, converts to rendering space.
Maya 2023 and above otherwise will take the color as linear and set as srgb
- Parameters:
value (list(float)) – Float color in display space (0.5, 1.0, 0.0) will be converted to rendering space
- coatColor()¶
Sets the specular coat color as rendering space color space.
Should be overridden.
- Parameters:
value (list(float)) – Float color as rendering space space (0.5, 1.0, 0.0)
- coatColorSrgb()¶
Returns the coat color in float srgb color space or None if ignored.
- Return srgbColor:
Float color in srgb space (0.5, 1.0, 0.0) or None if ignored
- Rtype srgbColor:
list(float)
- coatColorDisplay()¶
Returns the coat color in monitor display space usually srgb or None if ignored.
Maya 2023 and above otherwise will convert linear to srgb
- Returns:
Float color in display space (0.5, 1.0, 0.0) or None if ignored
- Return type:
list(float)
- setCoatWeight(value)¶
Sets the clear coat weight value.
Should be overridden.
- Parameters:
value (float) – The numeric value of the clear coat weight.
- coatWeight()¶
Returns the clear coat weight value or None if ignored.
Should be overridden.
- Returns:
The clear coat weight value, None if not found.
- Return type:
- setCoatRoughness(value)¶
Sets the clear coat roughness value.
Should be overridden.
- Parameters:
value (float) – The numeric value of the clear coat roughness.
- coatRoughness()¶
Returns the clear coat roughness value or None if ignored.
Should be overridden.
- Returns:
The clear coat roughness weight value, None if not found.
- Return type:
- setCoatIOR(value)¶
Sets the clear coat IOR value.
Should be overridden.
- Parameters:
value (float) – The numeric value of the clear coat IOR.
- coatIOR()¶
Returns the clear coat IOR value or None if ignored.
Should be overridden.
- Returns:
The clear coat IOR weight value, None if not found.
- Return type:
- setEmission(value)¶
Returns the emission color in float linear color space or None if ignored.
- Returns:
Float color as rendering space space (0.5, 1.0, 0.0) or None if ignored
- Return type:
list(float)
- setEmissionSrgb(value)¶
Sets the emission color with srgb color space, converts to linear.
Color space is handled as rendering space space by default inside the class.
- Parameters:
value (list(float)) – Float color in srgb space (0.5, 1.0, 0.0) will be converted to linear color
- setEmissionDisplay(value)¶
Sets the emission color with the display color space, converts to rendering space.
Maya 2023 and above otherwise will take the color as linear and set as srgb
- Parameters:
value (list(float)) – Float color in display space (0.5, 1.0, 0.0) will be converted to rendering space
- emission()¶
Returns the emission color in rendering color space.
Should be overridden.
- Parameters:
value (list(float)) – Float color as rendering space space (0.5, 1.0, 0.0)
- emissionSrgb()¶
Returns the emission color in float srgb color space.
- Return srgbColor:
Float color in srgb space (0.5, 1.0, 0.0) or None if ignored
- Rtype srgbColor:
list(float)
- emissionDisplay()¶
Returns the coat color in monitor display space usually srgb or None if ignored.
Maya 2023 and above otherwise will convert linear to srgb
- Returns:
Float color in display space (0.5, 1.0, 0.0) or None if ignored
- Return type:
list(float)
- setEmissionWeight(value)¶
Sets the emission weight value.
Should be overridden.
- Parameters:
value (float) – The numeric value of the emission weight.
- emissionWeight()¶
Returns the emission weight value or None if ignored.
Should be overridden.
- Returns:
The Diffuse weight value, None if not found.
- Return type:
- outNodeAttr(outType='color')¶
- outAttrColor()¶
- inNodeAttr(inType='gDiffuseColor_srgb')¶
- inAttrDiffuseWeight()¶
- inAttrDiffuseColor()¶
- inAttrDiffuseRoughness()¶
- inAttrMetalness()¶
- inAttrSpecularWeight()¶
- inAttrSpecularColor()¶
- inAttrSpecularRoughness()¶
- inAttrSpecularIorAttr()¶
- inAttrCoatWeight()¶
- inAttrCoatcolor()¶
- inAttrCoatRoughness()¶
- inAttrCoatIor()¶
- inAttrEmission()¶
- inAttrEmissionWeight()¶
- inAttrNormal()¶
- inAttrBump()¶
- 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)
- connectedAttrList()¶
Returns a list of connected attribute names.
Should be overridden.
- Returns:
A list of connected attribute names
- Return type:
list(str)
- connectAttrs(connectionDict, message=False)¶
Connects generic attributes to node.attribute values given in a connectionDict:
connectionDict: generic attributes as the keys and “node.attr” as connection values
- setDiffuseTexture(path, colorSpace='sRGB')¶
Creates/sets the texture nodes path for diffuse.
- setSpecColorTexture(path, colorSpace='sRGB')¶
Creates/sets the texture nodes path for specular color.
- setCoatColorTexture(path, colorSpace='sRGB')¶
Creates/sets the texture nodes path for clear coat color.
- setEmissionColorTexture(path, colorSpace='sRGB')¶
Creates/sets the texture nodes path for emission color.
- setDiffuseWeightTexture(path, colorSpace='Raw')¶
Creates/sets the texture nodes path for diffuse weight.
- setDiffuseRoughnessTexture(path, colorSpace='Raw')¶
Creates/sets the texture nodes path for diffuse roughness.
- setMetalnessTexture(path, colorSpace='Raw')¶
Creates/sets the texture nodes path for metalness.
- setSpecWeightTexture(path, colorSpace='Raw')¶
Creates/sets the texture nodes path for specular weight.
- setSpecRoughnessTexture(path, colorSpace='Raw')¶
Creates/sets the texture nodes path for specular roughness.
- setSpecIORTexture(path, colorSpace='Raw')¶
Creates/sets the texture nodes path for specular IOR.
- setCoatWeightTexture(path, colorSpace='Raw')¶
Creates/sets the texture nodes path for clear coat weight.
- setCoatRoughTexture(path, colorSpace='Raw')¶
Creates/sets the texture nodes path for clear coat roughness.
- setCoatIORTexture(path, colorSpace='Raw')¶
Creates/sets the texture nodes path for clear coat IOR.
- setEmissionWeightTexture(path, colorSpace='Raw')¶
Creates/sets the texture nodes path for emission weight.
Vraymtl¶
This module creates and manages a VrayMtl shader.
This class is a subclass of shaderbase and inherits all functionality where applicable.
Example use:
from zoo.libs.maya.cmds.shaders.shadertypes import vraymtl
shadInst = vraymtl.VRayMtl("shaderName", create=True) # creates a new shader
shadInst.setDiffuse([0.0, 0.0, 1.0]) # sets diffuse color to blue
shadInst.setDiffuseWeight(1.0)
shadInst.setMetalness(1.0) # sets metalness to be on
shadInst.setSpecWeight(1.0)
shadInst.setSpecColor([1, 1, 1])
shadInst.setSpecRoughness(1.0)
shadInst.setSpecIOR(1.3)
shadInst.setCoatWeight(0.0)
shadInst.setCoatIOR(1.5)
shadInst.setCoatRoughness(.1)
shadInst.setCoatColor([1, 1, 1])
shadInst2 = vraymtl.VRayMtl("rocketShader", ingest=True) # Loads existing "rocketShader" as instance
shadInst2.assignSelected()
shadInst2.setShaderName("newNameY")
print(shadInst2.shaderName())
- class VRayMtl(shaderName='', node=None, genAttrDict=None, create=False, ingest=False, suffixName=False, message=True)¶
Bases:
ShaderBase
Manages the creation and set/get attribute values for the aiStandardSurface
- nodetype = 'VRayMtl'¶
- suffix = 'VRAY'¶
- outColorAttr = 'outColor'¶
- diffuseWeightAttr = 'diffuseColorAmount'¶
- diffuseColorAttr = 'color'¶
- diffuseRoughnessAttr = 'roughnessAmount'¶
- metalnessAttr = 'metalness'¶
- specularWeightAttr = 'reflectionColorAmount'¶
- specularColorAttr = 'reflectionColor'¶
- specularRoughnessAttr = 'reflectionGlossiness'¶
- specularIorAttr = 'fresnelIOR'¶
- coatWeightAttr = 'coatColorAmount'¶
- coatcolorAttr = 'coatColor'¶
- coatRoughnessAttr = 'coatGlossiness'¶
- coatIorAttr = 'coatIOR'¶
- emissionAttr = 'illumColor'¶
- emissionWeightAttr = ''¶
- normalAttr = 'bumpMap'¶
- bumpAttr = 'bumpMap'¶
- knownShader()¶
Returns True as this shader is supported by Zoo Tools
- renderer()¶
Returns the current renderer as a string
- createShader(message=True)¶
Creates a VrayMtl and loads the nodes as class variables
Overridden method.
- Parameters:
message (bool) – Report a message to the user when the shader is created
- setDiffuseWeight(value)¶
Sets the diffuse weight.
- Parameters:
value (float) – The diffuse weight value 0.0-1.0
- diffuseWeight()¶
Returns the current diffuse weight
- Return value:
The diffuse weight value 0-1.0, None if textured/connected
- Rtype value:
float
- setDiffuse(color)¶
Sets the diffuse color
- Parameters:
color (list(float)) – The color as rendering space float color, (0.5, 1.0, 0.0)
- diffuse()¶
Returns the diffuse color
- Return value:
The diffuse color as linear float rgb (0.1, 0.5, 1.0), None if textured/connected
- Rtype value:
list(float)
- setDiffuseRoughness(value)¶
Sets the diffuse weight
- Parameters:
value (float) – The diffuse weight value 0.0-1.0
- diffuseRoughness()¶
Returns the current diffuse weight
- Return value:
The diffuse weight value 0-1.0, None if textured/connected
- Rtype value:
float
- metalness()¶
Returns the metalness value
- Return value:
The metalness value 0-1.0, None if textured/connected
- Rtype value:
float
- setSpecWeight(value)¶
Sets the specular weight value
- Parameters:
value (float) – Specular Weight value 0-1.0
- specWeight()¶
Returns the specular weight value
- Return value:
Specular Weight value 0-1.0, None if textured/connected
- Rtype value:
float
- setSpecColor(color)¶
Sets the specular color
- Parameters:
color (list(float)) – Specular color as rendering space float rgb (0.5, 1.0, 0.0)
- specColor()¶
Returns the specular color
- Return color:
Specular color as rendering space float rgb (0.5, 1.0, 0.0), None if textured/connected
- Rtype color:
list(float)
- setSpecRoughness(value)¶
Sets the specular roughness value
- Parameters:
value (float) – The specular roughness value 0-1.0
- specRoughness()¶
Returns the specular roughness value
- Return value:
The specular roughness value 0-1.0, None if textured/connected
- Rtype value:
float
- setSpecIOR(value)¶
Sets the specular IOR value
- Parameters:
value (float) – The specular IOR value, 1.0 - 20.0
- specIOR()¶
Sets the specular IOR
- Return value:
The specular IOR value, 1.0 - 20.0, None if textured/connected
- Rtype value:
float
- setCoatWeight(value)¶
Sets the clear coat weight
- Parameters:
value (float) – The clear coat weight value 0-1.0
- coatWeight()¶
Returns the clear coat weight
- Return value:
The clear coat weight value 0-1.0, None if textured/connected
- Rtype value:
float
- setCoatColor(color)¶
Sets the clear coat color
- Parameters:
color (list(float)) – Clear coat color as rendering space float rgb (0.5, 1.0, 0.0)
- coatColor()¶
Returns the clear coat color
- Return color:
Clear coat color as rendering space float rgb (0.5, 1.0, 0.0), None if textured/connected
- Rtype color:
list(float)
- setCoatRoughness(value)¶
Sets the clear coat roughness value
- Parameters:
value (float) – The clear coat roughness value 0 -1.0
- coatRoughness()¶
Returns the clear coat roughness value
- Return value:
The clear coat roughness value 0 -1.0, None if textured/connected
- Rtype value:
float
- setCoatIOR(value)¶
Sets the clear coat IOR value
- Parameters:
value (float) – The clear coat IOR value, 1.0 - 20.0
- coatIOR()¶
Returns the clear coat IOR value
- Return value:
The clear coat IOR value, 1.0 - 20.0, None if textured/connected
- Rtype value:
float
- setEmission(color)¶
Sets the emission (self illumination) color
- Parameters:
color (list(float)) – Emission color as rendering space float rgb (0.5, 1.0, 0.0)
- emission()¶
Returns the emission (self illumination) color
- Return color:
Emission color as rendering space float rgb (0.5, 1.0, 0.0), None if textured/connected
- Rtype color:
list(float)