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 11 Next »

C++Python
Cmaxwell::CreflectanceCreflectance

Defines the reflectance/transmittance/IOR of a bsdf or coating.

Inherits from

CmaterialPointer.

Method

NameDescription
setActiveIorModeSets the active IOR mode.
getActiveIorModeGets the active IOR mode.
setComplexIorSets the complex IOR file.
getComplexIorGets the complex IOR file.
setColorSets the reflectance color parameters (Reflectance 0, Reflectance 90, Transmittance and Scattering).
getColorGets the reflectance color parameters (Reflectance 0, Reflectance 90, Transmittance and Scattering).
setActiveColorSets the active reflectance color parameters.
getActiveColorGets the active reflectance color parameters.
setAbsorptionDistanceSets the absorption distance.
getAbsorptionDistanceGets the absorption distance.
setScatteringParametersSets the scattering parameters.
getScatteringParametersGets the scattering parameters.
setScatteringThicknessSets the thickness used for the single side scattering scattering.
getScatteringThicknessGets the thickness used for the single side scattering scattering.
setActiveScatteringThicknessSets the active scattering thickness.
getActiveScatteringThicknessGets the active scattering thickness.
setScatteringThicknessRangeSets the scattering thickness range.
getScatteringThicknessRangeGets the scattering thickness range.
setIORSets IOR parameters.
getIORGets IOR parameters.
setConductorSets conductor.
getConductorGets conductor.
enableForceFresnelEnables/disables force fresnel flag.
getForceFresnelGets force fresnel flag.
setFresnelCustomSets custom fresnel values.
getFresnelCustomGets custom fresnel values.
getReflectanceAndTransmittanceDeprecated.

setActiveIorMode

Sets if the active IOR mode is CUSTOM (complex = 0) or measured (complex = 1, uses a complex IOR file).

LanguageSyntax
C++byte setActiveIorMode( byte complex )
Pythonint setActiveIorMode( int complex )

Return value

0 = Error setting active IOR mode.

1 = Success.

getActiveIorMode

Gets if the active IOR mode is CUSTOM (complex = 0) or measured (complex = 1, uses a complex IOR file).

LanguageSyntax
C++byte getActiveIorMode( byte& complex )
Pythonint getActiveIorMode()

Return value

C++

0 = Error getting the active IOR mode.

1 = Success.

Python

Active IOR mode.

setComplexIor

Sets the complex IOR file used when the active IOR mode is 1 (complex mode).

LanguageSyntax
C++byte setComplexIor( const char* pFileName )
Pythonint setActiveIorMode( str filename )

Return value

0 = Error setting complex IOR.

1 = Success.

getComplexIor

Gets the complex IOR file used when the active IOR mode is 1 (complex mode).

LanguageSyntax
C++const char* getComplexIor()
Pythonstr getComplexIor()

setColor

Sets the reflectance color parameters.

LanguageSyntax
C++byte setColor( const char* pID, Cmaxwell::CmultiValue::Cmap& map )
Pythonint setColor( str pID, Cmap map )

Parameters

TypeNameIn/OutDescription
const char*pIDin

Color to set. Must be one of:

  • "color.tangential" (Reflectance 90).
  • "color" (Reflectance 0).
  • "transmittance.color" (Transmittance).
  • "scattering" (Subsurface Properties. Scattering).
CmapmapinCmap containing the color parameter.

Return value

0 = Error setting reflectance color.

1 = Success.

Examples

Setting the "Reflectance 0" color.
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

getColor

Gets the reflectance color parameters.

LanguageSyntax
C++byte getColor( const char* pID, Cmaxwell::CmultiValue::Cmap & map )
PythonCmap getColor( str pID )

Parameters

TypeNameIn/OutDescription
const char*pIDin

Color to get. Must be one of:

  • "color.tangential" (Reflectance 90).
  • "color" (Reflectance 0).
  • "transmittance.color" (Transmittance).
  • "scattering" (Subsurface Properties. Scattering).
CmapmapoutCmap containing the color parameter.

Return value

C++

0 = Error getting the color.

1 = Success.

Python

Cmap containing the color requested.

setActiveColor

Sets the reflectance active color parameters.

LanguageSyntax
C++byte setActiveColor( const char* pID, Cmaxwell::CmultiValue::Cmap & map )
Pythonint setActiveColor( str pID, Cmap map )

Parameters

TypeNameIn/OutDescription
const char*pIDin

Color to set. Must be one of:

  • "color.tangential" (Reflectance 90).
  • "color" (Reflectance 0).
  • "transmittance.color" (Transmittance).
  • "scattering" (Subsurface Properties. Scattering).
CmapmapinCmap containing the color parameter.

Return value

0 = Error setting reflectance color.

1 = Success.

Examples

Setting the "Reflectance 0" color.
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

getActiveColor

Gets the reflectance active color parameters.

LanguageSyntax
C++byte getActiveColor( const char* pID, Cmaxwell::CmultiValue::Cmap & map )
PythonCmap getActiveColor( str pID )

Parameters

TypeNameIn/OutDescription
const char*pIDin

Color to get. Must be one of:

  • "color.tangential" (Reflectance 90).
  • "color" (Reflectance 0).
  • "transmittance.color" (Transmittance).
  • "scattering" (Subsurface Properties. Scattering).
CmapmapoutCmap containing the color parameter.

Return value

C++

0 = Error getting the active color.

1 = Success.

Python

Cmap containing the active color requested.

setAbsorptionDistance

Sets the absorption distance.

LanguageSyntax
C++byte setAbsorptionDistance( const char* pType, real distance )
Pythonint setAbsorptionDistance( str type, float distance )

Parameters

TypeNameIn/OutDescription
const char*pTypein

Must be one of the following: "nanometers", "microns", "millimeters", "centimeters", "decimeters", "meters".

realdistanceinAbsorption distance.

Return value

0 = Error setting reflectance absorption distance.

1 = Success.

getAbsorptionDistance

Gets the absorption distance of the reflectance.

LanguageSyntax
C++const char* getAbsorptionDistance( real& distance )
Pythontuple getAbsorptionDistance()

Parameters

TypeNameIn/OutDescription
real&distanceoutAbsorption 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.

setScatteringParameters

Sets the scattering parameters.

LanguageSyntax
C++byte setScatteringParameters( real scatteringCoefficient, real asymmetryFactor, bool useThickness )
Pythonint setScatteringParameters( float scatteringCoefficient, float asymmetryFactor, bool useThickness )

Return value

0 = Error setting scattering parameters.

1 = Success.

getScatteringParameters

Gets the scattering parameters.

LanguageSyntax
C++byte getScatteringParameters( real& scatteringCoefficient, real& asymmetryFactor, bool& useThickness )
Pythontuple getScatteringParameters()

Return value

C++

0 = Error getting the scattering parameters.

1 = Success.

Python

Tuple containing the scattering parameters (scatteringCoefficient, assymetryFactor, useThickness).

setScatteringThickness

Sets the thickness used for the single side subsurface scattering.

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

Return value

0 = Error setting the scattering thickness.

1 = Success.

getScatteringThickness

Gets the thickness used for the single side scattering scattering.

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

Return value

C++

0 = Error getting the thickness.

1 = Success.

Python

Cmap containing the thickness.

setActiveScatteringThickness

Sets the active thickness used for the single side subsurface scattering.

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

Return value

0 = Error setting the active scattering thickness.

1 = Success.

getActiveScatteringThickness

Gets the active thickness used for the single side subsurface scattering.

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

Return value

C++

0 = Error getting the active thickness.

1 = Success.

Python

Cmap containing the active thickness.

setScatteringThicknessRange

Sets the scattering thickness range.

LanguageSyntax
C++byte setScatteringThicknessRange( real min, real max )
Pythonint setScatteringThicknessRange( float min, float max )

Return value

0 = Error setting scattering thickness range.

1 = Success.

getScatteringThicknessRange

Gets the scattering thickness range.

LanguageSyntax
C++byte getScatteringThicknessRange( real& min, real& max )
Pythontuple getScatteringThicknessRange()

Return value

C++

0 = Error getting the scattering thickness range.

1 = Success.

Python

Tuple containing the scattering thickness range (min,max).

setIOR

Sets the IOR parameters.

LanguageSyntax
C++byte setIOR( real nd, real abbe )
Pythonint setIOR( float nd, float abbe )

Return value

0 = Error setting IOR parameters.

1 = Success.

getIOR

Gets the IOR parameters.

LanguageSyntax
C++byte getIOR( real& nd, real& abbe )
Pythontuple getIOR()

Return value

C++

0 = Error getting the IOR parameters.

1 = Success.

Python

Tuple containing the IOR parameters (nd,abbe).

setConductor

k > 0 means it's a conductor.

LanguageSyntax
C++byte setConductor( real k )
Pythonint setConductor( float k )

Return value

0 = Error setting conductor.

1 = Success.

getConductor

Gets the conductor parameter.

LanguageSyntax
C++byte getConductor( real& k )
Pythonfloat getConductor()

Return value

C++

0 = Error getting the conductor parameter.

1 = Success.

Python

Conductor k value.

enableForceFresnel

Sets the flag to force the fresnel on/off, using only the chromaticism of the reflectance 90 and ignoring its luminescence.

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

Return value

0 = Error setting force fresnel state.

1 = Success.

getForceFresnel

Gets force fresnel flag.

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

Return value

C++

0 = Error getting the force fresnel flag.

1 = Success.

Python

Force fresnel flag.

setFresnelCustom

Enables/Disables the custom fresnel values (old R2 controls).

LanguageSyntax
C++byte setFresnelCustom( float angleStrength, float roughnessStrength, bool isEnabled )
Pythonint setFresnelCustom( float angleStrength, float roughnessStrength, bool isEnabled )

Return value

0 = Error setting custom fresnel values.

1 = Success.

getFresnelCustom

Gets the custom fresnel values.

LanguageSyntax
C++byte getFresnelCustom( real& angleStranght, real& roughnessStrenght, bool& isEnabled)
Pythontuple getFresnelCustom()

Return value

C++

0 = Error getting the custom fresnel values.

1 = Success.

Python

Tuple containing the custom fresnel values (angleStrenght, roughnessStrenght, isEnabled).

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  • No labels