...
Method
Name | Description |
---|---|
setActiveIorMode | Sets the active IOR mode. |
getActiveIorMode | Gets the active IOR mode. |
setComplexIor | Sets the complex IOR file. |
getComplexIor | Gets the complex IOR file. |
setColor | Sets the reflectance color parameters (Reflectance 0, Reflectance 90, Transmittance and Scattering). |
getColor | Gets the reflectance color parameters (Reflectance 0, Reflectance 90, Transmittance and Scattering). |
setActiveColor | Sets the active reflectance color parameters. |
getActiveColor | Gets the active reflectance color parameters. |
setAbsorptionDistance | Sets the absorption distance. |
getAbsorptionDistance | Gets the absorption distance. |
setScatteringParameters | Sets the scattering parameters. |
getScatteringParameters | Gets the scattering parameters. |
setScatteringThickness | Sets the thickness used for the single side scattering scattering. |
getScatteringThickness | Gets the thickness used for the single side scattering scattering. |
setActiveScatteringThickness | Sets the active scattering thickness. |
getActiveScatteringThickness | Gets the active scattering thickness. |
setScatteringThicknessRange | Sets the scattering thickness range. |
getScatteringThicknessRange | Gets the scattering thickness range. |
setIOR | Sets IOR parameters. |
getIOR | Gets IOR parameters. |
setConductor | Sets conductor. |
getConductor | Gets conductor. |
enableForceFresnel | Enables/disables force fresnel flag. |
getForceFresnel | Gets force fresnel flag. |
setFresnelCustom | Sets custom fresnel values. |
getFresnelCustom | Gets custom fresnel values. |
getReflectanceAndTransmittance | Deprecated. |
Anchor | ||||
---|---|---|---|---|
|
setActiveIorMode
Sets if the active IOR mode is CUSTOM (complex = 0) or measured (complex = 1, uses a complex IOR file).
Language | Syntax |
---|---|
C++ | byte setActiveIorMode( byte complex ) |
Python | int setActiveIorMode( int complex ) |
Return value
0 = Error setting active IOR mode.
1 = Success.
Anchor | ||||
---|---|---|---|---|
|
getActiveIorMode
Gets if the active IOR mode is CUSTOM (complex = 0) or measured (complex = 1, uses a complex IOR file).
Language | Syntax |
---|---|
C++ | byte getActiveIorMode( byte& complex ) |
Python | int getActiveIorMode() |
Return value
C++
0 = Error getting the active IOR mode.
1 = Success.
Python
Active IOR mode.
Anchor | ||||
---|---|---|---|---|
|
setComplexIor
Sets the complex IOR file used when the active IOR mode is 1 (complex mode).
Language | Syntax |
---|---|
C++ | byte setComplexIor( const char* pFileName ) |
Python | int setActiveIorMode( str filename ) |
Return value
0 = Error setting complex IOR.
1 = Success.
Anchor | ||||
---|---|---|---|---|
|
getComplexIor
Gets the complex IOR file used when the active IOR mode is 1 (complex mode).
Language | Syntax |
---|---|
C++ | const char* getComplexIor() |
Python | str getComplexIor() |
Anchor | ||||
---|---|---|---|---|
|
setColor
Sets the reflectance color parameters.
Language | Syntax |
---|---|
C++ | byte setColor( const char* pID, Cmaxwell::CmultiValue::Cmap& map ) |
Python | int setColor( str pID, Cmap map ) |
Parameters
Type | Name | In/Out | Description |
---|---|---|---|
const char* | pID | in | Color to set. Must be one of:
|
Cmap | map | in | Cmap containing the color parameter. |
Return value
0 = Error setting reflectance color.
1 = Success.
Examples
Code Block | ||||
---|---|---|---|---|
| ||||
Cmaxwell::CmaterialLayer layer = material.addLayer();
Cmaxwell::Cbsdf bsdf = layer.addBSDF();
layer.setName( "layer" );
Cmaxwell::CmultiValue::Cmap mvMap;
Cmaxwell::Creflectance reflectance = bsdf.getReflectance();
// Set the reflectance color as RGB
Crgb color;
color.assign( 1.0, 1.0, 1.0 );
mvMap.type = Cmaxwell::CmultiValue::Cmap::TYPE_RGB;
mvMap.rgb.assign( color );
reflectance.setColor( "color", mvMap );
reflectance.setActiveColor( "color", mvMap ); // Set RGB as active
// Set the reflectance as a texture
mvMap.pFileName = path;
mvMap.uvwChannel = 0;
mvMap.uIsTiled = ...;
reflectance.setColor( "color", mvMap );
reflectance.setActiveColor( "color", mvMap ); // Set texture as active |
Anchor | ||||
---|---|---|---|---|
|
getColor
Gets the reflectance color parameters.
Language | Syntax |
---|---|
C++ | byte getColor( const char* pID, Cmaxwell::CmultiValue::Cmap & map ) |
Python | Cmap getColor( str pID ) |
Parameters
Type | Name | In/Out | Description |
---|---|---|---|
const char* | pID | in | Color to get. Must be one of:
|
Cmap | map | out | Cmap containing the color parameter. |
Return value
C++
0 = Error getting the color.
1 = Success.
Python
Cmap containing the color requested.
Anchor | ||||
---|---|---|---|---|
|
setActiveColor
Sets the reflectance active color parameters.
Language | Syntax |
---|---|
C++ | byte setActiveColor( const char* pID, Cmaxwell::CmultiValue::Cmap & map ) |
Python | int setActiveColor( str pID, Cmap map ) |
Parameters
Type | Name | In/Out | Description |
---|---|---|---|
const char* | pID | in | Color to set. Must be one of:
|
Cmap | map | in | Cmap containing the color parameter. |
Return value
0 = Error setting reflectance color.
1 = Success.
Examples
Code Block | ||||
---|---|---|---|---|
| ||||
Cmaxwell::CmaterialLayer layer = material.addLayer();
Cmaxwell::Cbsdf bsdf = layer.addBSDF();
layer.setName( "layer" );
Cmaxwell::CmultiValue::Cmap mvMap;
Cmaxwell::Creflectance reflectance = bsdf.getReflectance();
// Set the reflectance color as RGB
Crgb color;
color.assign( 1.0, 1.0, 1.0 );
mvMap.type = Cmaxwell::CmultiValue::Cmap::TYPE_RGB;
mvMap.rgb.assign( color );
reflectance.setColor( "color", mvMap );
reflectance.setActiveColor( "color", mvMap ); // Set RGB as active
// Set the reflectance as a texture
mvMap.pFileName = path;
mvMap.uvwChannel = 0;
mvMap.uIsTiled = ...;
reflectance.setColor( "color", mvMap );
reflectance.setActiveColor( "color", mvMap ); // Set texture as active |
Anchor | ||||
---|---|---|---|---|
|
getActiveColor
Gets the reflectance active color parameters.
Language | Syntax |
---|---|
C++ | byte getActiveColor( const char* pID, Cmaxwell::CmultiValue::Cmap & map ) |
Python | Cmap getActiveColor( str pID ) |
Parameters
Type | Name | In/Out | Description |
---|---|---|---|
const char* | pID | in | Color to get. Must be one of:
|
Cmap | map | out | Cmap containing the color parameter. |
Return value
C++
0 = Error getting the active color.
1 = Success.
Python
Cmap containing the active color requested.
Anchor | ||||
---|---|---|---|---|
|
setAbsorptionDistance
Sets the absorption distance.
Language | Syntax |
---|---|
C++ | byte setAbsorptionDistance( const char* pType, real distance ) |
Python | int setAbsorptionDistance( str type, float distance ) |
Parameters
Type | Name | In/Out | Description |
---|---|---|---|
const char* | pType | in | Must be one of the following: "nanometers", "microns", "millimeters", "centimeters", "decimeters", "meters". |
real | distance | in | Absorption distance. |
Return value
0 = Error setting reflectance absorption distance.
1 = Success.
Anchor | ||||
---|---|---|---|---|
|
getAbsorptionDistance
Gets the absorption distance of the reflectance.
Language | Syntax |
---|---|
C++ | const char* getAbsorptionDistance( real& distance ) |
Python | tuple getAbsorptionDistance() |
Parameters
Type | Name | In/Out | Description |
---|---|---|---|
real& | distance | out | Absorption distance. |
Return value
C++
Absorption distance type ("nanometers", "microns", "millimeters", "centimeters", "decimeters" or "meters").
Python
Tuple containing type ("nanometers", "microns", "millimeters", "centimeters", "decimeters" or "meters") and distance.
Anchor | ||||
---|---|---|---|---|
|
setScatteringParameters
Sets the scattering parameters.
Language | Syntax |
---|---|
C++ | byte setScatteringParameters( real scatteringCoefficient, real asymmetryFactor, bool useThickness ) |
Python | int setScatteringParameters( float scatteringCoefficient, float asymmetryFactor, bool useThickness ) |
Return value
0 = Error setting scattering parameters.
1 = Success.
Anchor | ||||
---|---|---|---|---|
|
getScatteringParameters
Gets the scattering parameters.
Language | Syntax |
---|---|
C++ | byte getScatteringParameters( real& scatteringCoefficient, real& asymmetryFactor, bool& useThickness ) |
Python | tuple getScatteringParameters() |
Return value
C++
0 = Error getting the scattering parameters.
1 = Success.
Python
Tuple containing the scattering parameters (scatteringCoefficient, assymetryFactor, useThickness).
Anchor | ||||
---|---|---|---|---|
|
setScatteringThickness
Sets the thickness used for the single side subsurface scattering.
Language | Syntax |
---|---|
C++ | byte setScatteringThickness( Cmaxwell::CmultiValue::Cmap& map ) |
Python | int setScatteringThickness( Cmap map ) |
Return value
0 = Error setting the scattering thickness.
1 = Success.
Anchor | ||||
---|---|---|---|---|
|
getScatteringThickness
Gets the thickness used for the single side scattering scattering.
Language | Syntax |
---|---|
C++ | byte getScatteringThickness( Cmaxwell::CmultiValue::Cmap& map ) |
Python | Cmap getScatteringThickness() |
Return value
C++
0 = Error getting the thickness.
1 = Success.
Python
Cmap containing the thickness.
Anchor | ||||
---|---|---|---|---|
|
setActiveScatteringThickness
Sets the active thickness used for the single side subsurface scattering.
Language | Syntax |
---|---|
C++ | byte setActiveScatteringThickness( Cmaxwell::CmultiValue::Cmap& map ) |
Python | int setActiveScatteringThickness( Cmap map ) |
Return value
0 = Error setting the active scattering thickness.
1 = Success.
Anchor | ||||
---|---|---|---|---|
|
getActiveScatteringThickness
Gets the active thickness used for the single side subsurface scattering.
Language | Syntax |
---|---|
C++ | byte getActiveScatteringThickness( Cmaxwell::CmultiValue::Cmap& map ) |
Python | Cmap getActiveScatteringThickness() |
Return value
C++
0 = Error getting the active thickness.
1 = Success.
Python
Cmap containing the active thickness.
Anchor | ||||
---|---|---|---|---|
|
setScatteringThicknessRange
Sets the scattering thickness range.
Language | Syntax |
---|---|
C++ | byte setScatteringThicknessRange( real min, real max ) |
Python | int setScatteringThicknessRange( float min, float max ) |
Return value
0 = Error setting scattering thickness range.
1 = Success.
Anchor | ||||
---|---|---|---|---|
|
getScatteringThicknessRange
Gets the scattering thickness range.
Language | Syntax |
---|---|
C++ | byte getScatteringThicknessRange( real& min, real& max ) |
Python | tuple getScatteringThicknessRange() |
Return value
C++
0 = Error getting the scattering thickness range.
1 = Success.
Python
Tuple containing the scattering thickness range (min,max).
Anchor | ||||
---|---|---|---|---|
|
setIOR
Sets the IOR parameters.
Language | Syntax |
---|---|
C++ | byte setIOR( real nd, real abbe ) |
Python | int setIOR( float nd, float abbe ) |
Return value
0 = Error setting IOR parameters.
1 = Success.
Anchor | ||||
---|---|---|---|---|
|
getIOR
Gets the IOR parameters.
Language | Syntax |
---|---|
C++ | byte getIOR( real& nd, real& abbe ) |
Python | tuple getIOR() |
Return value
C++
0 = Error getting the IOR parameters.
1 = Success.
Python
Tuple containing the IOR parameters (nd,abbe).
Anchor | ||||
---|---|---|---|---|
|
setConductor
k > 0 means it's a conductor.
Language | Syntax |
---|---|
C++ | byte setConductor( real k ) |
Python | int setConductor( float k ) |
Return value
0 = Error setting conductor.
1 = Success.
Anchor | ||||
---|---|---|---|---|
|
getConductor
Gets the conductor parameter.
Language | Syntax |
---|---|
C++ | byte getConductor( real& k ) |
Python | float getConductor() |
Return value
C++
0 = Error getting the conductor parameter.
1 = Success.
Python
Conductor k value.
Anchor | ||||
---|---|---|---|---|
|
enableForceFresnel
Sets the flag to force the fresnel on/off, using only the chromaticism of the reflectance 90 and ignoring its luminescence.
Language | Syntax |
---|---|
C++ | byte enableForceFresnel( bool enabled ) |
Python | int enableForceFresnel( bool enabled ) |
Return value
0 = Error setting force fresnel state.
1 = Success.
Anchor | ||||
---|---|---|---|---|
|
getForceFresnel
Gets force fresnel flag.
Language | Syntax |
---|---|
C++ | byte getForceFresnel( bool& enabled ) |
Python | bool getForceFresnel() |
Return value
C++
0 = Error getting the force fresnel flag.
1 = Success.
Python
Force fresnel flag.
Anchor | ||||
---|---|---|---|---|
|
setFresnelCustom
Enables/Disables the custom fresnel values (old R2 controls).
Language | Syntax |
---|---|
C++ | byte setFresnelCustom( float angleStrength, float roughnessStrength, bool isEnabled ) |
Python | int setFresnelCustom( float angleStrength, float roughnessStrength, bool isEnabled ) |
Return value
0 = Error setting custom fresnel values.
1 = Success.
Anchor | ||||
---|---|---|---|---|
|
getFresnelCustom
Gets the custom fresnel values.
Language | Syntax |
---|---|
C++ | byte getFresnelCustom( real& angleStranght, real& roughnessStrenght, bool& isEnabled) |
Python | tuple getFresnelCustom() |
Return value
C++
0 = Error getting the custom fresnel values.
1 = Success.
Python
Tuple containing the custom fresnel values (angleStrenght, roughnessStrenght, isEnabled).