CmaterialLayer
C++ | Python |
---|---|
Cmaxwell::CmaterialLayer | CmaterialLayer |
Material layer.
Inherits from
Methods
Name | Description |
---|---|
setEnabled | Enables/disables layer. |
getEnabled | Gets layer state. |
setName | Sets layer name. |
getName | Gets layer name. |
setStackedBlendingMode | Gets stacked blending mode (BLENDING_MODES). |
getStackedBlendingMode | Sets stacked blending mode (BLENDING_MODES). |
setWeight | Sets layer weight. |
getWeight | Gets layer weight. |
setActiveWeight | Sets active layer weight. |
getActiveWeight | Gets active layer weight. |
createEmitter | Creates an emitter for the layer. |
getEmitter | Gets the emitter component of the layer (if exists). |
freeEmitter | Free the emitter (if exists). |
enableDisplacement | Enable displacement for the layer. |
isDisplacementEnabled | Gets displacement state for the layer. |
setDisplacementMap | Sets displacement map. |
getDisplacementMap | Gets displacement map. |
setDisplacementCommonParameters | Sets common displacement parameters. |
getDisplacementCommonParameters | Gets common displacement parameters. |
setHeightMapDisplacementParameters | Sets height map displacement parameters. |
getHeightMapDisplacementParameters | Gets height map displacement parameters. |
setVectorDisplacementParameters | Set vector displacement parameters. |
getVectorDisplacementParameters | Get vector displacement parameters. |
addBSDF | Add a new BSDF to the layer. |
getNumBSDFs | Gets the number of BSDF s in the layer. |
getBSDF | Gets a BSDF by index. |
Inherited methods
setEnabled
To switch on/off the layer.
Language | Syntax |
---|---|
C++ | byte setEnabled( bool enabled ) |
Python | int setEnabled( bool enabled ) |
Return value
0 = Error setting layer state.
1 = Success.
getEnabled
Gets layer state.
Language | Syntax |
---|---|
C++ | byte getEnabled( bool& enabled ) |
Python | bool getEnabled() |
Return value
C++
0 = Error getting layer state.
1 = Success.
Python
Layer state.
setName
Sets the layer name.
Language | Syntax |
---|---|
C++ | byte setName( const char* pName ) |
Python | int setName( str name ) |
Return value
0 = Error setting camera name.
1 = Success.
getName
Gets the layer name.
Language | Syntax |
---|---|
C++ | byte getName( char** pName ) |
Python | str 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.
Language | Syntax |
---|---|
C++ | byte setStackedBlendingMode( byte mode ) |
Python | int 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.
Language | Syntax |
---|---|
C++ | byte getStackedBlendingMode( byte& mode ) |
Python | int 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).
Language | Syntax |
---|---|
C++ | byte setWeight( Cmaxwell::CmultiValue::Cmap& map ) |
Python | int setWeight( Cmap map ) |
Return value
0 = Error setting layer weight.
1 = Success.
getWeight
Gets the layer weight (map.type = TYPE_VALUE or TYPE_BITMAP).
Language | Syntax |
---|---|
C++ | byte getWeight( Cmaxwell::CmultiValue::Cmap& map ) |
Python | Cmap 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).
Language | Syntax |
---|---|
C++ | byte setActiveWeight( Cmaxwell::CmultiValue::Cmap& map ) |
Python | int 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).
Language | Syntax |
---|---|
C++ | byte getActiveWeight( Cmaxwell::CmultiValue::Cmap& map ) |
Python | Cmap 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.
Language | Syntax |
---|---|
C++ | Cmaxwell::CmaterialEmitter createEmitter() |
Python | CmaterialEmitter createEmitter() |
getEmitter
Gets the emitter of the material layer (if exists).
Language | Syntax |
---|---|
C++ | Cmaxwell::CmaterialEmitter getEmitter() |
Python | CmaterialEmitter getEmitter() |
freeEmitter
Deletes the emitter of the material layer (if exists).
Language | Syntax |
---|---|
C++ | byte freeEmitter() |
Python | int 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.
Language | Syntax |
---|---|
C++ | byte enableDisplacement( bool enable ) |
Python | int enableDisplacement( bool enable ) |
Return value
0 = Error setting displacement on/off.
1 = Success.
isDisplacementEnabled
Gets displacement state.
Language | Syntax |
---|---|
C++ | byte isDisplacementEnabled( bool& enabled ) |
Python | bool isDisplacementEnabled() |
Return value
C++
0 = Error getting displacement state.
1 = Success.
Python
Displacement state.
setDisplacementMap
Sets the displacement map data.
Language | Syntax |
---|---|
C++ | byte setDisplacementMap( Cmaxwell::CmultiValue::Cmap& map ) |
Python | int setDisplacementMap( Cmap map ) |
Return value
0 = Error setting the displacement map.
1 = Success.
getDisplacementMap
Gets the displacement map data.
Language | Syntax |
---|---|
C++ | byte getDisplacementMap( Cmaxwell::CmultiValue::Cmap& map ) |
Python | Cmap 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.
Language | Syntax |
---|---|
C++ | byte setDisplacementCommonParameters( byte displacementType, real subdivisionLevel, real smoothness, dword minLOD = 0, dword maxLOD = 0 ) |
Python | int setDisplacementCommonParameters( int displacementType, float subdivisionLevel, float smoothness, int minLOD = 0, int maxLOD = 0 ) |
Parameters
Type | Name | In/Out | Description |
---|---|---|---|
byte | displacementType | in | 0 - On-The-Fly displacement. |
real | subdivisionLevel | in | Subdivision level. Range: (1, 1e6). |
real | smoothness | in | Enables/disables smooth (0 or 1). |
dword | minLOD | in | Minimum size in pixels to enable displacement subdivision. Range: (0.0, 1e6). Default: 0. |
dword | maxLOD | in | 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.
Language | Syntax |
---|---|
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
Type | Name | In/Out | Description |
---|---|---|---|
byte | displacementType | out | 0 - On-The-Fly displacement. |
real | subdivisionLevel | out | Subdivision level. Range: (1, 1e6). |
real | smoothness | out | Enables/disables smooth (0 or 1). |
dword | minLOD | out | Minimum size in pixels to enable displacement subdivision. Range: (0.0, 1e6). Default: 0. |
dword | maxLOD | out | 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.
Language | Syntax |
---|---|
C++ | byte setHeightMapDisplacementParameters( real offset, real height, bool absoluteHeight, bool adaptive ) |
Python | int setHeightMapDisplacementParameters( float offset, float height, bool absoluteHeight, bool adaptive ) |
Parameters
Type | Name | In/Out | Description |
---|---|---|---|
real | offset | in | Range:(-1000.0, 1000.0). |
real | height | in | Range:(-1000.0, 1000.0). |
bool | absoluteHeight | in | Use real units for height. |
bool | adaptive | in | Enable auto adaptive subdivision. |
Return value
0 = Error setting the height map displacement parameters.
1 = Success.
getHeightMapDisplacementParameters
Gets the height map displacement parameters.
Language | Syntax |
---|---|
C++ | byte getHeightMapDisplacementParameters( real& offset, real& height, bool& absoluteHeight, bool& adaptive ) |
Python | (float offset, float height, bool absoluteHeight, bool adaptive) getHeightMapDisplacementParameters() |
Parameters
Type | Name | In/Out | Description |
---|---|---|---|
real | offset | out | Range:(-1000.0, 1000.0). |
real | height | out | Range:(-1000.0, 1000.0). |
bool | absoluteHeight | out | Use real units for height. |
bool | adaptive | out | 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.
Language | Syntax |
---|---|
C++ | byte setVectorDisplacementParameters( Cvector scale ) |
Python | int setVectorDisplacementParameters( Cvector scale ) |
Return value
0 = Error setting the height map displacement parameters.
1 = Success.
getVectorDisplacementParameters
Gets the vector displacement parameters.
Language | Syntax |
---|---|
C++ | byte getVectorDisplacementParameters( Cvector& scale ) |
Python | Cvector 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.
Language | Syntax |
---|---|
C++ | Cmaxwell::Cbsdf addBSDF() |
Python | Cbsdf addBSDF() |
Return value
Cmaxwell::Cbsdf reference to the new BSDF added to the layer.
getNumBSDFs
Gets number of BSDFs in the layer.
Language | Syntax |
---|---|
C++ | byte getNumBSDFs( byte& nBSDFs ) |
Python | int 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.
Language | Syntax |
---|---|
C++ | Cmaxwell::Cbsdf getBSDF( byte index ) |
Python | Cbsdf getBSDF( int index ) |
Return value
Cmaxwell::Cbsdf reference to the BSDF requested.