CmaterialLayer

C++Python
Cmaxwell::CmaterialLayerCmaterialLayer

Material layer.

Inherits from

CmaterialPointer.

Methods

NameDescription
setEnabledEnables/disables layer.
getEnabledGets layer state.
setNameSets layer name.
getNameGets layer name.
setStackedBlendingModeGets stacked blending mode (BLENDING_MODES).
getStackedBlendingModeSets stacked blending mode (BLENDING_MODES).
setWeightSets layer weight.
getWeightGets layer weight.
setActiveWeightSets active layer weight.
getActiveWeightGets active layer weight.
createEmitterCreates an emitter for the layer.
getEmitterGets the emitter component of the layer (if exists).
freeEmitterFree the emitter (if exists).
enableDisplacementEnable displacement for the layer.
isDisplacementEnabledGets displacement state for the layer.
setDisplacementMapSets displacement map.
getDisplacementMapGets displacement map.
setDisplacementCommonParametersSets common displacement parameters.
getDisplacementCommonParametersGets common displacement parameters.
setHeightMapDisplacementParametersSets height map displacement parameters.
getHeightMapDisplacementParametersGets height map displacement parameters.
setVectorDisplacementParametersSet vector displacement parameters.
getVectorDisplacementParametersGet vector displacement parameters.
addBSDFAdd a new BSDF to the layer.
getNumBSDFsGets the number of BSDF s in the layer.
getBSDFGets a BSDF  by index.

Inherited methods

isNull.

setEnabled

To switch on/off the layer.

LanguageSyntax
C++byte setEnabled( bool enabled )
Pythonint setEnabled( bool enabled )

Return value

0 = Error setting layer state.

1 = Success.

getEnabled

Gets layer state.

LanguageSyntax
C++byte getEnabled( bool& enabled )
Pythonbool getEnabled()

Return value

C++

0 = Error getting layer state.

1 = Success.

Python

Layer state.

setName

Sets the layer name.

LanguageSyntax
C++byte setName( const char* pName )
Pythonint setName( str name )

Return value

0 = Error setting camera name.

1 = Success.

getName

Gets the layer name.

LanguageSyntax
C++byte getName( char** pName )
Pythonstr getName()

Return value

C++

0 = Error getting layer name.

1 = Success.

Python

Layer name.

setStackedBlendingMode

Sets the blending mode of this layer. It is useful when layers are stacked only. See enum BLENDING_MODES for details about supported blending modes.

LanguageSyntax
C++byte setStackedBlendingMode( byte mode )
Pythonint setStackedBlendingMode( int mode )

Return value

0 = Error setting stacked blending mode.

1 = Success.

getStackedBlendingMode

Gets the blending mode of this layer. It is useful when layers are stacked only. See enum BLENDING_MODES for details about supported blending modes.

LanguageSyntax
C++byte getStackedBlendingMode( byte& mode )
Pythonint getStackedBlendingMode()

Return value

C++

0 = Error getting stacked blending mode.

1 = Success.

Python

Stacked blending mode.

setWeight

Sets the layer weight (map.type = TYPE_VALUE or TYPE_BITMAP).

LanguageSyntax
C++byte setWeight( Cmaxwell::CmultiValue::Cmap& map )
Pythonint setWeight( Cmap map )

Return value

0 = Error setting layer weight.

1 = Success.

getWeight

Gets the layer weight (map.type = TYPE_VALUE or TYPE_BITMAP).

LanguageSyntax
C++byte getWeight( Cmaxwell::CmultiValue::Cmap& map )
PythonCmap getWeight()

Return value

C++

0 = Error getting layer weight.

1 = Success.

Python

Cmap with the weight value (map.type = TYPE_VALUE or TYPE_BITMAP).

setActiveWeight

Sets the layer active weight (map.type = TYPE_VALUE or TYPE_BITMAP).

LanguageSyntax
C++byte setActiveWeight( Cmaxwell::CmultiValue::Cmap& map )
Pythonint setActiveWeight( Cmap map )

Return value

0 = Error setting layer active weight.

1 = Success.

getActiveWeight

Gets the layer active weight (map.type = TYPE_VALUE or TYPE_BITMAP).

LanguageSyntax
C++byte getActiveWeight( Cmaxwell::CmultiValue::Cmap& map )
PythonCmap getActiveWeight()

Return value

C++

0 = Error getting layer active weight.

1 = Success.

Python

Cmap with the active weight value (map.type = TYPE_VALUE or TYPE_BITMAP).

createEmitter

Create an emitter for the material layer. Only one emitter per layer is allowed.

LanguageSyntax
C++Cmaxwell::CmaterialEmitter createEmitter()
PythonCmaterialEmitter createEmitter()

getEmitter

Gets the emitter of the material layer (if exists).

LanguageSyntax
C++Cmaxwell::CmaterialEmitter getEmitter()
PythonCmaterialEmitter getEmitter()

freeEmitter

Deletes the emitter of the material layer (if exists).

LanguageSyntax
C++byte freeEmitter()
Pythonint freeEmitter()

Return value

0 = Error freeing the emitter.

1 = Success.

enableDisplacement

Enables/disables the displacement for the layer. Only one displacement element per layer is allowed.

LanguageSyntax
C++byte enableDisplacement( bool enable )
Pythonint enableDisplacement( bool enable )

Return value

0 = Error setting displacement on/off.

1 = Success.

isDisplacementEnabled

Gets displacement state.

LanguageSyntax
C++byte isDisplacementEnabled( bool& enabled )
Pythonbool isDisplacementEnabled()

Return value

C++

0 = Error getting displacement state.

1 = Success.

Python

Displacement state.

setDisplacementMap

Sets the displacement map data.

LanguageSyntax
C++byte setDisplacementMap( Cmaxwell::CmultiValue::Cmap& map )
Pythonint setDisplacementMap( Cmap map )

Return value

0 = Error setting the displacement map.

1 = Success.

getDisplacementMap

Gets the displacement map data.

LanguageSyntax
C++byte getDisplacementMap( Cmaxwell::CmultiValue::Cmap& map )
PythonCmap getDisplacementMap()

Return value

C++

0 = Error getting the displacement map data.

1 = Success.

Python

Cmap with the displacement map data.

setDisplacementCommonParameters

Sets the displacement common parameters.

LanguageSyntax
C++byte setDisplacementCommonParameters( byte displacementType, real subdivisionLevel, real smoothness, dword minLOD = 0, dword maxLOD = 0 )
Pythonint setDisplacementCommonParameters( int displacementType, float subdivisionLevel, float smoothness, int minLOD = 0, int maxLOD = 0 )

Parameters

TypeNameIn/OutDescription
bytedisplacementTypein

0 - On-The-Fly displacement.
1 - Pretessellated displacement (default).
2 - 3D Relative Tangent. Level zero black (i.e. Mudbox).
3 - 3D Relative Tangent. Level zero mid grey (i.e. 3dcoat).
4 - 3D Absolute Tangent. level zero black.
5 - 3D RealFlow.

realsubdivisionLevelinSubdivision level. Range: (1, 1e6).
realsmoothnessinEnables/disables smooth (0 or 1).
dwordminLODin

Minimum size in pixels to enable displacement subdivision. Range: (0.0, 1e6). Default: 0.

dwordmaxLODin

If pixel size is greater than maxLOD, maximum subdivision level is used. Range: ( 0.0, 1e6). Default: 0.

If both minLOD and maxLOD are 0, no LOD is used.

Return value

0 = Error setting the displacement common values.

1 = Success.

getDisplacementCommonParameters

Gets the displacement common parameters.

LanguageSyntax
C++byte getDisplacementCommonParameters( byte& displacementType, real& subdivisionLevel, real& smoothness, dword& minLOD, dword& maxLOD )
Python

(int displacementType, float subdivisionLevel, float smoothness, int minLOD, int maxLOD) getDisplacementCommonParameters()

Parameters

TypeNameIn/OutDescription
bytedisplacementTypeout

0 - On-The-Fly displacement.
1 - Pretessellated displacement (default).
2 - 3D Relative Tangent. Level zero black (i.e. Mudbox).
3 - 3D Relative Tangent. Level zero mid grey (i.e. 3dcoat).
4 - 3D Absolute Tangent. level zero black.
5 - 3D RealFlow.

realsubdivisionLeveloutSubdivision level. Range: (1, 1e6).
realsmoothnessoutEnables/disables smooth (0 or 1).
dwordminLODout

Minimum size in pixels to enable displacement subdivision. Range: (0.0, 1e6). Default: 0.

dwordmaxLODout

If pixel size is greater than maxLOD, maximum subdivision level is used. Range: ( 0.0, 1e6). Default: 0.

If both minLOD and maxLOD are 0, no LOD is used.

Return value

C++

0 = Error getting the displacement common data.

1 = Success.

Python

Tuple containing the displacement common data.

setHeightMapDisplacementParameters

Sets the height map displacement parameters.

LanguageSyntax
C++byte setHeightMapDisplacementParameters( real offset, real height, bool absoluteHeight, bool adaptive )
Pythonint setHeightMapDisplacementParameters( float offset, float height, bool absoluteHeight, bool adaptive )

Parameters

TypeNameIn/OutDescription
realoffsetin

Range:(-1000.0, 1000.0).

realheightinRange:(-1000.0, 1000.0).
boolabsoluteHeightinUse real units for height.
booladaptivein

Enable auto adaptive subdivision.

Return value

0 = Error setting the height map displacement parameters.

1 = Success.

getHeightMapDisplacementParameters

Gets the height map displacement parameters.

LanguageSyntax
C++byte getHeightMapDisplacementParameters( real& offset, real& height, bool& absoluteHeight, bool& adaptive )
Python(float offset, float height, bool absoluteHeight, bool adaptive) getHeightMapDisplacementParameters()

Parameters

TypeNameIn/OutDescription
realoffsetout

Range:(-1000.0, 1000.0).

realheightoutRange:(-1000.0, 1000.0).
boolabsoluteHeightoutUse real units for height.
booladaptiveout

Enable auto adaptive subdivision.

Return value

C++

0 = Error getting the height map displacement parameters.

1 = Success.

Python

Tuple containing the height map displacement parameters.

setVectorDisplacementParameters

Sets the vector displacement parameters.

LanguageSyntax
C++byte setVectorDisplacementParameters( Cvector scale )
Pythonint setVectorDisplacementParameters( Cvector scale )

Return value

0 = Error setting the height map displacement parameters.

1 = Success.

getVectorDisplacementParameters

Gets the vector displacement parameters.

LanguageSyntax
C++byte getVectorDisplacementParameters( Cvector& scale )
PythonCvector getVectorDisplacementParameters()

Return value

C++

0 = Error getting the vector displacement parameters.

1 = Success.

Python

Cvector scale vector.

addBSDF

Adds a new BSDF to the layer.

LanguageSyntax
C++Cmaxwell::Cbsdf  addBSDF()
PythonCbsdf addBSDF()

Return value

Cmaxwell::Cbsdf  reference to the new BSDF added to the layer.

getNumBSDFs

Gets number of BSDFs in the layer.

LanguageSyntax
C++byte getNumBSDFs( byte& nBSDFs )
Pythonint getNumBSDFs()

Return value

C++

0 = Error getting the number of BSDFs.

1 = Success.

Python

Number of BSDFs.

getBSDF

Gets the Nth BSDF of the layer.

LanguageSyntax
C++Cmaxwell::Cbsdf getBSDF( byte index )
PythonCbsdf getBSDF( int index )

Return value

Cmaxwell::Cbsdf  reference to the BSDF requested.