Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The Cmaxwell class describes the whole Maxwell Render scene.

...

TypeNameDescription
unsigned char_interactiveFlagsInternal use.

Enumerations

typeCallback and InteractiveFlags.

Methods

NameDescription
CmaxwellClass constructor.
~CmaxwellClass destructor.
getMxsVersionGets MXS file version.
getMostRecentVersionMXSGets most recent MXS version supported.
getPluginIDGets the plug-in identifier from which the MXS was created.
setPluginIDGets the plug-in identifier from which the MXS was created.
isProtectionEnabledGets scene protection state in Maxwell Studio (ability to export to other formats).
enableProtectionSets scene protection state in Maxwell Studio (ability to export to other formats).
Scene methods
freeGeometryDeletes all geometry of the scene.
freeSceneResets the scene. Cleans all objects, geometry, materials, etc.
getScenePreviewPreview image of the scene stored in the file (useful for thumbnals).
setScenePreviewSets preview image.
readPreviewSets sene preview image from another MXS --TODO--.
setInputDataTypeSet the axis orientation of the scene.
setSinglePrecisionOfGeometryUses floats instead of doubles for geometry.
setSceneUserDataInternal use.
addClusterAdds a triangle cluster to the scene.
Object methods
getObjectGets a object reference from the scene.
createMeshCreates a mesh with the given parameters and adds it to the scene.
createInstancementCreates an instancement.
createProxyCreates a proxy object from a MXS.
createRFRKCreates a RealFlow RenderKit object.
addObjectAdds an existent object to the scene.
mergeMeshesMerges meshes into a new one.
Camera methods
addCameraAdds a new camera to the scene with the given parameters.
getCameraGets a camera requested by name.
getActiveCameraGets the active camera of the scene.
Paths methods
setPathSets the path and depth for the given channel.
getPathGets the path and depth for the given channel.
addSearchingPathAdds a path to look for missing textures, ior and ies files.
getSearchingPaths

Gets all searching paths of the scene.

Sky methods
getSunPositionTypeSets sun position type.
setSunPositionTypeGets sun position type.
getSkyConstantGets the parameters of the constant sky.
setSkyConstantSets the parameters of the constant sky.
getSunLongitudeAndLatitudeGets sun longitude and latitude data.
setSunLongitudeAndLatitudeSets sun longitude and latitude data.
getSunAnglesGets sun position angles.
setSunAnglesSets sun position angles.
getSunDirectionGets sun direction vector.
setSunDirectionSets sun direction vector.
getSunRotationGets sun rotation angles.
setSunRotationSets sun rotation angles.
getSunPropertiesGets sun properties
setSunPropertiesSets sun properties.
getPhysicalSkyAtmosphereGets physical atmosphere parameters.
setPhysicalSkyAtmosphereSets physical atmosphere parameters.
getActiveSkyGets active sky name.
setActiveSkySets active sky name.
Additional sky methods
getSunDirectionUsedForRenderingReturns the sun direction.
saveSkyToHDRSaves current sky to an HDR file.
saveSkyToPresetSaves current physical sky values to a file.
loadSkyFromPresetLoads a preset file replacing current physical sky values.
getSkyColorReturns sky RGB color of the current sky values in the given direction.
getSkyColorNoTonemappedReturns sky RGB color (without tonemapping nor exposure) of the current sky values in the given direction.
Environment methods
isEnvironmentEnabledGets IBL (Image Based Lighting) state.
enableEnvironmentSets the IBL (Image Based Lighting) on/off.
getEnvironmentWeightGets the value for the global multiplier of all the environment layers.
setEnvironmentWeightSets the value for the global multiplier of all the environment layers.
getEnvironmentLayerGets the parameters of each environment layer.
setEnvironmentLayerSets the parameters of each environment layer.
Material methods
readMaterialReads a material from file (MXM).
createMaterialCreates a new material.
getMaterialGets a material by name.
addMaterialAdds a material to the scene.
eraseUnusedMaterialsRemove unused materials from the scene.
setOverrideMaterialSets the path and state (enabled/disabled) of the material that overrides all materials of the scene (except emitter materials).
getOverrideMaterialgets the path and state (enabled/disabled) of the material that overrides all materials of the scene (except emitter materials).
setDefaultMaterialSets the path and state (enabled/disabled) of the material that will be used for all the objects/triangles without material.
getDefaultMaterialGets the path and state (enabled/disabled) of the material that will be used for all the objects/triangles without material.
Render methods
setRenderParameterSets render parameter.
getRenderParameterGets render parameter.
Tonemapping methods
getToneMappingGets tonemapping values.
setToneMappingSets tonemapping values.
getActiveToneMappingDeprecatedGets the active tonemapping used ("BASIC" or "ADVANCED" ).
setAdvancedToneMappingDeprecated.
getAdvancedToneMappingDeprecated.
Read/write scene methods
readMXSReads scene from disk.
writeMXSWrites scene to disk.
Glare methods
setDiffractionSets diffraction parameters.
getDiffractionGets diffraction parameters.
enableDiffractionEnables diffraction.
disableDiffractionDisables diffraction.
setColorSpaceSets the output color space used by the render engine.
getColorSpaceGets the output color space used by the render engine.
getColorSpaceGammaReturns the gamma used by the active color space.
Miscellaneous methods
getLastErrorReturns the latest error occurred.
getLastErrorStringReturns an human readable string containing the latest error occurred.
getDependencies

Returns all the extern dependencies of the scene (textures, ior files, hdr files, etc).

getObjectsCountReturns the number of objects in the scene.
getMaterialsCountReturns the number of materials in the scene.
getCamerasCountReturns the number of cameras in the scene.
getTriangleGroupsCountReturns the number of triangle groups in the scene. Deprecated.
getSceneInfoReturns by reference a Cmaxwell::CsceneInfo structure with information about the scene.
computeFresnelGraph Computes the reflectance as a function of the angle of incidence.
computeAbbeGraph Computes the reflectance as a function of the spectral input.
getCorrelatedColorTemperature Gets the correlated RGB values given the temperature color.
generateUuidGenerates an unique ID.
searchFileInCommonPathsLooks for the given file in all of the searching paths of the scene.
createGeometryLoaderObject 
createGeometryProceduralObject 
applySkyExtension 
applySceneModifierExtension 

Static Methods

 
NameDescription
getEngineVersionReturns the current engine version.
getSdkVersionReturns the current SDK version.
isDepthSupportedForThisFormat Returns true if for the given extension the depth is valid.
getHighestDepthSupportedForThisFormat Returns the highest bits per plane supported for the given format.
isEmbeddingAlphaSupportedForThisFormat 
isEmbeddingAllChannelsSupportedForThisFormat 
isTextureExtensionSupportedReturns true if for the given format it is possible embedding the alpha channel.
isEmbeddingAllChannelsSupportedForThisFormatReturns true if for the given format it is possible embedding all channels in a multilayer file.
isTextureExtensionSupportedReturns true if the extension of the given texture path is supported by the render engine.
getSquareSwatchIES

Used to get the IES/EULUM emission pattern plotted into a square rgb buffer of size "resolution". The caller is responsible of freeing the buffer "buf" after using it.

getSolidLobeIES

Used to get the IES/EULUM emission pattern plotted as a 3d object. The caller is responsible of freeing the buffers "faces, points" after using them.

Virtual Methods

NameDescription
printMessagePrints a message in the render console or in the message handler installed.

 

Anchor
cmaxwellctor
cmaxwellctor

...

TypeNameIn/OutDescription
const char*pInputin

Must be one of the following: "YXZ", "ZXY" or "YZX".

The following equivalences are accepted Typedefs with plugin names can be used as well:

"YXZYZXRH" = "LIGHTWAVE"MAXWELL", "MAYA", "XSI", "HOUDINI", "RHINO" or "CINEMASOLIDWORKS".

"ZXYZXYLH" = "FORMZ" or "3DSMAX".

"YZXYXZLH" = "MAXWELLCINEMA", .

"MAYAYZXLH" , "XSI", "HOUDINI", "RHINO" or "SOLIDWORKS"

...

LIGHTWAVE".

Anchor
setsingleprecisionofgeometry
setsingleprecisionofgeometry

...

TypeNameIn/outDescription
const char*pNameinCluster name

Return value

Returns a Cmaxwell::Ccluster object, that is a reference to the cluster added to the scene.

...

Returns the Cobject with the given name or a null object if there is not an object with that name ( Cmaxwell::Cobject::isNull() == true ).

Anchor
createmesh
createmesh

...

Cmaxwell::Cobject reference to the new mesh object created in the scene. Null object if it was not created (Cmaxwell::Cobject::isNull() = true).

Anchor
createinstancement
createinstancement

...

So it's highly reccommended to assign unique names in each instancement creation when we create a lot of them. A good example of creating instancements is provided here.

LanguageSyntax
C++Cmaxwell::Cobject createInstancement( const char* pName, Cmaxwell::Cobject& object )
PythonCmaxwellObject createInstancement( str pName, CmaxwellObject object )

...

Cmaxwell::Cobject reference to the new instance object created in the scene. Null object if it was not created (Cmaxwell::Cobject::isNull() = true).

Anchor
createproxy
createproxy

...

Cmaxwell::Cobject reference to the new proxy object created in the scene. Null object if it was not created (Cmaxwell::Cobject::isNull() = true).

Anchor
createrfrk
createrfrk

...

Method used to create RealFlow objects. Returns a null object that can be filled with Cmaxwell::Cobject::setRfrkParameters().

LanguageSyntax
C++Cmaxwell::Cobject createRFRK( const char* objName )
PythonCmaxwellObject createRFRK( str objName )

Cmaxwell::Cobject reference to the new RFRK object created in the scene. Null object if it was not created (Cmaxwell::Cobject::isNull() = true).

Anchor
addobject
addobject

...

Cmaxwell::Cobject reference to the object added in the scene. Null object if it was not created (Cmaxwell::Cobject::isNull() = true).

Anchor
mergemeshes
mergemeshes

...

Cmaxwell::Cobject reference to the new merged object created in the scene. Null object if it was not created (Cmaxwell::Cobject::isNull() = true).

Examples

Code Block
titlePython
list = []
list.append(scene.getObject('sphere'));
list.append(scene.getObject('cube'));
newobject = scene.mergeMeshes('merged',list);    

...

TypeNameIn/OutDescription
const char*pTypeinPath type: "RENDER", "ALPHA", "SHADOW", "OBJECT", "MATERIAL", "MOTION", "Z". ("BITMAPS" is deprecated, use Cmaxwell::addSearchingPath() instead)
const char*pPathinOutput path of the channel.
byteoutputBitDepthModein

Bits depth per pixel (8/16/32). If the depth is not correct for the given format, the engine tries to change this parameter.

i.e. setPath( "image.jpg", 32 ) is not correct because jpg does not support 32 bits so the engine will change it to 8. Get more info about supported image formats.

...

TypeNameIn/OutDescription
const char*pTypeinPath type: "RENDER", "ALPHA", "SHADOW", "OBJECT", "MATERIAL", "MOTION", "Z". ("BITMAPS" is deprecated, use Cmaxwell::addSearchingPath() instead)
byteoutputBitDepthModeoutBits depth per pixel (8/16/32).

...

LanguageSyntax
C++byte getSkyConstant( real& luminance, Crgb& color0, Crgb& color90, real& controlPoint )
Python{ (float ' luminance', Crgb ' color0', Crgb ' color90', 'float controlPoint' } ) getSkyConstant()

Parameters

...

0 = Error getting constant sky parameters.

1 = Success.

Python

Dictionary Tuple containing all constant sky parameters.

...

Gets the location of the sun when Cmaxwell::getSunPositionType() = 0.

LanguageSyntax
C++byte getSunLongitudeAndLatitude( real& longitude, real& latitude, int& sm, dword& dayOfYear, real&timeOfDay )
Python

{ (float ' longitude', float ' latitude', int ' sm', int ' dayOfYear', int ' timeOfDay'} ) getSunLongitudeAndLatitude()

...

0 = Error getting sun longitude and latitude.

1 = Success.

Python

Dictionary Tuple contaning all sun longitude and latittude values.

...

Sets the location of the sun when Cmaxwell::getSunPositionType() = 0.

LanguageSyntax
C++byte setSunLongitudeAndLatitude( real longitude, real latitude, int sm, dword dayOfYear, real timeOfDay )
Pythonint setSunLongitudeAndLatitude( float longitude, float latitude, int sm, int dayOfYear, float timeOfDay )

...

LanguageSyntax
C++byte getSunAngles( real& zenith, real& azimuth )
Python(float zenith, float azimuth) getSunAngles()

Parameters

...

0 = Error getting sun angles.

1 = Success

Python

(zenith,azimuth) = Tuple containing zenith and azimuth angles.

...

LanguageSyntax
C++byte getSunRotation( real& rotation )
Pythonfloat getSunRotation()

Parameters

TypeNameIn/OutDescription
realrotationoutGround rotation of the sky hemisphere (from 0 to 2PI radians).

...

LanguageSyntax
C++byte getSunProperties( byte& enabled, real& sunTemperature, real& sunPowerScaleFactor )
Python{'(int enabled', 'float sunTemperature', 'float sunPowerScaleFactor'} ) getSunProperties()

Parameters

TypeNameIn/OutDescription
byteenabledoutSun enabled (1) or disabled (0).
realsunTemperatureoutTemperature in kelvins.
realsunPowerScaleFactoroutTotal power refered to the Earth's sun. For example a value of 0.8 would mean a sun emitting 0.8 times less energy than ours. Default: 1.0. Range: is allowed any value greater than 0.

...

0 = Error getting sun properties.

1 = Success.

Python

Dictionary Tuple containing the sun properties.

...

LanguageSyntax
C++byte setSunProperties( byte enabled, real sunTemperature, real sunPowerScaleFactor )
Pythonint setSunProperties( int enabled, float sunTemperature, float sunPowerScaleFactor )

Parameters

TypeNameIn/OutDescription
byteenabledinSun enabled (1) or disabled (0).
realsunTemperatureinTemperature in kelvins.
realsunPowerScaleFactorinTotal power refered to the Earth's sun. For example a value of 0.8 would mean a sun emitting 0.8 times less energy than ours. Default: 1.0. Range: is allowed any value greater than 0.

...

LanguageSyntax
C++

byte getPhysicalSkyAtmosphere( real& intensity, real& ozone, real& water, real& angstromTurbidity, real& wavelengthTurbidity, real& aerosolAlbedo, real& asimmetryFactor, real& planetReflectance )

Python

{ (float ' intensity, float ' ozone', float ' water', float ' angstromTurbidity', float ' wavelengthTurbidity', float ' aerosolAlbedo', float ' asimmetryFactor', float ' planetReflectance' } ) getPhysicalSkyAtmosphere()

Parameters

TypeNameIn/OutDescription
realintensityoutIntensity weight. Default: 1.0. Range: Any value greater than 0.
realozoneout(cms) Default: 0.4. Range: Any value greater than 0 (usually between 0 and 1).
realwateroutWater vapor (cms). Default: 2.0. Range: Any value greater than 0.
realangstromTurbidityoutAngstrom turbidity coefficient. Default: 0.04. Range: Any value greater than 0.
realwavelengthTurbidityoutWavelength turbidity exponent. Default 1.2. Range: Any value greater than 0.
realaerosolAlbedooutAerosol albedo. Default 0.8. Range: (0-1).
realasimmetryFactorout"Anisotropy" of aerosol. Default: 0.7. Range (-0.99999, 0.99999).
realplanetReflectanceoutPlanet reflectance. From 0 to 1.

...

0 = Error getting atmosphere parameters.

1 = Success.

Python

Dictionary Tuple containing all atmosphere parameters.

...

LanguageSyntax
C++

byte setPhysicalSkyAtmosphere( real intensity, real ozone, real water, real angstromTurbidity, real wavelengthTurbidity, real aerosolAlbedo, real asimmetryFactor, real planetReflectance )

Python

byte setPhysicalSkyAtmosphere( float intensity, float ozone, float water, float angstromTurbidity, float wavelengthTurbidity, float aerosolAlbedo, float asimmetryFactor, float planetReflectance )

Parameters

TypeNameIn/OutDescription
realintensityinIntensity weight. Default: 1.0. Range: Any value greater than 0.
realozonein(cms) Default: 0.4. Range: Any value greater than 0 (usually between 0 and 1).
realwaterinWater vapor (cms). Default: 2.0. Range: Any value greater than 0.
realangstromTurbidityinAngstrom turbidity coefficient. Default: 0.04. Range: Any value greater than 0.
realwavelengthTurbidityinWavelength turbidity exponent. Default 1.2. Range: Any value greater than 0.
realaerosolAlbedoinAerosol albedo. Default 0.8. Range: (0-1).
realasimmetryFactorin"Anisotropy" of aerosol. Default: 0.7. Range (-0.99999, 0.99999).
realplanetReflectanceinPlanet reflectance. From 0 to 1.

...

LanguageSyntax
C++byte setActiveSky( const char* pActiveSky )
Pythonint setActiveSky( str pActiveSky )

Parameters

TypeNameIn/OutDescription
const char*pActiveSkyinActive sky name. "constant " = constant sky, "physical" = physical sky, NULL = no sky.

...

LanguageSyntax
C++byte getSkyColor( Crgb& hdrRgb, Crgb8& ldrRgb, const Cvector& dir )
Pythondict getSkyColor(Crgb hdr, Crgb8 ldr) getSkyColor( Cvector dir )

Return value

...

0 = Error getting sky color.

1 = Success.

Python

Dictionary Tuple containing 'hdr' and 'ldr' colors.

Anchor
getskycolorgetskycolornotonemappedgetskycolor
getskycolornotonemapped

getSkyColorNoTonemapped

Returns sky RGB color (without tonemapping nor exposure) of the current sky values in the given direction.

...

Cvector containing the HDR color.

Anchor
getenvironmentlayerisenvironmentenabledgetenvironmentlayer
isenvironmentenabled

...

isEnvironmentEnabled

Gets the parameters of each environment layerIBL (Image Based Lighting) state.

getEnvironmentLayer( const char* pLayerName, const char*& pBitmapFileName, byte& state, bool& sphericalMapping, bool& interpolate, real& intensity, real& uTile, real& vTile, real& uTileOffset, real& vTileOffset
LanguageSyntax
C++byte
isEnvironmentEnabled( bool& enabled )
Python

{ str 'bitmapFileName', int 'state', bool 'sphericalMapping', bool 'interpolate', float 'intensity', float 'uTile', float 'vTile', float 'uTileOffset', float 'TileOffset'} getEnvironmentLayer( str pLayerName )

Parameters

Offset range: From 0.0 to 360.0 (default 0.0).
TypeNameIn/OutDescription
const char*pLayerNameinSets the layer type. Must be "background", "reflection", "refraction" or "illumination".
const char*pBitmapFileNameoutPath of the texture file.
bytestateoutChannel state: 0 = Disabled; 1 = Enabled; 2 = Use active sky instead. Default: Enabled.
boolsphericalMappingoutSpherical mapping enabled. When pLayerName = "background" must be false.
boolinterpolateoutIf true, pixel values are interpolated.
realintensityoutIntensity range: From 0.0001 to 1000.0 (Default: 1.0).
realuTileoutTile range: From 0.0001 to 1000.0 (default 1.0).
realvTileoutTile range: From 0.0001 to 1000.0 (default 1.0).
realuTileOffsetoutOffset range: From 0.0 to 360.0 (default 0.0).
realvTileOffsetout
bool isEnvironmentEnabled()

Return value

C++

0 = Error getting IBL state.

1 = Success.

Python

IBL state.

Anchor
enableenvironment
enableenvironment

enableEnvironment

Sets the IBL (Image Based Lighting) on/off.

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

Return value

0 = Error getting IBL state.

1 = Success.

Anchor
setenvironmentweight
setenvironmentweight

setEnvironmentWeight

Sets the value for the global multiplier of all the environment layers.

LanguageSyntax
C++byte setEnvironmentWeight( real weight )
Pythonint setEnvironmentWeight( float weight )

Return value

0 = Error setting environment weight.

1 = Success.

Anchor
getenvironmentweight
getenvironmentweight

getEnvironmentWeight

Sets the value for the global multiplier of all the environment layers.

LanguageSyntax
C++byte getEnvironmentWeight( real& weight )
Pythonfloat getEnvironmentWeight()

Return value

C++

0 = Error getting environment layer valuesIBL state.

1 = Success.

Python

Dictionary containing all environment layer valuesEnvironment weight.

Anchor
setenvironmentlayergetenvironmentlayersetenvironmentlayer
getenvironmentlayer

...

getEnvironmentLayer

Sets Gets the parameters of each environment layer.

LanguageSyntax
C++byte setEnvironmentLayergetEnvironmentLayer( const char* pLayerName, const char*& pBitmapFileName, byte& state, bool& sphericalMapping, bool& interpolate, real& intensity, real& uTile, real& vTile, real& uTileOffset, real& vTileOffset )
Pythonint setEnvironmentLayer

(str

pLayerName

bitmapFileName,

str pBitmapFilename,

int state, bool sphericalMapping, bool interpolate, float intensity, float uTile, float vTile, float uTileOffset, float

vTileOffset

TileOffset) getEnvironmentLayer( str pLayerName )

Parameters

TypeNameIn/OutDescription
const char*pLayerNameinSets the layer type. Must be "background", "reflection", "refraction" or "illumination".
const char*pBitmapFileNameinoutPath of the texture file.
bytestateinoutChannel state: 0 = Disabled; 1 = Enabled; 2 = Use active sky instead. Default: Enabled.
boolsphericalMappinginoutSpherical mapping enabled. When pLayerName = "background" must be false.
boolinterpolateinoutIf true, pixel values are interpolated.
realintensityinoutIntensity range: From 0.0001 to 1000.0 (Default: 1.0).
realuTileinoutTile range: From 0.0001 to 1000.0 (default 1.0).
realvTileinoutTile range: From 0.0001 to 1000.0 (default 1.0).
realuTileOffsetinoutOffset range: From 0.0 to 360.0 (default 0.0).
realvTileOffsetinoutOffset range: From 0.0 to 360.0 (default 0.0).

Return value

C++

0 = Error

...

getting environment layer values.

1 = Success.

Python

Tuple containing all environment layer values.

Anchor
readmaterialsetenvironmentlayerreadmaterial
setenvironmentlayer

readMaterial

...

setEnvironmentLayer

Sets the parameters of each environment layer.

Cmaxwell::Cmaterial readMaterial pFileName
LanguageSyntax
C++
byte setEnvironmentLayer( const char*
pLayerName, const char* pBitmapFileName, byte state, bool sphericalMapping, bool interpolate, real intensity, real uTile, real vTile, real uTileOffset, real vTileOffset )
Python
CmaxwellMaterial readMaterial( str pFilename )

Return value

Returns a Cmaxwell::Cmaterial object. Null if it was not created (Cmaxwell::Cmaterial::isNull() = true).

...

createMaterial

...

int setEnvironmentLayer( str pLayerName, str pBitmapFilename, int state, bool sphericalMapping, bool interpolate, float intensity, float uTile, float vTile, float uTileOffset, float vTileOffset )

Parameters

TypeNameIn/OutDescription
const char*pLayerNameinSets the layer type. Must be "background", "reflection", "refraction" or "illumination".
const char*pBitmapFileNameinPath of the texture file.
bytestateinChannel state: 0 = Disabled; 1 = Enabled; 2 = Use active sky instead. Default: Enabled.
boolsphericalMappinginSpherical mapping enabled. When pLayerName = "background" must be false.
boolinterpolateinIf true, pixel values are interpolated.
realintensityinIntensity range: From 0.0001 to 1000.0 (Default: 1.0).
realuTileinTile range: From 0.0001 to 1000.0 (default 1.0).
realvTileinTile range: From 0.0001 to 1000.0 (default 1.0).
realuTileOffsetinOffset range: From 0.0 to 360.0 (default 0.0).
realvTileOffsetinOffset range: From 0.0 to 360.0 (default 0.0).

Return value

0 = Error setting environment layer values.

1 = Success.

Anchor
readmaterial
readmaterial

readMaterial

Reads a material from disk.

LanguageSyntax
C++Cmaxwell::Cmaterial readMaterial( const char* pFileName )
PythonCmaxwellMaterial readMaterial( str pFilename )

Return value

Returns a Cmaxwell::Cmaterial object. Null if it was not created (Cmaxwell::Cmaterial::isNull() = true).

Anchor
creatematerial
creatematerial

createMaterial

Creates a material with the given name and adds it to the scene if the parameter addToScene is true (default).

LanguageSyntax
C++Cmaxwell::Cmaterial createMaterial( const char* pMaterialName, bool addToScene = true )
PythonCmaxwellMaterial createMaterial( str pMaterialName, bool addToScene = True )

Return value

Returns a Cmaxwell::Cmaterial object. Null if it was not created (Cmaxwell::Cmaterial::isNull() = true).

Anchor
getmaterial
getmaterial

getMaterial

Given the name of a material, returns its Cmaxwell::Cmaterial reference.

LanguageSyntax
C++Cmaxwell::Cmaterial getMaterial( const char* pMaterialName )
PythonCmaxwellMaterial getMaterial( str pMaterialName )

Return value

Returns a Cmaxwell::Cmaterial object. Null if it was not created (Cmaxwell::Cmaterial::isNull() = true).

Anchor
addmaterial
addmaterial

addMaterial

Adds a material to the scene and returns a reference to the added material.

LanguageSyntax
C++Cmaxwell::Cmaterial addMaterial( Cmaxwell::Cmaterial& material )
PythonCmaxwellMaterial addMaterial( CmaxwellMaterial material )

Return value

Returns a Cmaxwell::Cmaterial object. Null if it was not created (Cmaxwell::Cmaterial::isNull() = true).

Anchor
eraseunusedmaterials
eraseunusedmaterials

eraseUnusedMaterials

Removes unused materials from the scene.

LanguageSyntax
C++byte eraseUnusedMaterials()
Pythonint eraseUnusedMaterials()

Return value

0 = Error erasing unused materials.

1 = Success.

Anchor
setoverridematerial
setoverridematerial

setOverrideMaterial

Sets the path and state (enabled/disabled) the material that overrides all the materials of the scene (except emitter materials).

LanguageSyntax
C++void setOverrideMaterial( const char* pPathMaterial )
 void setOverrideMaterial( bool enabled )
Pythonvoid setOverrideMaterial( str pPathMaterial )
 void setOverrideMaterial( bool enabled )

Parameters

TypeNameIn/OutDescription
const char*pPathMaterialinMXM file name of the override material.
boolenabledinSets override material state (enabled/disabled).

Anchor
getoverridematerial
getoverridematerial

getOverrideMaterial

Gets the path and state (enabled/disabled) of the material that overrides all the materials of the scene (except emitter materials).

LanguageSyntax
C++const char* getOverrideMaterial()
 void getOverrideMaterial( bool& enabled )
Pythonstr getOverrideMaterial()
 bool getOverrideMaterialEnabled()

Return value

Requesting override material: File name of the MXM.

Requesting override material state: true if override material is enabled, false if not.

Anchor
setdefaultmaterial
setdefaultmaterial

setDefaultMaterial

Sets the path and state (enabled/disabled) the material that will be used for all the objects/triangles without material.

LanguageSyntax
C++void setDefaultMaterial( const char* pPathMaterial )
 void setDefaultMaterial( bool enabled )
Pythonvoid setDefaultMaterial( str pPathMaterial )
 void setDefaultMaterial( bool enabled )

Parameters

TypeNameIn/OutDescription
const char*pPathMaterialinMXM file name of the default material.
boolenabledinSets default material state (enabled/disabled).

Anchor
getdefaultmaterial
getdefaultmaterial

getDefaultMaterial

Gets the path and state (enabled/disabled) of the material that will be used for all the objects/triangles without material.

LanguageSyntax
C++const char* getDefaultMaterial()
 void getDefaultMaterial( bool& enabled )
Pythonstr getDefaultMaterial()
 bool getDefaultMaterialEnabled()

Return value

Requesting default material: File name of the MXM.

Requesting default material state: true if default material is enabled, false if not.

Anchor
getsetrenderparameter
getsetrenderparameter

getRenderParameter, setRenderParameter

Gets/sets the value of the render parameter given by name.

LanguageSyntax
C++byte setRenderParameter( const char* pParameterName, dword size, const void* pParameterValue )
 byte getRenderParameter( const char* pParameterName, dword size, void* pParameterValue )
Pythonint setRenderParameter( str pParameterName, value )
 value getRenderParameter( str pParameterName )

Parameters

TypeNameIn/OutDescription
const char*pParameterNameinParameter name (see pParameterValue for parameter name list).
dwordsizein

Size of the parameter in bytes (see pParameterValue to view sizes by parameter).

Note: parameter size is not needed in Python.

void*pParameterValuein/out

Parameter value, according to the following correspondences:

Parameter nameSizeValue
"ENGINE"sizeof( char ) * 3Selects render engine. "RS0" or "RS1".
"NUM THREADS"sizeof( dword )Number of threads. 0 = automatic.
"STOP TIME"sizeof( dword )Render time in seconds.
"SAMPLING LEVEL"sizeof( float )Target sampling level.
"USE MULTILIGHT"sizeof( byte )0 = No multilight; 1 = Intensity multilight; 2 = Intensity + Color multilight.
"SAVE LIGHTS IN SEPARATE FILES"sizeof( byte )0 = no, 1 = yes.
"MXI FULLNAME"0const char* that specifies the MXI path.
"DO NOT SAVE MXI FILE"sizeof( byte )0 = no, 1 = yes.
"DO NOT SAVE IMAGE FILE"sizeof( byte )0 = no, 1 = yes.
"RENAME AFTER SAVING"sizeof( byte )0 = no, 1 = yes.
"COPY MXI AFTER RENDER"0const char* that specifies the MXI path where output will be copied.
"COPY IMAGE AFTER RENDER"0const char* that specifies the image path where output will be copied.
"REMOVE FILES AFTER COPY"sizeof( byte )0 = no, 1 = yes.
"DO MOTION BLUR"sizeof( byte )0 = no, 1 = yes.
"DO DISPLACEMENT"sizeof( byte )0 = no, 1 = yes.
"DO DISPERSION"sizeof( byte )0 = no, 1 = yes.
"DO DIFFUSE LAYER"sizeof( byte )0 = no, 1 = yes.
"DO REFLECTION LAYER"sizeof( byte )0 = no, 1 = yes.
"DO DIRECT LAYER"sizeof( byte )0 = no, 1 = yes.
"DO INDIRECT LAYER"sizeof( byte )0 = no, 1 = yes.
"DO DIRECT REFLECTION CAUSTIC LAYER"sizeof( byte )0 = no, 1 = yes.
"DO INDIRECT REFLECTION CAUSTIC LAYER"sizeof( byte )0 = no, 1 = yes.
"DO DIRECT REFRACTION CAUSTIC LAYER"sizeof( byte )0 = no, 1 = yes.
"DO INDIRECT REFRACTION CAUSTIC LAYER"sizeof( byte )0 = no, 1 = yes.
"DO RENDER CHANNEL"sizeof( byte )0 = no, 1 = yes.
"DO ALPHA CHANNEL"sizeof( byte )0 = no, 1 = yes.
"OPAQUE ALPHA"sizeof( byte )0 = no, 1 = yes.
"EMBED CHANNELS"sizeof( byte )0 = no, 1 = yes.
"DO IDOBJECT CHANNEL"sizeof( byte )0 = no, 1 = yes.
"DO IDMATERIAL CHANNEL"sizeof( byte )0 = no, 1 = yes.
"DO SHADOW PASS CHANNEL"sizeof( byte )0 = no, 1 = yes.
"DO MOTION CHANNEL"sizeof( byte )0 = no, 1 = yes.
"DO ROUGHNESS CHANNEL"sizeof( byte )0 = no, 1 = yes.
"DO FRESNEL CHANNEL"sizeof( byte )0 = no, 1 = yes.
"DO NORMALS CHANNEL"sizeof( byte )0 = no, 1 = yes.
"NORMALS CHANNEL SPACE"sizeof( byte )0 = world space (default ); 1 = camera space.
"POSITION CHANNEL SPACE"sizeof( byte )0 = world space (default ); 1 = camera space.
"MOTION CHANNEL TYPE"sizeof( byte )0 = RealSmart
"DO POSITION CHANNEL"sizeof( byte )0 = no, 1 = yes.
"DO ZBUFFER CHANNEL"sizeof( byte )0 = no, 1 = yes.
"ZBUFFER RANGE"2 * sizeof( real )Two values: z-near and z-far.
"DO DEVIGNETTING"sizeof( byte )0 = no, 1 = yes.
"DEVIGNETTING"sizeof( byte )Devignetting value. Range: 0-100.
"DO SCATTERING_LENS"sizeof( real )Range: 0-1
"DO SHARPNESS"sizeof( byte )0 = no, 1 = yes.
"SHARPNESS"sizeof( byte )Sharpness value. Range: 0-100.

Return value

C++

0 = Error getting/setting render parameter.

1 = Success.

Python
  • Setting parameter:

0 = Error setting render parameter.

1 = Success.

  • Getting parameter:

Parameter value.

Anchor
gettonemapping
gettonemapping

getToneMapping

Gets the tonemapping values.

LanguageSyntax
C++byte getToneMapping( real& monitorGamma, real& burn )
Python(float monitorGamma, float burn) getToneMapping()

Return value

C++

0 = Error getting tonemapping value.

1 = Success.

Python

Tuple containing 'monitorGamma' and 'burn' values.

Anchor
settonemapping
settonemapping

setToneMapping

Sets the tonemapping values.

LanguageSyntax
C++byte setToneMapping( real monitorGamma, real burn )
Pythonint setToneMapping( float monitorGamma, float burn )

Return value

0 = Error setting tonemapping value.

1 = Success.

Anchor
getactivetonemapping
getactivetonemapping

getActiveToneMapping

Gets the active tonemapping used: "BASIC" or "ADVANCED", default "BASIC" (Extensions only use "BASIC").

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

Anchor
readmxs
readmxs

readMXS

Read scene from disk.

LanguageSyntax
C++byte readMXS( const char* pPath, const Cmaxwell::CoptionsReadMXS& mxsOptions = CoptionsReadMXS() )
Pythonint readMXS( str pPath, CoptionsReadMXS mxsOptions = CoptionsReadMXS() )

Parameters

TypeNameIn/OutDescription
const char*pPathinMXS file name.
Cmaxwell::CoptionsReadMXSmxsOptionsinRead options. Useful to skip, in example, meshes in huge scenes.

Return values

0 = Error reading scene.

1 = Success.

Anchor
writemxs
writemxs

writeMXS

Write the scene to disk.

LanguageSyntax
C++byte writeMXS( const char* pPath = NULL )
Pythonint writeMXS( str pPath )

Return value

0 = Error writing scene to disk.

1 = Success.

Anchor
setdiffraction
setdiffraction

setDiffraction

Sets diffraction parameters.

LanguageSyntax
C++byte setDiffraction( real intensity, real frequency, const char* pApperture, const char* pObstacle = NULL )
Pythonint setDiffraction( float intensity, float frequency, str pAperture, str pObstacle = 0 )

Parameters

TypeNameIn/OutDescription
realintensityinDiffraction intensity.
realfrequencyinDiffraction frequency.
const char*pAppertureinDiffraction apperture map path.
const char*pObstacleinDiffraction obstacle map path.

Return value

0 = Error setting diffraction parameters.

1 = Success.

Anchor
getdiffraction
getdiffraction

getDiffraction

Gets diffraction parameters.

LanguageSyntax
C++byte getDiffraction( bool& isEnabled, real& intensity, real& frequency, const char** pApperture, const char** pObstacle )
Python

(bool isEnabled, float intensity, float frequence, str aperture, str obstacle) getDiffraction()

Parameters

TypeNameIn/OutDescription
boolisEnabledoutDiffraction state (enabled/disabled).
realintensityoutDiffraction intensity.
realfrequencyoutDiffraction frequency.
const char*pAppertureoutDiffraction apperture map path.
const char*pObstacleoutDiffraction obstacle map path.

Return value

C++

0 = Error getting diffraction parameters.

1 = Success.

Python

Tuple containing all diffraction parameters.

Anchor
enablediffraction
enablediffraction

enableDiffraction

Enables diffraction.

LanguageSyntax
C++byte enableDiffraction()
Pythonint enableDiffraction()

Return value

0 = Error enabling diffraction.

1 = Success.

Anchor
disablediffraction
disablediffraction

disableDiffraction

Disables diffraction.

LanguageSyntax
C++Cmaxwell::Cmaterial createMaterial( const char* pMaterialName, bool addToScene = true byte disableDiffraction()
PythonCmaxwellMaterial createMaterial( str pMaterialName, bool addToScene = True int disableDiffraction()

Return value

Returns a Cmaxwell::Cmaterial object. Null if it was not created (Cmaxwell::Cmaterial::isNull() = true)0 = Error disabling diffraction.

1 = Success.

Anchor
getmaterialsetcolorspacegetmaterial
setcolorspace

getMaterial

...

setColorSpace

Sets the output color space used by the render engine.

Cmaxwell::Cmaterial getMaterial( const char* pMaterialName
LanguageSyntax
C++
byte setColorSpace( dword type )
Python
CmaxwellMaterial getMaterial( str pMaterialName )

Return value

Returns a Cmaxwell::Cmaterial object. Null if it was not created (Cmaxwell::Cmaterial::isNull() = true).

...

addMaterial

...

int setColorSpace( int type )

Parameters

TypeNameIn/OutDescription
dwordtypeinColor space selected. See COLOR_SPACES enum.

Return value

0 = Error setting color space.

1 = Success.

Anchor
getcolorspace
getcolorspace

getColorSpace

Gets the output color space used by the render engine.

LanguageSyntax
C++Cmaxwell::Cmaterial addMaterial( Cmaxwell::Cmaterial& material void getColorSpace( dword& type )
PythonCmaxwellMaterial addMaterialint getColorSpace( CmaxwellMaterial material )

Return value

Returns a Cmaxwell::Cmaterial object. Null if it was not created (Cmaxwell::Cmaterial::isNull() = true).

...

eraseUnusedMaterials

Removes unused materials from the scene.

LanguageSyntax
C++byte eraseUnusedMaterials()
Pythonint eraseUnusedMaterials()

Return value

0 = Error erasing unused materials.

1 = Success.

...

setOverrideMaterial

...

Parameters

TypeNameIn/OutDescription
dwordtypeout(C++) Color space used. See COLOR_SPACES enum.

Return value

Python

Color space used. See COLOR_SPACES enum.

Anchor
getcolorspacegamma
getcolorspacegamma

getColorSpaceGamma

Returns the gamma used by the active color space.

LanguageSyntax
C++void setOverrideMaterial( const char* pPathMaterial )
 void setOverrideMaterial( bool enabled )
Pythonvoid setOverrideMaterial( str pPathMaterial )
 void setOverrideMaterial( bool enabled )

Parameters

TypeNameIn/OutDescription
const char*pPathMaterialinMXM file name of the override material.
boolenabledinSets override material state (enabled/disabled).

...

getOverrideMaterial

...

real getColorSpaceGamma()
Pythonfloat getColorSpaceGamma()

Anchor
getlasterror
getlasterror

getLastError

Returns the latest error occurred, Cerror is defined in error.h. Useful for finding out i/o problems when reading/writing MXS/MXI files.

LanguageSyntax
C++Cerror::error getLastError()
Pythonint getLastError()

Anchor
getlasterrorstring
getlasterrorstring

getLastErrorString

Returns an human readable string containing the latest error occurred.

void getOverrideMaterial( bool& enabled
LanguageSyntax
C++const char* getOverrideMaterial() +const char* getLastErrorString()
Pythonstr getOverrideMaterial()
 bool getOverrideMaterialEnabled()

Return value

Requesting override material: File name of the MXM.

...

getLastErrorString()

Anchor
setdefaultmaterialgetdependenciessetdefaultmaterial
getdependencies

setDefaultMaterial

...

getDependencies

Returns an array of strings (length and content) with all the extern dependencies of the scene (textures, ior files, hdr files, etc).

void setDefaultMaterial( bool enabled void setDefaultMaterial( bool enabled
LanguageSyntax
C++
void setDefaultMaterial( const char* pPathMaterial ) 
byte getDependencies( dword& numDependencies, char**& paths )
 
Python
void setDefaultMaterial( str pPathMaterial )
str[] getDependencies()

Parameters

const pPathMaterialinSets default material state (enabled/disabled)
TypeNameIn/OutDescription
dwordnumDependenciesoutNumber of dependencies.
char**
paths
out
MXM file name of the default material.boolenabledin
Dependencies' file names.

Return value

C++

0 = Error getting dependencies.

1 = Success.

Python

String list containing all the dependencies.

Anchor
getdefaultmaterialgetobjectscountgetdefaultmaterial
getobjectscount

...

getObjectsCount

Gets the path and state (enabled/disabled) of the material that will be used for all the objects/triangles without materialReturns the number of objects in the scene.

void getDefaultMaterial( bool& enabled str getDefaultMaterial
LanguageSyntax
C++
const char* getDefaultMaterial() 
byte getObjectsCount( dword& nObjects )
Python
int getObjectsCount()
 bool getDefaultMaterialEnabled()

Return value

Requesting default material: File name of the MXM.

...

Return value

C++

0 = Error getting objects count.

1 = Success.

Python

Number of objects.

Anchor
getsetrenderparametergetmaterialscountgetsetrenderparameter
getmaterialscount

getRenderParameter, setRenderParameter

Gets/sets the value of the render parameter given by name.

...

getMaterialsCount

Returns the number of materials in the scene.

setRenderParameter str pParameterName, value
LanguageSyntax
C++byte getMaterialsCount( dword& nMaterials )
Pythonint
getMaterialsCount(
)
 value getRenderParameter( str pParameterName )

Parameters

TypeNameIn/OutDescription
const char*pParameterNameinParameter name (see pParameterValue for parameter name list).
dwordsizein

Size of the parameter in bytes (see pParameterValue to view sizes by parameter).

Note: parameter size is not needed in Python.

void*pParameterValuein/out

Parameter value, according to the following correspondences:

Parameter nameSizeValue
"ENGINE"sizeof( char ) * 3Selects render engine. "RS0" or "RS1".
"NUM THREADS"sizeof( dword )Number of threads. 0 = automatic.
"STOP TIME"sizeof( dword )Render time in seconds.
"SAMPLING LEVEL"sizeof( float )Target sampling level.
"USE MULTILIGHT"sizeof( byte )0 = No multilight; 1 = Intensity multilight; 2 = Intensity + Color multilight.
"SAVE LIGHTS IN SEPARATE FILES"sizeof( byte )0 = no, 1 = yes.
"MXI FULLNAME"0const char* that specifies the MXI path.
"DO NOT SAVE MXI FILE"sizeof( byte )0 = no, 1 = yes.
"DO NOT SAVE IMAGE FILE"sizeof( byte )0 = no, 1 = yes.
"RENAME AFTER SAVING"sizeof( byte )0 = no, 1 = yes.
"COPY MXI AFTER RENDER"0const char* that specifies the MXI path where output will be copied.
"COPY IMAGE AFTER RENDER"0const char* that specifies the image path where output will be copied.
"REMOVE FILES AFTER COPY"sizeof( byte )0 = no, 1 = yes.
"DO MOTION BLUR"sizeof( byte )0 = no, 1 = yes.
"DO DISPLACEMENT"sizeof( byte )0 = no, 1 = yes.
"DO DISPERSION"sizeof( byte )0 = no, 1 = yes.
"DO DIRECT LAYER"sizeof( byte )0 = no, 1 = yes.
"DO INDIRECT LAYER"sizeof( byte )0 = no, 1 = yes.
"DO DIRECT REFLECTION CAUSTIC LAYER"sizeof( byte )0 = no, 1 = yes.
"DO INDIRECT REFLECTION CAUSTIC LAYER"sizeof( byte )0 = no, 1 = yes.
"DO DIRECT REFRACTION CAUSTIC LAYER"sizeof( byte )0 = no, 1 = yes.
"DO INDIRECT REFRACTION CAUSTIC LAYER"sizeof( byte )0 = no, 1 = yes.
"DO RENDER CHANNEL"sizeof( byte )0 = no, 1 = yes.
"DO ALPHA CHANNEL"sizeof( byte )0 = no, 1 = yes.
"OPAQUE ALPHA"sizeof( byte )0 = no, 1 = yes.
"EMBED CHANNELS"sizeof( byte )0 = no, 1 = yes.
"DO IDOBJECT CHANNEL"sizeof( byte )0 = no, 1 = yes.
"DO IDMATERIAL CHANNEL"sizeof( byte )0 = no, 1 = yes.
"DO SHADOW PASS CHANNEL"sizeof( byte )0 = no, 1 = yes.
"DO MOTION CHANNEL"sizeof( byte )0 = no, 1 = yes.
"DO ROUGHNESS CHANNEL"sizeof( byte )0 = no, 1 = yes.
"DO FRESNEL CHANNEL"sizeof( byte )0 = no, 1 = yes.
"DO NORMALS CHANNEL"sizeof( byte )0 = no, 1 = yes.
"NORMALS CHANNEL SPACE"sizeof( byte )0 = world space (default ); 1 = camera space.
"POSITION CHANNEL SPACE"sizeof( byte )0 = world space (default ); 1 = camera space.
"MOTION CHANNEL TYPE"sizeof( byte )0 = RealSmart
"DO POSITION CHANNEL"sizeof( byte )0 = no, 1 = yes.
"DO ZBUFFER CHANNEL"sizeof( byte )0 = no, 1 = yes.
"ZBUFFER RANGE"2 * sizeof( real )Two values: z-near and z-far.
"DO DEVIGNETTING"sizeof( byte )0 = no, 1 = yes.
"DEVIGNETTING"sizeof( byte )Devignetting value. Range: 0-100.
"DO SCATTERING_LENS"sizeof( real )Range: 0-1
"DO SHARPNESS"sizeof( byte )0 = no, 1 = yes.
"SHARPNESS"sizeof( byte )Sharpness value. Range: 0-100.

...

Return value

C++

0 = Error getting materials count.

1 = Success.

Python

Number of materials.

Anchor
getcamerascount
getcamerascount

getCamerasCount

Returns the number of cameras in the scene.

LanguageSyntax
C++byte getCamerasCount( dword& nCameras )
Pythonint getCamerasCount()

Return value

C++

0 = Error getting cameras count.

1 = Success.

Python

Number of cameras.

Anchor
getsceneinfo
getsceneinfo

getSceneInfo

Returns by reference a CsceneInfo structure with information about the scene.

LanguageSyntax
C++byte getSceneInfo( CsceneInfo& info )
PythonCsceneInfo getSceneInfo()

Return value

C++

0 = Error getting scene info.

1 = Success.

Python

Structure containing the scene info.

Anchor
computefresnelgraph
computefresnelgraph

computeFresnelGraph

Computes the reflectance as a function of the angle of incidence.

LanguageSyntax
C++void computeFresnelGraph( float* pX, float* pY, dword n, real iorOutgoing )
Pythonarray list[2] computeFresnelGraph( int n, float ioirOutgoing )

Parameters

TypeNameIn/OutDescription
float*pXoutFloat array of size 'n' containing the angle of incidence (from 0 to Pi/2). It must be allocated before call computeFresnelGraph.
float*pYoutFloat array of size 'n' containing the reflectance graph (from 0 to 1). It must be allocated before call computeFresnelGraph.
dwordninSize of pX and pY float vectors.
realiorOutgoinginRefraction index of the material.

Return value

Python

List containing both (pX and pY) vectors as NumPy arrays.

Anchor
computeabbegraph
computeabbegraph

computeAbbeGraph

Computes the reflectance as a function of the spectral input.

LanguageSyntax
C++void computeAbbeGraph( float* pX, float* pY, dword n, real nd, real abbe )
Pythonarray list[2] computeAbbeGraph( int n, float nd, float abbe )

Parameters

TypeNameIn/OutDescription
float*pXoutFloat array of size 'n' containing the spectral range (in nm). It must be allocated before call computeAbbeGraph (C++).
float*pYoutFloat array of size 'n' containing the spectral IOR. It must be allocated before call computeAbbeGraph (C++).
dwordninSize of pX and pY float vectors.
realndinRefraction index.
realabbeinAbbe number of the material.

Return value

Python

List containing both (pX and pY) vectors as NumPy arrays.

Anchor
getcorrelatedcolortemperature
getcorrelatedcolortemperature

getCorrelatedColorTemperature

Gets the correlated RGB values given the temperature color.

LanguageSyntax
C++byte getCorrelatedColorTemperature( Crgb& rgb, real temperature )
PythonCrgb getCorrelatedColorTemperature( float temperature )

Return value

C++

0 = Error getting correlated Crgb. i.e. a negative temperature passed as input.

1 = Success.

Python

Crgb color correlated to the temperature color passed as input.

Anchor
generateuuid
generateuuid

generateUuid

Generates a free uuid useful for storing unique identifiers in scene entities using setUuid() method. The caller owns the pointer passed as argument. It is responsability of the caller to allocate and destroy the passed pointer.

LanguageSyntax
C++byte generateUuid( char** uuid )
Pythonstr generateUuid()

Return value

C++

0 = Error generating unique ID.

1 = Success.

Python

String containing the unique ID.

Anchor
searchfileincommonpaths
searchfileincommonpaths

searchFileInCommonPaths

Looks for the given file in all of the searching paths of the scene.

LanguageSyntax
C++byte searchFileInCommonPaths( const char* fileToSearch, char*& newFoundFile )
Pythonstr searchFileInCommonPaths( str fileToSearch )

Parameters

TypeNameIn/OutDescription
const char*fileToSearchinFile to search.
char*newFoundFileoutFile name of the found file.

Return value

C++

0 = Error getting/setting render parameterFile not found.

1 = SuccessFile founded and returned in newFoundFile.

Python

...

0 =

...

1 = Success.

  • Getting parameter:

Parameter value.

...

readMXS

...

File not found.

String containing found file name.

Anchor
getengineversion
getengineversion

getEngineVersion

Returns the current version of Maxwell.

LanguageSyntax
C++void getEngineVersion( char pVersion[64] )
Pythonstr getEngineVersion()

Anchor
getsdkversion
getsdkversion

getSdkVersion

Returns the current version of the Maxwell SDK.

byte readMXS const char* pPath, const Cmaxwell::CoptionsReadMXS& mxsOptions = CoptionsReadMXS() int readMXS( str pPath, CoptionsReadMXS mxsOptions = CoptionsReadMXS()
LanguageSyntax
C++
void getSdkVersion(
char pVersion[64] )
 int getSdkVersion()
Python
str getSdkVersionString()

Parameters

TypeNameIn/OutDescription
const char*pPathinMXS file name.
Cmaxwell::CoptionsReadMXSmxsOptionsinRead options. Useful to skip, in example, meshes in huge scenes.

Return values

0 = Error reading scene.

1 = Success.

...

writeMXS

...

 int getSdkVersion()

Anchor
isdepthsupportedforthisformat
isdepthsupportedforthisformat

isDepthSupportedForThisFormat

Returns true if for the given extension the depth is valid. In example:

  • isDepthSupportedForThisFormat( "exr", 32 ) returns true.
  • isDepthSupportedForThisFormat( "jpg", 16 ) returns false.
LanguageSyntax
C++byte writeMXSbool isDepthSupportedForThisFormat( const char* pPath = NULL extension, byte bitDepth )
Pythonint writeMXSbool isDepthSupportedForThisFormat( str pPath extension, int bitDepth )

Return value

0 = Error writing scene to disk.

1 = Success.

...

setDiffraction

Sets diffraction parameters

Anchor
gethighestdepthsupportedforthisformat
gethighestdepthsupportedforthisformat

getHighestDepthSupportedForThisFormat

Returns the highest bits per plane supported for the given format. In example:

  • getHighestDepthSupportedForThisFormat( "exr" ) returns 32.
  • getHighestDepthSupportedForThisFormat( "jpg" ) returns 8.
LanguageSyntax
C++byte setDiffraction( real intensity, real frequency, isDepthSupportedForThisFormat( const char* pApperture, const char* pObstacle = NULL extension )
Pythonint setDiffraction( float intensity, float frequency, str pAperture, str pObstacle = 0 )

Parameters

TypeNameIn/OutDescription
realintensityinDiffraction intensity.
realfrequencyinDiffraction frequency.
const char*pAppertureinDiffraction apperture map path.
const char*pObstacleinDiffraction obstacle map path.

Return value

0 = Error setting diffraction parameters.

1 = Success.

...

getDiffraction

...

isDepthSupportedForThisFormat( str extension )

Anchor
isembeddingalphasupportedforthisformat
isembeddingalphasupportedforthisformat

isEmbeddingAlphaSupportedForThisFormat

Returns true if for the given format it is possible embedding the alpha channel.

  • isEmbeddingAlphaSupportedForThisFormat( "tga" ) returns true.
  • isEmbeddingAlphaSupportedForThisFormat( "jpg" ) returns false.
LanguageSyntax
C++byte isEmbeddingAlphaSupportedForThisFormat( const char* extension )
Pythonint isEmbeddingAlphaSupportedForThisFormat( str extension )

Anchor
isembeddingallchannelssupportedforthisformat
isembeddingallchannelssupportedforthisformat

isEmbeddingAllChannelsSupportedForThisFormat

Returns true if for the given format it is possible embedding all channels in a multilayer file.

  • isEmbeddingAllChannelsSupportedForThisFormat( "tif" ) returns true.
  • isEmbeddingAllChannelsSupportedForThisFormat( "exr" ) returns true.
  • rest of formats : returns false.
getDiffraction( bool& isEnabled, real& intensity, real& frequency, * pApperture, const char** pObstacle )
LanguageSyntax
C++byte
isEmbeddingAllChannelsSupportedForThisFormat( const char*
Python

{ bool 'isEnabled', float 'intensity', float 'frequence', str 'aperture', str 'obstacle' } getDiffraction()

Parameters

TypeNameIn/OutDescription
boolisEnabledoutDiffraction state (enabled/disabled).
realintensityoutDiffraction intensity.
realfrequencyoutDiffraction frequency.
const char*pAppertureoutDiffraction apperture map path.
const char*pObstacleoutDiffraction obstacle map path.

Return value

C++

0 = Error getting diffraction parameters.

1 = Success.

Python

Dictionary containing all diffraction parameters.

...

getLastError

Returns the latest error occurred, Cerror is defined in error.h. Useful for finding out i/o problems when reading/writing MXS/MXI files.

LanguageSyntax
C++Cerror::error getLastError()
Pythonint getLastError()

...

getLastErrorString

Returns an human readable string containing the latest error occurred.

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

...

getDependencies

...

extension )
Pythonint isEmbeddingAllChannelsSupportedForThisFormat( str extension )

Anchor
istextureextensionsupported
istextureextensionsupported

isTextureExtensionSupported

Returns true if the extension of the given texture path is supported by the render engine.

LanguageSyntax
C++byte isTextureExtensionSupported( const char* extension )
Pythonint isTextureExtensionSupported( str extension )

Anchor
getsquareswatchies
getsquareswatchies

getSquareSwatchIES

Used to get the IES/EULUM emission pattern plotted into a square rgb buffer of size "resolution". The caller is responsible of freeing the buffer "buf" after using it.

LanguageSyntax
C++byte getSquareSwatchIES( const char* file, int resolution, unsigned char*& buf )
Pythonlist getSquareSwatchIES( str file, int resolution )

Parameters

TypeNameIn/OutDescription
const char*fileinIES/EULUM file name.
intresolutioninResolution requested. Output buffer will have resolution * resolution * 3 values.
unsigned char*&bufoutOutput buffer containing the emission patter.

Return value

C++

0 = Error getting IES/EULUM emission pattern.

1 = Success.

Python

List of size = resolution * resolution * 3, containing the RGB emission pattern.

Anchor
getsolidlobeies
getsolidlobeies

getSolidLobeIES

Used to get the IES/EULUM emission pattern plotted as a 3d object. The caller is responsible of freeing the buffers "faces, points" after using them.

getDependencies( dword& numDependencies, char**& paths )str[] getDependencies(
LanguageSyntax
C++byte
Python
getSolidLobeIES( const char* fileName, unsigned int& numPoints, unsigned int& numTriangles, unsigned int*& faces, float*& points, const char* pAxisSystem = NULL )
Python

(int numPoints, list points, int numTriangles, list faces) getSolidLobeIES( str filename, str pAxisSystem = "" )

Parameters

TypeNameIn/OutDescription
dwordnumDependenciesoutNumber of dependencies.
char**pathsoutDependencies' file names.

Return value

C++

0 = Error getting dependencies.

1 = Success

Python

String list containing all the dependencies.

...

generateUuid

Generates a free uuid useful for storing unique identifiers in scene entities using setUuid() method. The caller owns the pointer passed as argument. It is responsability of the caller to allocate and destroy the passed pointer.

str generateUuid()
LanguageSyntax
C++byte generateUuid( char** uuid )
Python
const char*fileNameinIES/EULUM file name.
unsigned int&numPointsoutNumber of points returned.
unsigned int&numTrianglesoutNumber of triangles returned.
unsigned int*&facesout0-based indices into points array : v00, v01, v02, v10, v11, v12, .....
float*&pointsoutArray of vertices, x0, y0, z0, x1, y1, z1, .....
const char*pAxisSysteminSame as setInputDataType.

Return value

C++

0 = Error generating unique IDgetting IES/EULUM 3D emission pattern.

1 = Success.

Python

String containing the unique IDTuple containing 'numPoints', 'points', 'numTriangles' and 'faces'.

Anchor
searchfileincommonpathsprintmessagesearchfileincommonpaths
printmessage

searchFileInCommonPaths

...

printMessage

Prints a message in the render console or in the message handler installed. Can be reimplemented in subclasses to install handlers.

byte searchFileInCommonPaths fileToSearch, char*& newFoundFile )str searchFileInCommonPaths( str fileToSearch
LanguageSyntax
C++
virtual void printMessage( const char*
Python
text, const int code )

Parameters

fileToSearchFile to searchchar*
TypeNameIn/OutDescription
const char*
textin
Message.
const int
newFoundFileoutFile name of the found file.

Return value

C++

...

codein

0 = Info.

1 =

...

Error.

Python

0 = File not found.

String containing found file name.

2 = Warning.

Anchor
cmaxwell_typecallback
cmaxwell_typecallback

...

InteractiveFlags

Values of the _interactiveFlags property.

ValueC++Python
0Cmaxwell::ALL_CLEANCmaxwell.ALL_CLEAN
1Cmaxwell::CAMERA_DIRTYCmaxwell.CAMERA_DIRTY
2Cmaxwell::MATERIALS_ASSIGNMENTS_DIRTYCmaxwel.MATERIALS_ASSIGNMENTS_DIRTY
8Cmaxwell::GEOMETRY_DIRTYCmaxwell.GEOMETRY_DIRTY
16Cmaxwell::VOXELIZATION_DIRTYCmaxwell.VOXELIZATION_DIRTY
32Cmaxwell::SKY_OR_HDR_DIRTYCmaxwell.SKY_OR_HDR_DIRTY
64Cmaxwell::DEFAULT_OR_OVERRIDE_MATERIAL_DIRTYCmaxwell.DEFAULT_OR_OVERRIDE_MATERIAL_DIRTY
0x3FCmaxwell::ALL_DIRTYCmaxwell.ALL_DIRTY