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. |
getActiveToneMapping | Deprecated. |
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.
...
Code Block | ||
---|---|---|
| ||
cluster = scene.addCluster( "cluster1" ); |
Anchor | ||||
---|---|---|---|---|
|
getObject
Gets a object reference from the scene.
Language | Syntax |
---|---|
C++ | Cmaxwell::Cobject getObject( const char* pObjectName ) |
Python | CmaxwellObject getObject( str objectName ) |
Return value
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 | ||||
---|---|---|---|---|
|
...
Type | Name | In/Out | Description |
---|---|---|---|
const char* | pName | in | Object name. |
dword | nVertexes | in | Number of vertexes to create. |
dword | nNormals | in | Number of normals to create. |
dword | nTriangles | in | Number of triangles to create. |
dword | nPositionsPerVertex | in | Sets the number of deformation motion blur substeps (1 or 2, 1 means no deformation blur). |
Return value
Cmaxwell::Cobject reference to the new mesh object created in the scene. Null object if it was not created (Cmaxwell::Cobject::isNull() = true).
...
Type | Name | In/Out | Description |
---|---|---|---|
const char* | pName | in | Instancement name. If exists, an unique name will be assigned, but it is more efficient the user gives an unique name at first. |
Cmaxwell::Cobject& | object | in | Cmaxwell::Cobject to be instanced. |
Return value
Cmaxwell::Cobject reference to the new instance object created in the scene. Null object if it was not created (Cmaxwell::Cobject::isNull() = true).
Anchor | ||||
---|---|---|---|---|
|
createRFRK
...
createProxy
Creates a proxy object that points to the given MXS path.
Language | Syntax |
---|---|
C++ | Cmaxwell::Cobject createProxy( const char* name, const char* proxyPath ) |
Python | CmaxwellObject createProxy( str name, str proxyPath ) |
Return value
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
Method used to create RealFlow objects. Returns a null object that can be filled with Cmaxwell::Cobject::setRfrkParameters().
...
Language | Syntax |
---|---|
C++ | Cmaxwell::Cobject addObject( Cmaxwell::Cobject& object ) |
Python | CmaxwellObject addObject( CmaxwellObject object ) |
Return value
Cmaxwell::Cobject reference to the object added in the scene. Null object if it was not created (Cmaxwell::Cobject::isNull() = true).
...
Language | Syntax |
---|---|
C++ | Cmaxwell::Cobject mergeMeshes( const char* pName, const Cmaxwell::Cobject* pMeshes, dword nMeshes ) |
Python | CmaxwellObject mergeMeshes( str pName, CmaxwellObject[] pMeshes ) |
Return value
Cmaxwell::Cobject reference to the new merged object created in the scene. Null object if it was not created (Cmaxwell::Cobject::isNull() = true).
...
Type | Name | In/Out | Description |
---|---|---|---|
const char* | pName | in | Camera name. |
dword | nSteps | in | Number of steps. |
real | shutter | in | Camera shutter. |
real | filmWidth | in | Camera film width. |
real | filmHeitgt | in | Camera film height. |
real | iso | in | Camera ISO. |
const char* | pDiaphragmType | in | Camera diaphragm type. Must be "CIRCULAR" or "POLYGONAL". |
real | angle | in | Camera diaphragm angle. |
dword | nBlades | in | Camera diaphragm blades number. |
dword | fps | in | Frames per second. |
dword | xRes | in | Camera width resolution. |
dword | yRes | in | Camera height resolution. |
real | pixelAspect | in | Pixel aspect. |
byte | projectionType | in | Camera projection type. Must be 0 (perspective, default), 1 (front), 2 (top), 3 (left), 4 (back), 5 (bottom), or 6 (right). |
Return value
Returns a Cmaxwell::Ccamera object, that is a reference to the camera added to the scene. Null if it was not created (Cmaxwell::Ccamera::isNull() = true).
...
Code Block | ||
---|---|---|
| ||
scene = Cmaxwell(mwcallback); scene.readMXS('c:/scenes/myscene.mxs'); camera = scene.addCamera( "Camera1", 1, 0.1, 0.1, 0.1, 500, "CIRCULAR", 90.0, 0, 25, 800, 600, 1, 0 ); = Cmaxwell(mwcallback); scene.readMXS('c:/scenes/myscene.mxs'); camera = scene.addCamera( "Camera1", 1, 0.1, 0.1, 0.1, 500, "CIRCULAR", 90.0, 0, 25, 800, 600, 1, 0 ); |
Anchor | ||||
---|---|---|---|---|
|
getCamera
Gets a camera requested by name.
Language | Syntax |
---|---|
C++ | Cmaxwell::Ccamera getCamera( const char* pCameraName ) |
Python | CmaxwellCamera getCamera( str cameraName ) |
Return value
Returns a Cmaxwell::Ccamera object, that is a reference to the camera added to the scene. Null if it was not created (Cmaxwell::Ccamera::isNull() = true).
Anchor | ||||
---|---|---|---|---|
|
getActiveCamera
Gets the active camera of the scene.
Language | Syntax |
---|---|
C++ | Cmaxwell::Ccamera getActiveCamera() |
Python | CmaxwellCamera getActiveCamera() |
Return value
Returns a Cmaxwell::Ccamera object, that is a reference to the camera added to the scene. Null if it was not created (Cmaxwell::Ccamera::isNull() = true).
Anchor | ||||
---|---|---|---|---|
|
setPath
...
Type | Name | In/Out | Description |
---|---|---|---|
const char* | pType | in | Path type: "RENDER", "ALPHA", "SHADOW", "OBJECT", "MATERIAL", "MOTION", "Z". ("BITMAPS" is deprecated, use Cmaxwell::addSearchingPath() instead) |
byte | outputBitDepthMode | out | Bits depth per pixel (8/16/32). |
Return value
C++
Output path of the channel.
...
Language | Syntax |
---|---|
C++ | byte addSearchingPath( const char* pPath ) |
Python | int addSearchingPath( str pPath ) |
Return value
0 = Error adding searching path.
...
Type | Name | In/Out | Description |
---|---|---|---|
dword | numPaths | out | Number of paths returned. |
char** | paths | out | List of paths. |
Return value
C++
0 = Error getting searching paths.
...
Type | Name | In/Out | Description |
---|---|---|---|
byte | positionType | out | Position type: 0 (Latitude/Longitude), 1 (Zenith/azimuth angles) or 2 (Direction vector) |
Return value
C++
0 = Error getting sun position type.
...
Type | Name | In/Out | Description |
---|---|---|---|
byte | positionType | in | Position type: 0 (Latitude/Longitude), 1 (Zenith/azimuth angles) or 2 (Direction vector) |
Return value
0 = Error setting sun position type.
...
Type | Name | In/Out | Description |
---|---|---|---|
real | luminance | out | Sky luminance. Must be a positive number. |
Crgb | color0 | out | Color at the horizont. |
Crgb | color90 | out | Color at the zenith. |
real | controlPoint | out | Sets the angle where the two colors are 50/50 mixed. i.e controlPoint = 45.0 means that the color at 45º angle is 50% color0 and 50% color90. |
Return value
C++
0 = Error getting constant sky parameters.
...
Type | Name | In/Out | Description |
---|---|---|---|
real | luminance | out | Sky luminance. Must be a positive number. |
Crgb | color0 | out | Color at the horizont. |
Crgb | color90 | out | Color at the zenith. |
real | controlPoint | out | Sets the angle where the two colors are 50/50 mixed. i.e controlPoint = 45.0 means that the color at 45º angle is 50% color0 and 50% color90. |
Return value
0 = Error setting constant sky parameters.
...
Type | Name | In/Out | Description |
---|---|---|---|
real | longitude | out | Longitude in degrees (from -180.0 to 180.0). |
real | latitude | out | Latitude in degrees (from -90.0 to 90.0). |
int | sm | out | GMT. |
int | dayOfYear | out | Day of the year (from 1 to 365, default = 100). |
real | timeOfDay | out | Hour (from 0.0 to 24.0, default = 17.0 ). |
Return value
C++
0 = Error getting sun longitude and latitude.
...
Language | Syntax |
---|---|
C++ | byte getSunDirection( Cvector3DT& dir ) |
Python | Cvector3DT getSunDirection() |
Return value
C++
0 = Error getting sun direction.
...
Language | Syntax |
---|---|
C++ | byte setSunDirection( Cvector3DT dir ) |
Python | int setSunDirection( Cvector3DT dir ) |
Return value
0 = Error setting sun direction.
...
Type | Name | In/Out | Description |
---|---|---|---|
real | rotation | out | Ground rotation of the sky hemisphere (from 0 to 2PI radians). |
Return value
C++
0 = Error getting sun rotation.
...
Type | Name | In/Out | Description |
---|---|---|---|
real | rotation | in | Ground rotation of the sky hemisphere (from 0 to 2PI radians). |
Return value
0 = Error setting sun rotation.
...
Language | Syntax |
---|---|
C++ | const char* getActiveSky() |
Python | str getActiveSky() |
Return value
Active sky name. "constant " = constant sky, "physical" = physical sky, NULL = no sky.
...
Language | Syntax |
---|---|
C++ | byte getSunDirectionUsedForRendering( Cvector3DT& dir ) |
Python | Cvector3DT getSunDirectionUsedForRendering() |
Return value
C++
0 = Error getting sun direction.
...
Type | Name | In/Out | Description |
---|---|---|---|
const char* | pLayerName | in | Sets the layer type. Must be "background", "reflection", "refraction" or "illumination". |
const char* | pBitmapFileName | out | Path of the texture file. |
byte | state | out | Channel state: 0 = Disabled; 1 = Enabled; 2 = Use active sky instead. Default: Enabled. |
bool | sphericalMapping | out | Spherical mapping enabled. When pLayerName = "background" must be false. |
bool | interpolate | out | If true, pixel values are interpolated. |
real | intensity | out | Intensity range: From 0.0001 to 1000.0 (Default: 1.0). |
real | uTile | out | Tile range: From 0.0001 to 1000.0 (default 1.0). |
real | vTile | out | Tile range: From 0.0001 to 1000.0 (default 1.0). |
real | uTileOffset | out | Offset range: From 0.0 to 360.0 (default 0.0). |
real | vTileOffset | out | Offset range: From 0.0 to 360.0 (default 0.0). |
Return value
C++
0 = Error getting environment layer values.
...
Type | Name | In/Out | Description |
---|---|---|---|
const char* | pLayerName | in | Sets the layer type. Must be "background", "reflection", "refraction" or "illumination". |
const char* | pBitmapFileName | in | Path of the texture file. |
byte | state | in | Channel state: 0 = Disabled; 1 = Enabled; 2 = Use active sky instead. Default: Enabled. |
bool | sphericalMapping | in | Spherical mapping enabled. When pLayerName = "background" must be false. |
bool | interpolate | in | If true, pixel values are interpolated. |
real | intensity | in | Intensity range: From 0.0001 to 1000.0 (Default: 1.0). |
real | uTile | in | Tile range: From 0.0001 to 1000.0 (default 1.0). |
real | vTile | in | Tile range: From 0.0001 to 1000.0 (default 1.0). |
real | uTileOffset | in | Offset range: From 0.0 to 360.0 (default 0.0). |
real | vTileOffset | in | Offset range: From 0.0 to 360.0 (default 0.0). |
Return value
0 = Error setting environment layer values.
...
Language | Syntax |
---|---|
C++ | Cmaxwell::Cmaterial readMaterial( const char* pFileName ) |
Python | CmaxwellMaterial readMaterial( str pFilename ) |
Return value
Returns a Cmaxwell::Cmaterial object. Null if it was not created (Cmaxwell::Cmaterial::isNull() = true).
...
Language | Syntax |
---|---|
C++ | Cmaxwell::Cmaterial createMaterial( const char* pMaterialName, bool addToScene = true ) |
Python | CmaxwellMaterial createMaterial( str pMaterialName, bool addToScene = True ) |
Return value
Returns a Cmaxwell::Cmaterial object. Null if it was not created (Cmaxwell::Cmaterial::isNull() = true).
...
Language | Syntax |
---|---|
C++ | Cmaxwell::Cmaterial getMaterial( const char* pMaterialName ) |
Python | CmaxwellMaterial getMaterial( str pMaterialName ) |
Return value
Returns a Cmaxwell::Cmaterial object. Null if it was not created (Cmaxwell::Cmaterial::isNull() = true).
...
Language | Syntax |
---|---|
C++ | Cmaxwell::Cmaterial addMaterial( Cmaxwell::Cmaterial& material ) |
Python | CmaxwellMaterial addMaterial( CmaxwellMaterial material ) |
Return value
Returns a Cmaxwell::Cmaterial object. Null if it was not created (Cmaxwell::Cmaterial::isNull() = true).
...
Language | Syntax |
---|---|
C++ | byte eraseUnusedMaterials() |
Python | int eraseUnusedMaterials() |
Return value
0 = Error erasing unused materials.
...
Language | Syntax |
---|---|
C++ | const char* getOverrideMaterial() |
void getOverrideMaterial( bool& enabled ) | |
Python | str getOverrideMaterial() |
bool getOverrideMaterialEnabled() |
Return value
Requesting override material: File name of the MXM.
...
Language | Syntax |
---|---|
C++ | const char* getDefaultMaterial() |
void getDefaultMaterial( bool& enabled ) | |
Python | str getDefaultMaterial() |
bool getDefaultMaterialEnabled() |
Return value
Requesting default material: File name of the MXM.
...
Type | Name | In/Out | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
const char* | pParameterName | in | Parameter name (see pParameterValue for parameter name list). | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
dcord | size | in | Size of the parameter in bytes (see pParameterValue to view sizes by parameter). Note: parameter size is not needed in Python. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
void* | pParameterValue | in/out | Parameter value, according to the following correspondences:
|
Return value
C++
0 = Error getting/setting render parameter.
...
Type | Name | In/Out | Description |
---|---|---|---|
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
0 = Error setting diffraction 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.
...
Type | Name | In/Out | Description |
---|---|---|---|
dword | numDependencies | out | Number of dependencies. |
char** | paths | out | Dependencies' file names. |
Return value
C++
0 = Error getting dependencies.
...
Language | Syntax |
---|---|
C++ | byte generateUuid( char** uuid ) |
Python | str generateUuid() |
Return value
C++
0 = Error generating unique ID.
...
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.
...
Value | C++ | Python |
---|---|---|
0 | Cmaxwell::ALL_CLEAN | Cmaxwell.ALL_CLEAN |
1 | Cmaxwell::CAMERA_DIRTY | Cmaxwell.CAMERA_DIRTY |
2 | Cmaxwell::MATERIALS_ASSIGNMENTS_DIRTY | Cmaxwel.MATERIALS_ASSIGNMENTS_DIRTY |
8 | Cmaxwell::GEOMETRY_DIRTY | Cmaxwell.GEOMETRY_DIRTY |
16 | Cmaxwell::VOXELIZATION_DIRTY | Cmaxwell.VOXELIZATION_DIRTY |
32 | Cmaxwell::SKY_OR_HDR_DIRTY | Cmaxwell.SKY_OR_HDR_DIRTY |
64 | Cmaxwell::DEFAULT_OR_OVERRIDE_MATERIAL_DIRTY | Cmaxwell.DEFAULT_OR_OVERRIDE_MATERIAL_DIRTY |
0x3F | Cmaxwell::ALL_DIRTY | Cmaxwell.ALL_DIRTY |
...