Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

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.

Anchor
setactiveiormode
setactiveiormode

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.

Anchor
getactiveiormode
getactiveiormode

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.

Anchor
setcomplexior
setcomplexior

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.

Anchor
getcomplexior
getcomplexior

getComplexIor

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

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

Anchor
setcolor
setcolor

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

Code Block
languagecpp
titleSetting 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

Anchor
getcolor
getcolor

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.

Anchor
setactivecolor
setactivecolor

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

Code Block
languagecpp
titleSetting 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

Anchor
getactivecolor
getactivecolor

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.

Anchor
setabsorptiondistance
setabsorptiondistance

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.

Anchor
getabsorptiondistance
getabsorptiondistance

getAbsorptionDistance

Gets the absorption distance of the reflectance.

LanguageSyntax
C++const char* getAbsorptionDistance( real& distance )
Python(str type, float distance) 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.

Anchor
setscatteringparameters
setscatteringparameters

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.

Anchor
getscatteringparameters
getscatteringparameters

getScatteringParameters

Gets the scattering parameters.

LanguageSyntax
C++byte getScatteringParameters( real& scatteringCoefficient, real& asymmetryFactor, bool& useThickness )
Python(float scatteringCoef, float asymmetryFactor, bool useThickness) getScatteringParameters()

Return value

C++

0 = Error getting the scattering parameters.

1 = Success.

Python

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

Anchor
setscatteringthickness
setscatteringthickness

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.

Anchor
getscatteringthickness
getscatteringthickness

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.

Anchor
setactivescatteringthickness
setactivescatteringthickness

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.

Anchor
getactivescatteringthickness
getactivescatteringthickness

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.

Anchor
setscatteringthicknessrange
setscatteringthicknessrange

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.

Anchor
getscatteringthicknessrange
getscatteringthicknessrange

getScatteringThicknessRange

Gets the scattering thickness range.

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

Return value

C++

0 = Error getting the scattering thickness range.

1 = Success.

Python

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

Anchor
setior
setior

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.

Anchor
getior
getior

getIOR

Gets the IOR parameters.

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

Return value

C++

0 = Error getting the IOR parameters.

1 = Success.

Python

Tuple containing the IOR parameters (nd,abbe).

Anchor
setconductor
setconductor

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.

Anchor
getconductor
getconductor

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.

Anchor
enableforcefresnel
enableforcefresnel

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.

Anchor
getforcefresnel
getforcefresnel

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.

Anchor
setfresnelcustom
setfresnelcustom

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.

Anchor
getfresnelcustom
getfresnelcustom

getFresnelCustom

Gets the custom fresnel values.

LanguageSyntax
C++byte getFresnelCustom( real& angleStranght, real& roughnessStrenght, bool& isEnabled)
Python(float angleStrenght, float roughnessStrenght, bool isEnabled) getFresnelCustom()

Return value

C++

0 = Error getting the custom fresnel values.

1 = Success.

Python

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