MaxwellMayaDisplacement class

Description

This class allows you to control the displacement feature (see here for details on how displacement works in Maxwell). Each material layer can have a displacement component, but only one can be active at a given time. The MaxwellMayaMaterialAttrs class allows you to specify which layer contains the active displacement.

Texturable attributes: map (AttrType_Double, but the value is ignored).

Base class: MaxwellMayaMaterialComponent.

Methods

voidDestroy()
voidSetDisplacementType(DisplacementType type)
DisplacementTypeGetDisplacementType() const
voidSetSubdivisionParams(double level, bool adaptiveLevel, bool smoothing)
voidGetSubdivisionParams(double& level, bool& adaptiveLevel, bool& smoothing) const
voidSetHeightmapParams(double offset, double height, bool absoluteHeight)
voidGetHeightmapParams(double& offset, double& height, bool& absoluteHeight) const
voidSetVectorScale(const MFloatVector& scale)
voidGetVectorScale(MFloatVector& scale) const
 Inherited methods

void Destroy()

Destroy the displacement component, removing it from the parent layer.

void SetDisplacementType(DisplacementType type)
DisplacementType GetDisplacementType() const

Maxwell supports the following types of displacement:

  • DisplacementType_OnTheFly: height map displacement where the mesh subdivision is computed dynamically at each ray intersection. This has the advantage of not using any extra memory for the subdivided mesh, but will take longer to render.
  • DisplacementType_Pretessellated: height map displacement where the mesh is subdivided before rendering begins. This mode renders as fast as regular meshes, but uses more memory.
  • DisplacementType_3DRelativeTangentZeroBlack: vector displacement using maps produced by Mudbox.
  • DisplacementType_3DRelativeTangentZeroGray: vector displacement using maps produced by 3DCoat or RealFlow.
  • DisplacementType_3DAbsoluteTangentZeroBlack: vector displacement where the map values will be used as they are (not scaled by the size of the object, as in the previous two modes).

The vector displacement modes perform the subdivision before rendering begins, similar to the pretessellated mode. See this page for mode details on the supported displacement types.

Attribute name: type (AttrType_Int).

void SetSubdivisionParams(double level, bool adaptiveLevel, bool smoothing)
void GetSubdivisionParams(double& level, bool& adaptiveLevel, bool& smoothing) const

These parameters control how the mesh is subdivided (see here for details). The adaptiveLevel argument is only relevant when the type is set to DisplacementType_OnTheFly. The Python version of GetSubdivisionParams takes no arguments and returns the values as a 3-tuple.

 Attribute names: subdivisionLevel (AttrType_Double)adaptiveSubdivision (AttrType_Bool)smoothing (AttrType_Bool).

void SetHeightmapParams(double offset, double height, bool absoluteHeight)
void GetHeightmapParams(double& offset, double& height, bool& absoluteHeight) const

These parameters apply when height map displacement is used (the type is DisplacementType_OnTheFly or DisplacementType_Pretessellated). See this page for details. The Python version of GetHeightmapParams takes no arguments and returns the values as a 3-tuple.

 Attribute names: offset (AttrType_Double), height (AttrType_Double), absoluteHeight (AttrType_Bool).

void SetVectorScale(const MFloatVector& scale)
void GetVectorScale(MFloatVector& scale) const

This is the scaling factor for vector displacement. It is not relevant when height map displacement is used. The Python version of GetVectorScale takes no arguments and returns the scale as a 3-tuple.

Attribute name: vectorScale (AttrType_Color).