Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 35 Next »

C++Python
Cmaxwell::Cbsdf Cbsdf

Describes a BSDF.

Inherits

CmaterialPointer.

Methods

NameDescription
setNameSets BSDF's name.
getNameGets BSDF's name.
setStateTo switch on/off the BSDF.
getStateGets BSDF state (on/off).
setWeightTo set the weight of this BSDF in its parent layer.
getWeightTo get the weight of this BSDF in its parent layer.
setActiveWeightTo set the weight of this BSDF in its parent layer.
getActiveWeightTo get the weight of this BSDF in its parent layer.
getReflectanceReturns the reflectance pointer of this BSDF.
setColorSets the value/texture of the given parameter.
getColorGets the value/texture of the given parameter.
setActiveColorSets the value/texture of the given parameter.
getActiveColorGets the value/texture of the given parameter.
setNormalMapStateEnables/disables normal mapping for the bump parameter of this BSDF.
getNormalMapStateGets BSDF normal mapping state (on/off).
addCoatingAdd a new coating to this BSDF.
getCoatingGet a coating of this BSDF.
getNumCoatingsGet number of coatings of this BSDF.

Inherited methods

NameDescription
isNullChecks whether the object is null.

setName

Sets BSDF's name.

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

getName

Gets BSDF's name.

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

setState

To switch on/off the BSDF.

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

getState

Gets BSDF state (on/off).

LanguageSyntax
C++byte getState( bool& enabled )
Pythonbool 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.

LanguageSyntax
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.

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

Return value

C++

0 = Error getting weight map.

1 = Success.

getReflectance

Returns the reflectance pointer of this BSDF.

LanguageSyntax
C++Cmaxwell::Creflectance getReflectance()
PythonCreflectance getReflectance()

setColor, getColor, setActiveColor, getActiveColor

Sets/gets the value/texture of the given parameter.

LanguajeSyntax
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 );
Pythonint setColor( pID, map );
 Cmap getColor( pID );
 int setActiveColor( pID, map );
 Cmap getActiveColor( pID );

Return value

C++

0 = Error setting map.

1 = Success.

Examples

C++
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 );
Python
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.

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

Return value

C++

0 = Error setting normal map state.

1 = Success.

getNormalMapState

Gets BSDF normal mapping state (on/off).

LanguageSyntax
C++byte getNormalMapState( bool& state )
Pythonbool getNormalMapState()

Return value

C++

0 = Error getting normal mapping state.

1 = Success.

addCoating

Adds a new coating to this BSDF.

LanguageSyntax
C++Cmaxwell::Ccoating addCoating()
PythonCcoating addCoating()

getCoating

Gets a coating of this BSDF.

LanguageSyntax
C++Cmaxwell::Ccoating getCoating( byte index )
PythonCcoating getCoating( int index )

getNumcoatings

Get number of coatings of this BSDF.

LanguageSyntax
C++byte getNumCoatings( byte& nCoatings )
Pythonint getNumCoatings()

Return value

C++

0 = Error getting number of coatings.

1 = Success

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  • No labels