Normalbase

This module is the base class for normal and bump map creation.

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

A single normal or bump map will have these properties:

  • NormalBump type (normal or bump map)

  • NormalSpace (tangent or object etc)

  • Texture file path

  • Strength (strength of the bump)

  • Out Connection

  • Color space

  • 2d texture properties

    • repeat UV

    • Offset UV

    • Rotate UV

    • Scale 3d (triplanar and 3d placement)

A normal/bump object can be connected to a mixNormal object (built later)

For example two bump maps and a normal map can be used at once.

class NormalBase(normalName='', normalType='normal', genAttrDict=None, node=None, create=False, ingest=False, message=True)

Bases: NodeMultiBase

Main class that manages a single normal or bump map

outputNormalAttr = 'outNormal'
outputTextureAttr = 'outAlpha'
nodeType = ''
strengthAttr = ''
normalTypeAttr = ''
normalSpaceAttr = ''
texture_attr = ''
rendererStr = ''
createNormalNetwork(normalType='normal', normalName='', message=True)

Creates a texture and place2d node controls via self.textureInst and adds a bump2d node for the normals.

Can be overridden. Expects a bump node with an input and a Maya file texture setup with a “file” texture node.

Supports:
  • Maya

  • Redshift

Parameters:
  • normalType (str) – “bump” or “normal” the mode of the normal map.

  • normalName (str) – Part of the name that will be named on all nodes, “nrml” by default

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

Returns:

texture instance object and the bump2d node as a zapi object

Return type:

tuple

setBumpNormal(normalType, normalSpace='tangent')

Sets the node to be a normal or a bump map. Can be overridden.

Supports:
  • Maya

  • Redshift

Parameters:
  • normalType (str) – specify “normal” or “bump” map

  • normalSpace (str) – For normal space define the normalSpace, “tangent”, “object”

delete()

Deletes the texture, placement and bump/normal nodes. Can be overridden.

Supports:
  • Maya

  • Redshift

renderer()

Returns the current renderer as a string.

Return renderer:

“Arnold”, “Maya” “Redshift” etc.

Rtype renderer:

str

setFromDict(genAttrDict, apply=False)

Sets the normal network from the generic attribute dictionary.

Parameters:
  • genAttrDict

  • apply

applyCurrentSettings()

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

outAttr()

The name of the out attribute that plugs into a shader or layered texture

Return outputNormalAttr:

The name of the out attribute that plugs into a shader or layered texture

Rtype outputNormalAttr:

str

connectOut(inInst, inType='normal', outType='normal')
disconnectOut(outType='vector')
setStrength(value)

Sets the multiplier strength of the normal effect/depth. Can be overridden.

Supports:
  • Maya

  • Redshift

Parameters:

value (float) – The value of the strength depth effect

strength()

Gets the multiplier strength of the normal effect/depth. Can be overridden.

Supports:
  • Maya

  • Redshift

Return strength:

The value of the strength depth effect

Rtype strength:

float

setNormalTypeSpace(normalType='normal', normalSpace='tangent')

Sets normalType (normal/bump) and normalSpace (tangent/object). Can be overridden.

If bump the normalSpace is ignored.

Supports:
  • Maya

  • Redshift

Parameters:
  • normalType (str) – Either “normal” or “bump” depending which mode is desired

  • normalSpace (str) – The space of the normal effect, ignored if bump. “tangent” or “object”

normalTypeSpace()

Returns the multiplier strength of the normal effect/depth. Can be overridden.

Supports:
  • Maya

  • Redshift

Returns:

normalType (bump or normal) and normalSpace (tangent or object)

Return type:

tuple

setTextureName(name)
textureName()
setColorSpace(colorSpace)
colorSpace()
setPath(path)
path()
setPlaceType(placeType)
placeType()
setRepeatUV(repeatUV)
repeatUV()
setOffsetUV(offsetUV)
offsetUV()
setRotateUV(offsetUV)
rotateUV()
setScale3d(scale3d)
scale3d()
setUdim(style='mudbox')
udim()