Textures¶
- Filetexturebase
FileTextureBase
FileTextureBase.outputAttr
FileTextureBase.initName()
FileTextureBase.connectedAttr()
FileTextureBase.valid()
FileTextureBase.exists()
FileTextureBase.ingest()
FileTextureBase.create()
FileTextureBase.delete()
FileTextureBase.setFromDict()
FileTextureBase.applyCurrentSettings()
FileTextureBase.renderer()
FileTextureBase.textureType()
FileTextureBase.setName()
FileTextureBase.name()
FileTextureBase.setPath()
FileTextureBase.path()
FileTextureBase.setColorSpace()
FileTextureBase.colorSpace()
FileTextureBase.setPlaceType()
FileTextureBase.placeType()
FileTextureBase.setRepeatUV()
FileTextureBase.repeatUV()
FileTextureBase.setOffsetUV()
FileTextureBase.offsetUV()
FileTextureBase.setRotateUV()
FileTextureBase.rotateUV()
FileTextureBase.setScale3d()
FileTextureBase.scale3d()
- Mayafiletexture
MayaFileTexture
MayaFileTexture.inputAttr
MayaFileTexture.outputAttr
MayaFileTexture.outputScalarAttr
MayaFileTexture.textureNodeType
MayaFileTexture.valid()
MayaFileTexture.exists()
MayaFileTexture.ingest()
MayaFileTexture.create()
MayaFileTexture.delete()
MayaFileTexture.renderer()
MayaFileTexture.setName()
MayaFileTexture.rename()
MayaFileTexture.name()
MayaFileTexture.setPath()
MayaFileTexture.path()
MayaFileTexture.setColorSpace()
MayaFileTexture.colorSpace()
MayaFileTexture.setPlaceType()
MayaFileTexture.placeType()
MayaFileTexture.setRepeatUV()
MayaFileTexture.repeatUV()
MayaFileTexture.setOffsetUV()
MayaFileTexture.offsetUV()
MayaFileTexture.setRotateUV()
MayaFileTexture.rotateUV()
MayaFileTexture.setScale3d()
MayaFileTexture.scale3d()
- Normalbase
NormalBase
NormalBase.outputNormalAttr
NormalBase.outputTextureAttr
NormalBase.nodeType
NormalBase.strengthAttr
NormalBase.normalTypeAttr
NormalBase.normalSpaceAttr
NormalBase.texture_attr
NormalBase.rendererStr
NormalBase.createNormalNetwork()
NormalBase.setBumpNormal()
NormalBase.delete()
NormalBase.renderer()
NormalBase.setFromDict()
NormalBase.applyCurrentSettings()
NormalBase.outAttr()
NormalBase.connectOut()
NormalBase.disconnectOut()
NormalBase.setStrength()
NormalBase.strength()
NormalBase.setNormalTypeSpace()
NormalBase.normalTypeSpace()
NormalBase.setTextureName()
NormalBase.textureName()
NormalBase.setColorSpace()
NormalBase.colorSpace()
NormalBase.setPath()
NormalBase.path()
NormalBase.setPlaceType()
NormalBase.placeType()
NormalBase.setRepeatUV()
NormalBase.repeatUV()
NormalBase.setOffsetUV()
NormalBase.offsetUV()
NormalBase.setRotateUV()
NormalBase.rotateUV()
NormalBase.setScale3d()
NormalBase.scale3d()
NormalBase.setUdim()
NormalBase.udim()
textures¶
- createFileTexture(name='file', colorSpace='sRGB', imagePath='', ignoreColorSpace=False)¶
creates a file (texture) node with the place2dTextureNode and all connections
- Parameters:
name (str) – The name of the file node, the place2dTextureNode is suffixed with “_place3dTex”
colorSpace (str) – the default color space of the file node “sRGB”, “Raw” etc
imagePath (str) – the optional image path for the texture, not yet connected
ignoreColorSpace (bool) – Ignores colour space warning, useful for Raw which always complains if using tif ect.
- Return fileNode:
the name of the created file node
- Rtype fileNode:
str
- Return place2dTextureNode:
the name of the created place2dTextureNode
- Rtype place2dTextureNode:
str
- getTextureFileAttributeName(nodeType)¶
returns the attribute name for setting the file texture path of the given nodeType Searches through all supported shaders in a dict and returns the corresponding attribute
- getTexureNodeType(node)¶
Returns the texture node type, will be None if it’s not a recognised texture node
- Parameters:
node (str) – a maya node name
- Returns:
the type of texture node, or None if it’s not a legimate texture node
- Return type:
- getTexturePathCheckNode(textureNode)¶
Gets the texture path from a given texture node. Checks if the node type is a correct texture node Supports texture nodes from TEXTURENODEDICT If the node is not legitimate return None, note a legitimate return is an empty string
- Parameters:
textureNode (str) – maya node name, should be a texture node recognised by the dict TEXTURENODEDICT
- Return filePath:
the full filepath from the texture
- Rtype filePath:
str
- getFileTextureNameFromAttr(nodeName, attributeName)¶
Finds the texturePath of a texture node from a given attribute ie “file1.color” Is compatible with texture nodes in TEXTURENODEDICT Checks the node type to be a legitimate texture
- setTexturePath(textureNode, nodeType, texturePath)¶
If the textureNode and nodeType is known set the texturePath Works on any supported texture
- setTexturePathCheckNode(textureNode, texturePath)¶
Smart function that checks the node and assigns a texture file path to the node. Returns None if no legit nodes found
- setFileTextureFromAttr(nodeName, attributeName, texturePath)¶
From a given current node and current node attribute ie plasticShader.color, find a connected texture node and set a new texture file path on disk.
- buildConnectTextureNodeAttribute(nodeName, nodeAttribute, textureNodeName='fileText', nodeType='file', texturePath=None, colorSpace='sRGB', asAlpha=False)¶
Builds a texture node and connects from the given nodeName and nodeAttribute eg plasticShader.color > new created texture node Can assign a texture path Node types can be any supported nodes from TEXTURENODES list Texture can be multiple channels (color) asAlpha=False or single channel asAlpha=True (scalar)
- Parameters:
nodeName (str) – current maya node’s name, this node will connect to the new texture node
nodeAttribute (str) – attribute of the current maya node to connect to the new texture
textureNodeName (str) – the name of the texture node to be created
nodeType (str) – the type of node to be created, eg “file”
texturePath (str) – the disk texture path of the texture to be assigned, None if none.
colorSpace (str) – the color space of the texture “sRGB” linear etc.
asAlpha (bool) – if True then connect as a single channel not as color (multiple channels)
- Return createNodes:
the created node list
- Return type:
list
- setOrCreateFileTexturePath(nodeName, attributeName, texturePath, textureNodeName='fileText', nodeType='file', colorSpace='sRGB', asAlpha=False)¶
Sets the texture file path from a given node.attribute, usually a shader eg. shader plasticShader.color This function finds the connected texture node, if it’s supported sets the texture If no texture node is found. The function creates a texture node of the given type and sets the texture path returns a warning (if True could not set the connected node) and created nodes if nodes were created Node types can be any supported nodes from TEXTURENODES list Texture can be multiple channels (color) asAlpha=False or single channel asAlpha=True (scalar)
- Parameters:
nodeName (str) – current maya node’s name, this node will connect to the new texture node
attributeName (str) – attribute of the current maya node to connect to the new texture
texturePath (str) – the disk texture path of the texture to be assigned, None if none.
textureNodeName (str) – the name of the texture node to be created
nodeType (str) – If a texture needs to be created this is the type of texture node to create
colorSpace (str) – the color space of the texture “sRGB” “Raw” etc.
asAlpha (bool) – if True then connect as a single channel not as color (multiple channels)
- Return warning:
a warning, if True something is connected but it’s not a fileTexture
- Rtype warning:
bool
- Return createdNodes:
the created nodes as a list if any were created
- Rtype createdNodes:
list