Versions Compared

Key

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

The Cmaxwell class describes the whole Maxwell Render scene.

...

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.
getActiveToneMappingGets 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 --TODO--
computeAbbeGraph --TODO--
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 --TODO--
createGeometryProceduralObject --TODO--
applySkyExtension --TODO--
applySceneModifierExtension --TODO--

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 Returns true if for the given format it is possible embedding the alpha channel.
isEmbeddingAllChannelsSupportedForThisFormat isTextureExtensionSupported Returns 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.

...

TypeNameIn/outDescription
const char*pNameinCluster name

Return value

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

...

0 = Error getting dependencies.

1 = Success.

Python

String list containing all the dependencies.

Anchor
generateuuidgetobjectscountgenerateuuid
getobjectscount

generateUuid

...

getObjectsCount

Returns the number of objects in the scene.

LanguageSyntax
C++byte generateUuid( char** uuid getObjectsCount( dword& nObjects )
Pythonstr generateUuidint getObjectsCount()

Return value

C++

0 = Error generating unique IDgetting objects count.

1 = Success.

Python

String containing the unique IDNumber of objects.

Anchor
searchfileincommonpathsgetmaterialscountsearchfileincommonpaths
getmaterialscount

...

getMaterialsCount

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

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

Parameters

File name of the found file
TypeNameIn/OutDescription
const char*fileToSearchinFile to search.
char*newFoundFileout
getMaterialsCount( dword& nMaterials )
Pythonint getMaterialsCount()

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 )
Pythondict getSceneInfo()

Return value

C++

0 = Error getting scene info.

1 = Success.

Python

Dictionary containing the scene info.

Anchor
computefresnelgraph
computefresnelgraph

computeFresnelGraph

--TODO--

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 fresnel graph in the X axis. It must be allocated before call computeFresnelGraph. --TODO--
float*pYoutFloat array of size 'n' containing the fresnel graph in the Y axis. It must be allocated before call computeFresnelGraph. --TODO--
dwordninSize of pX and pY float vectors.
realiorOutgoingin--TODO--

Return value

Python

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

Anchor
computeabbegraph
computeabbegraph

computeAbbeGraph

--TODO--

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 abbe graph in the X axis. It must be allocated before call computeAbbeGraph. --TODO--
float*pYoutFloat array of size 'n' containing the abbe graph in the Y axis. It must be allocated before call computeAbbeGraph. --TODO--
dwordninSize of pX and pY float vectors.
realndin--TODO--
realabbein--TODO--

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 = File not found.

1 = File founded and returned in newFoundFile.

Python

0 = 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.

LanguageSyntax
C++void getSdkVersion( char pVersion[64] )
Pythonstr 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++bool isDepthSupportedForThisFormat( const char* extension, byte bitDepth )
Pythonbool isDepthSupportedForThisFormat( str extension, int bitDepth )

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 isDepthSupportedForThisFormat( const char* extension )
Pythonint 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.
LanguageSyntax
C++byte isEmbeddingAllChannelsSupportedForThisFormat( const char* 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.

LanguageSyntax
C++byte getSolidLobeIES( const char* fileName, unsigned int& numPoints, unsigned int& numTriangles, unsigned int*& faces, float*& points, const char* pAxisSystem = NULL )
Pythondict getSolidLobeIES( str filename, str pAxisSystem = "" )

Parameters

TypeNameIn/OutDescription
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 = File not foundError getting IES/EULUM 3D emission pattern.

1 = File founded and returned in newFoundFileSuccess.

Python

0 = File not found.String containing found file nameDictionary containing 'numPoints', 'points', 'numTriangles' and 'faces'.

Anchor
cmaxwell_typecallback
cmaxwell_typecallback

...

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

...