C++ | Python |
---|---|
Cmaxwell::Cbsdf | Cbsdf |
Describes a BSDF.
Inherits from
Methods
Name | Description |
---|---|
setName | Sets BSDF's name. |
getName | Gets BSDF's name. |
setState | To switch on/off the BSDF. |
getState | Gets BSDF state (on/off). |
setWeight | To set the weight of this BSDF in its parent layer. |
getWeight | To get the weight of this BSDF in its parent layer. |
setActiveWeight | To set the weight of this BSDF in its parent layer. |
getActiveWeight | To get the weight of this BSDF in its parent layer. |
getReflectance | Returns the reflectance pointer of this BSDF. |
setColor | Sets the value/texture of the given parameter. |
getColor | Gets the value/texture of the given parameter. |
setActiveColor | Sets the value/texture of the given parameter. |
getActiveColor | Gets the value/texture of the given parameter. |
setNormalMapState | Enables/disables normal mapping for the bump parameter of this BSDF. |
getNormalMapState | Gets BSDF normal mapping state (on/off). |
addCoating | Add a new coating to this BSDF. |
getCoating | Get a coating of this BSDF. |
getNumCoatings | Get number of coatings of this BSDF. |
Inherited methods
Name | Description |
---|---|
isNull | Checks whether the object is null. |
setName
Sets BSDF's name.
Language | Syntax |
---|---|
C++ | byte setName( const char* pName ) |
Python | int setName( str name ) |
getName
Gets BSDF's name.
Language | Syntax |
---|---|
C++ | char* getName() |
Python | str getName() |
setState
To switch on/off the BSDF.
Language | Syntax |
---|---|
C++ | byte setState( bool enabled ) |
Python | int setState( bool enabled ) |
getState
Gets BSDF state (on/off).
Language | Syntax |
---|---|
C++ | byte getState( bool& enabled ) |
Python | bool getState() |
setWeight, setActiveWeight
To set the weight of this BSDF in its parent layer.
map.type must be CmultiValue::Cmap::TYPE_VALUE, CmultiValue::Cmap::TYPE_BITMAP.
Language | Syntax |
---|---|
C++ | byte setWeight( CmultiValue::Cmap& map ) |
byte setActiveWeight( CmultiValue::Cmap& map ) | |
Python | int setWeight( Cmap map ) |
int setActiveWeight( Cmap map ) |
Return value
C++
0 = Error setting weight map.
1 = Success.
getWeight, getActiveWeight
To get the weight of this BSDF in its parent layer.
Language | Syntax |
---|---|
C++ | byte getWeight( CmultiValue::Cmap& map ) |
byte getActiveWeight( CmultiValue::Cmap& map ) | |
Python | Cmap getWeight() |
Cmap getActiveWeight() |
Return value
C++
0 = Error getting weight map.
1 = Success.
getReflectance
Returns the reflectance pointer of this BSDF.
Language | Syntax |
---|---|
C++ | Cmaxwell::Creflectance getReflectance() |
Python | Creflectance getReflectance() |
setColor, getColor, setActiveColor, getActiveColor
Sets/gets the value/texture of the given parameter.
Languaje | Syntax |
---|---|
C++ | byte setColor( const char* pID, CmultiValue::Cmap& map ); |
byte getColor( const char* pID, CmultiValue::Cmap& map ); | |
byte setActiveColor( const char* pID, CmultiValue::Cmap& map ); | |
byte getActiveColor( const char* pID, CmultiValue::Cmap& map ); | |
Python | int setColor( pID, map ); |
Cmap getColor( pID ); | |
int setActiveColor( pID, map ); | |
Cmap getActiveColor( pID ); |
Return value
C++
0 = Error setting map.
1 = Success.
Examples
Cmaxwell::CmaterialLayer layer = material.addLayer(); Cmaxwell::Cbsdf bsdf = layer.addBSDF(); Cmaxwell::CmultiValue::Cmap mvMap; mvMap.type = Cmaxwell::CmultiValue::Cmap::TYPE_VALUE; (roughness will use a numeric value instead of a texture) mvMap.value = 77.0; bsdf.setColor( "roughness", mvMap ); bsdf.setActiveColor( "roughness", mvMap );
layer = material.addLayer(); bsdf = layer.addBSDF(); mvMap = Cmap(); mvMap.type = Cmap::TYPE_VALUE; (roughness will use a numeric value instead of a texture) mvMap.value = 77.0; bsdf.setColor( 'roughness', mvMap ); bsdf.setActiveColor( 'roughness', mvMap );
setNormalMapState
Enables/disables normal mapping for the bump parameter of this BSDF.
Language | Syntax |
---|---|
C++ | byte setNormalMapState( bool enabled ) |
Python | int setNormalMapState( bool enabled ) |
Return value
C++
0 = Error setting normal map state.
1 = Success.
getNormalMapState
Gets BSDF normal mapping state (on/off).
Language | Syntax |
---|---|
C++ | byte getNormalMapState( bool& state ) |
Python | bool getNormalMapState() |
Return value
C++
0 = Error getting normal mapping state.
1 = Success.
addCoating
Adds a new coating to this BSDF.
Language | Syntax |
---|---|
C++ | Cmaxwell::Ccoating addCoating() |
Python | Ccoating addCoating() |
getCoating
Gets a coating of this BSDF.
Language | Syntax |
---|---|
C++ | Cmaxwell::Ccoating getCoating( byte index ) |
Python | Ccoating getCoating( int index ) |
getNumcoatings
Get number of coatings of this BSDF.
Language | Syntax |
---|---|
C++ | byte getNumCoatings( byte& nCoatings ) |
Python | int getNumCoatings() |
Return value
C++
0 = Error getting number of coatings.
1 = Success