The Cmaxwell class describes the whole Maxwell Render scene.
...
typeCallback and InteractiveFlags.
Methods
Name | Description |
---|---|
Cmaxwell | Class constructor. |
~Cmaxwell | Class destructor. |
getMxsVersion | Gets MXS file version. |
getMostRecentVersionMXS | Gets most recent MXS version supported. |
getPluginID | Gets the plug-in identifier from which the MXS was created. |
setPluginID | Gets the plug-in identifier from which the MXS was created. |
isProtectionEnabled | Gets scene protection state in Maxwell Studio (ability to export to other formats). |
enableProtection | Sets scene protection state in Maxwell Studio (ability to export to other formats). |
Scene methods | |
freeGeometry | Deletes all geometry of the scene. |
freeScene | Resets the scene. Cleans all objects, geometry, materials, etc. |
getScenePreview | Preview image of the scene stored in the file (useful for thumbnals). |
setScenePreview | Sets preview image. |
readPreview | Sets sene preview image from another MXS --TODO--. |
setInputDataType | Set the axis orientation of the scene. |
setSinglePrecisionOfGeometry | Uses floats instead of doubles for geometry. |
setSceneUserData | Internal use. |
addCluster | Adds a triangle cluster to the scene. |
Object methods | |
getObject | Gets a object reference from the scene. |
createMesh | Creates a mesh with the given parameters and adds it to the scene. |
createInstancement | Creates an instancement. |
createProxy | Creates a proxy object from a MXS. |
createRFRK | Creates a RealFlow RenderKit object. |
addObject | Adds an existent object to the scene. |
mergeMeshes | Merges meshes into a new one. |
Camera methods | |
addCamera | Adds a new camera to the scene with the given parameters. |
getCamera | Gets a camera requested by name. |
getActiveCamera | Gets the active camera of the scene. |
Paths methods | |
setPath | Sets the path and depth for the given channel. |
getPath | Gets the path and depth for the given channel. |
addSearchingPath | Adds a path to look for missing textures, ior and ies files. |
getSearchingPaths | Gets all searching paths of the scene. |
Sky methods | |
getSunPositionType | Sets sun position type. |
setSunPositionType | Gets sun position type. |
getSkyConstant | Gets the parameters of the constant sky. |
setSkyConstant | Sets the parameters of the constant sky. |
getSunLongitudeAndLatitude | Gets sun longitude and latitude data. |
setSunLongitudeAndLatitude | Sets sun longitude and latitude data. |
getSunAngles | Gets sun position angles. |
setSunAngles | Sets sun position angles. |
getSunDirection | Gets sun direction vector. |
setSunDirection | Sets sun direction vector. |
getSunRotation | Gets sun rotation angles. |
setSunRotation | Sets sun rotation angles. |
getSunProperties | Gets sun properties |
setSunProperties | Sets sun properties. |
getPhysicalSkyAtmosphere | Gets physical atmosphere parameters. |
setPhysicalSkyAtmosphere | Sets physical atmosphere parameters. |
getActiveSky | Gets active sky name. |
setActiveSky | Sets active sky name. |
Additional sky methods | |
getSunDirectionUsedForRendering | Returns the sun direction. |
saveSkyToHDR | Saves current sky to an HDR file. |
saveSkyToPreset | Saves current physical sky values to a file. |
loadSkyFromPreset | Loads a preset file replacing current physical sky values. |
getSkyColor | Returns sky RGB color of the current sky values in the given direction. |
getSkyColorNoTonemapped | Returns sky RGB color (without tonemapping nor exposure) of the current sky values in the given direction. |
Environment methods | |
isEnvironmentEnabled | Gets IBL (Image Based Lighting) state. |
enableEnvironment | Sets the IBL (Image Based Lighting) on/off. |
getEnvironmentWeight | Gets the value for the global multiplier of all the environment layers. |
setEnvironmentWeight | Sets the value for the global multiplier of all the environment layers. |
getEnvironmentLayer | Gets the parameters of each environment layer. |
setEnvironmentLayer | Sets the parameters of each environment layer. |
Material methods | |
readMaterial | Reads a material from file (MXM). |
createMaterial | Creates a new material. |
getMaterial | Gets a material by name. |
addMaterial | Adds a material to the scene. |
eraseUnusedMaterials | Remove unused materials from the scene. |
setOverrideMaterial | Sets the path and state (enabled/disabled) of the material that overrides all materials of the scene (except emitter materials). |
getOverrideMaterial | gets the path and state (enabled/disabled) of the material that overrides all materials of the scene (except emitter materials). |
setDefaultMaterial | Sets the path and state (enabled/disabled) of the material that will be used for all the objects/triangles without material. |
getDefaultMaterial | Gets the path and state (enabled/disabled) of the material that will be used for all the objects/triangles without material. |
Render methods | |
setRenderParameter | Sets render parameter. |
getRenderParameter | Gets render parameter. |
Tonemapping methods | |
getToneMapping | Gets tonemapping values. |
setToneMapping | Sets tonemapping values. |
getActiveToneMappingDeprecated | Gets the active tonemapping used ("BASIC" or "ADVANCED" ). |
setAdvancedToneMapping | Deprecated. |
getAdvancedToneMapping | Deprecated. |
Read/write scene methods | |
readMXS | Reads scene from disk. |
writeMXS | Writes scene to disk. |
Glare methods | |
setDiffraction | Sets diffraction parameters. |
getDiffraction | Gets diffraction parameters. |
enableDiffraction | Enables diffraction. |
disableDiffraction | Disables diffraction. |
setColorSpace | Sets the output color space used by the render engine. |
getColorSpace | Gets the output color space used by the render engine. |
getColorSpaceGamma | Returns the gamma used by the active color space. |
Miscellaneous methods | |
getLastError | Returns the latest error occurred. |
getLastErrorString | Returns an human readable string containing the latest error occurred. |
getDependencies | Returns all the extern dependencies of the scene (textures, ior files, hdr files, etc). |
getObjectsCount | Returns the number of objects in the scene. |
getMaterialsCount | Returns the number of materials in the scene. |
getCamerasCount | Returns the number of cameras in the scene. |
getTriangleGroupsCount | Returns the number of triangle groups in the scene. |
getSceneInfo | Returns by reference a Cmaxwell::CsceneInfo structure with information about the scene. |
computeFresnelGraph | |
computeAbbeGraph | |
getCorrelatedColorTemperature | |
generateUuid | Generates an unique ID. |
searchFileInCommonPaths | Looks for the given file in all of the searching paths of the scene. |
createGeometryLoaderObject | |
createGeometryProceduralObject | |
applySkyExtension | |
applySceneModifierExtension |
...
Type | Name | In/out | Description |
---|---|---|---|
const char* | pName | in | Cluster name |
Return value
Returns a Cmaxwell::Ccluster object, that is a reference to the cluster added to the scene.
...
- Getting parameter:
Parameter value.
Anchor | ||||
---|---|---|---|---|
|
readMXS
...
getToneMapping
Gets the tonemapping values.
Language | Syntax |
---|---|
C++ | byte readMXS( const char* pPath, const Cmaxwell::CoptionsReadMXS& mxsOptions = CoptionsReadMXS() getToneMapping( real& monitorGamma, real& burn ) |
Python | int readMXS( str pPath, CoptionsReadMXS mxsOptions = CoptionsReadMXS() ) |
Parameters
Type | Name | In/Out | Description |
---|---|---|---|
const char* | pPath | in | MXS file name. |
Cmaxwell::CoptionsReadMXS | mxsOptions | in | Read 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
Sets the tonemapping values.
Language | Syntax |
---|---|
C++ | byte setToneMapping( real monitorGamma, real burn ) |
Python | int setToneMapping( float monitorGamma, float burn ) |
Return value
0 = Error setting tonemapping value.
1 = Success.
Anchor | ||||
---|---|---|---|---|
|
...
getActiveToneMapping
Write the scene to diskGets the active tonemapping used: "BASIC" or "ADVANCED", default "BASIC" (Extensions only use "BASIC").
Language | Syntax |
---|---|
C++ | byte writeMXS( const char* pPath = NULL getActiveToneMapping() |
Python | int writeMXSstr getActiveToneMapping( str pPath ) |
Return value
0 = Error writing scene to disk.
1 = Success.
...
setDiffraction
Sets diffraction parameters
Anchor | ||||
---|---|---|---|---|
|
readMXS
Read scene from disk.
Language | Syntax |
---|---|
C++ | byte setDiffraction( real intensity, real frequency, readMXS( const char* pApperturepPath, const char* pObstacle = NULL Cmaxwell::CoptionsReadMXS& mxsOptions = CoptionsReadMXS() ) |
Python | int setDiffraction( float intensity, float frequency, str pAperture, str pObstacle = 0 readMXS( str pPath, CoptionsReadMXS mxsOptions = CoptionsReadMXS() ) |
Parameters
Type | Name | In/Out | Description | |
---|---|---|---|---|
realconst char* | intensitypPath | in | Diffraction intensityMXS file name. | real |
frequencyCmaxwell::CoptionsReadMXS | mxsOptions | in | Diffraction frequency. | |
const char* | pApperture | in | Diffraction apperture map path. | |
const char* | pObstacle | in | Diffraction obstacle map path.Read options. Useful to skip, in example, meshes in huge scenes. |
Return values
0 = Error reading scene.
1 = Success.
Anchor | ||||
---|---|---|---|---|
|
writeMXS
Write the scene to disk.
Language | Syntax |
---|---|
C++ | byte writeMXS( const char* pPath = NULL ) |
Python | int writeMXS( str pPath ) |
Return value
0 = Error setting diffraction parameterswriting scene to disk.
1 = Success.
Anchor | ||||
---|---|---|---|---|
|
...
setDiffraction
Gets Sets diffraction parameters.
Language | Syntax |
---|---|
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
Type | Name | In/Out | Description | bool | isEnabled
---|---|---|---|
out | Diffraction state (enabled/disabled). | ||
real | intensity | ||
in | Diffraction intensity. | ||
real | frequency | ||
in | Diffraction frequency. | ||
const char* | pApperture | ||
in | Diffraction apperture map path. | ||
const char* | pObstacle | ||
in | Diffraction obstacle map path. |
Return value
C++
...
0 = Error
...
setting diffraction parameters.
1 = Success.
...
Python
...
Anchor | ||||
---|---|---|---|---|
|
getDiffraction
Gets diffraction parameters.
Language | Syntax |
---|---|
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
Type | Name | In/Out | Description |
---|---|---|---|
bool | isEnabled | out | Diffraction state (enabled/disabled). |
real | intensity | out | Diffraction intensity. |
real | frequency | out | Diffraction frequency. |
const char* | pApperture | out | Diffraction apperture map path. |
const char* | pObstacle | out | Diffraction obstacle map path. |
Return value
C++
0 = Error getting diffraction parameters.
1 = Success.
Python
Dictionary containing all diffraction parameters.
Anchor | ||||
---|---|---|---|---|
|
enableDiffraction
Enables diffraction.
Language | Syntax |
---|---|
C++ | byte enableDiffraction() |
Python | int enableDiffraction() |
Return value
0 = Error enabling diffraction.
1 = Success.
Anchor | ||||
---|---|---|---|---|
|
disableDiffraction
Disables diffraction.
Language | Syntax |
---|---|
C++ | byte disableDiffraction() |
Python | int disableDiffraction() |
Return value
0 = Error disabling diffraction.
1 = Success.
Anchor | ||||
---|---|---|---|---|
|
setColorSpace
Sets the output color space used by the render engine.
Language | Syntax |
---|---|
C++ | byte setColorSpace( dword type ) |
Python | int setColorSpace( int type ) |
Parameters
Type | Name | In/Out | Description |
---|---|---|---|
dword | type | in | Color space selected. See COLOR_SPACES enum. |
Return value
0 = Error setting color space.
1 = Success.
Anchor | ||||
---|---|---|---|---|
|
getColorSpace
Gets the output color space used by the render engine.
Language | Syntax |
---|---|
C++ | void getColorSpace( dword& type ) |
Python | int getColorSpace() |
Parameters
Type | Name | In/Out | Description |
---|---|---|---|
dword | type | out | (C++) Color space used. See COLOR_SPACES enum. |
Return value
Python
Color space used. See COLOR_SPACES enum.
Anchor | ||||
---|---|---|---|---|
|
getColorSpaceGamma
Returns the gamma used by the active color space.
Language | Syntax |
---|---|
C++ | real getColorSpaceGamma() |
Python | float getColorSpaceGamma() |
Anchor | ||||
---|---|---|---|---|
|
...
Language | Syntax |
---|---|
C++ | byte getDependencies( dword& numDependencies, char**& paths ) |
Python | str[] getDependencies() |
Parameters
Type | Name | In/Out | Description |
---|---|---|---|
dword | numDependencies | out | Number of dependencies. |
char** | paths | out | Dependencies' file names. |
Return value
C++
0 = Error getting dependencies.
1 = Success
Python
String list containing all the dependencies.
...
Language | Syntax |
---|---|
C++ | byte generateUuid( char** uuid ) |
Python | str generateUuid() |
Return value
C++
0 = Error generating unique ID.
1 = Success.
Python
String containing the unique ID.
...
Language | Syntax |
---|---|
C++ | byte searchFileInCommonPaths( const char* fileToSearch, char*& newFoundFile ) |
Python | str searchFileInCommonPaths( str fileToSearch ) |
Parameters
Type | Name | In/Out | Description |
---|---|---|---|
const char* | fileToSearch | in | File to search. |
char* | newFoundFile | out | File 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.
...