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.
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.
getSceneInfoReturns by reference a Cmaxwell::CsceneInfo structure with information about the scene.
computeFresnelGraph 
computeAbbeGraph 
getCorrelatedColorTemperature 
generateUuidGenerates an unique ID.
searchFileInCommonPathsLooks for the given file in all of the searching paths of the scene.
createGeometryLoaderObject 
createGeometryProceduralObject 
applySkyExtension 
applySceneModifierExtension 

...

TypeNameIn/outDescription
const char*pNameinCluster name

Return value

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

...

  • Getting parameter:

Parameter value.

Anchor
readmxsgettonemappingreadmxs
gettonemapping

readMXS

...

getToneMapping

Gets the tonemapping values.

LanguageSyntax
C++byte readMXS( const char* pPath, const Cmaxwell::CoptionsReadMXS& mxsOptions = CoptionsReadMXS() getToneMapping( real& monitorGamma, real& burn )
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

...

dict getToneMapping()

Return value

C++

0 = Error getting tonemapping value.

1 = Success.

Python

Dictionary 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
writemxsgetactivetonemappingwritemxs
getactivetonemapping

...

getActiveToneMapping

Write the scene to diskGets the active tonemapping used: "BASIC" or "ADVANCED", default "BASIC" (Extensions only use "BASIC").

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

Return value

0 = Error writing scene to disk.

1 = Success.

...

setDiffraction

Sets diffraction parameters

Anchor
readmxs
readmxs

readMXS

Read scene from disk.

LanguageSyntax
C++byte setDiffraction( real intensity, real frequency, readMXS( const char* pApperturepPath, const char* pObstacle = NULL Cmaxwell::CoptionsReadMXS& mxsOptions = CoptionsReadMXS() )
Pythonint setDiffraction( float intensity, float frequency, str pAperture, str pObstacle = 0 readMXS( str pPath, CoptionsReadMXS mxsOptions = CoptionsReadMXS() )

Parameters

TypeNameIn/OutDescription
realconst char*intensitypPathinDiffraction intensityMXS file name.real
frequencyCmaxwell::CoptionsReadMXSmxsOptionsinDiffraction frequency.
const char*pAppertureinDiffraction apperture map path.
const char*pObstacleinDiffraction obstacle map path.Read 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 setting diffraction parameterswriting scene to disk.

1 = Success.

Anchor
getdiffractionsetdiffractiongetdiffraction
setdiffraction

...

setDiffraction

Gets Sets diffraction parameters.

LanguageSyntax
C++byte getDiffractionsetDiffraction( bool& isEnabled, real & intensity, real & frequency, const char* * pApperture, const char* * pObstacle = NULL )
Python{ bool 'isEnabled', float 'intensity', float 'frequence', str 'aperture', str 'obstacle' } getDiffraction()int setDiffraction( float intensity, float frequency, str pAperture, str pObstacle = 0 )

Parameters

isEnabledoutoutoutout
TypeNameIn/OutDescription
bool
outDiffraction state (enabled/disabled).
realintensity
inDiffraction intensity.
realfrequency
inDiffraction frequency.
const char*pApperture
inDiffraction apperture map path.
const char*pObstacle
inDiffraction obstacle map path.

Return value

C++

...

0 = Error

...

setting diffraction parameters.

1 = Success.

...

Python

...

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

Dictionary 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++byte disableDiffraction()
Pythonint disableDiffraction()

Return value

0 = Error disabling diffraction.

1 = Success.

Anchor
setcolorspace
setcolorspace

setColorSpace

Sets the output color space used by the render engine.

LanguageSyntax
C++byte setColorSpace( dword type )
Pythonint 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++void getColorSpace( dword& type )
Pythonint getColorSpace()

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++real getColorSpaceGamma()
Pythonfloat getColorSpaceGamma()

Anchor
getlasterror
getlasterror

...

LanguageSyntax
C++byte getDependencies( dword& numDependencies, char**& paths )
Pythonstr[] getDependencies()

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.

...

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

Return value

C++

0 = Error generating unique ID.

1 = Success.

Python

String containing the unique ID.

...

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.

...