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.
getActiveToneMappingDeprecated.
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.

...

Code Block
titlePython
cluster = scene.addCluster( "cluster1" );

Anchor
getobject
getobject

getObject

Gets a object reference from the scene.

LanguageSyntax
C++Cmaxwell::Cobject getObject( const char* pObjectName )
PythonCmaxwellObject 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
createmesh
createmesh

...

TypeNameIn/OutDescription
const char*pNameinObject name.
dwordnVertexesinNumber of vertexes to create.
dwordnNormalsinNumber of normals to create.
dwordnTrianglesinNumber of triangles to create.
dwordnPositionsPerVertexinSets 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).

...

TypeNameIn/OutDescription
const char*pNameinInstancement name. If exists, an unique name will be assigned, but it is more efficient the user gives an unique name at first.
Cmaxwell::Cobject&objectinCmaxwell::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
createrfrkcreateproxycreaterfrk
createproxy

createRFRK

...

createProxy

Creates a proxy object that points to the given MXS path.

LanguageSyntax
C++Cmaxwell::Cobject createProxy( const char* name, const char* proxyPath )
PythonCmaxwellObject 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
createrfrk

createRFRK

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

...

LanguageSyntax
C++Cmaxwell::Cobject addObject( Cmaxwell::Cobject& object )
PythonCmaxwellObject 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).

...

LanguageSyntax
C++Cmaxwell::Cobject mergeMeshes( const char* pName, const Cmaxwell::Cobject* pMeshes, dword nMeshes )
PythonCmaxwellObject 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).

...

TypeNameIn/OutDescription
const char*pNameinCamera name.
dwordnStepsinNumber of steps.
realshutterinCamera shutter.
realfilmWidthinCamera film width.
realfilmHeitgtinCamera film height.
realisoinCamera ISO.
const char*pDiaphragmTypeinCamera diaphragm type. Must be "CIRCULAR" or "POLYGONAL".
realangleinCamera diaphragm angle.
dwordnBladesinCamera diaphragm blades number.
dwordfpsinFrames per second.
dwordxResinCamera width resolution.
dwordyResinCamera height resolution.
realpixelAspectinPixel aspect.
byteprojectionTypeinCamera 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
titlePython
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
getcamera

getCamera

Gets a camera requested by name.

LanguageSyntax
C++Cmaxwell::Ccamera getCamera( const char* pCameraName )
PythonCmaxwellCamera 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
getactivecamera

getActiveCamera

Gets the active camera of the scene.

LanguageSyntax
C++Cmaxwell::Ccamera getActiveCamera()
PythonCmaxwellCamera 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
setpath

setPath

...

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).

Return value

C++

Output path of the channel.

...

LanguageSyntax
C++byte addSearchingPath( const char* pPath )
Pythonint addSearchingPath( str pPath )

Return value

0 = Error adding searching path.

...

TypeNameIn/OutDescription
dwordnumPathsoutNumber of paths returned.
char**pathsoutList of paths.

Return value

C++

0 = Error getting searching paths.

...

TypeNameIn/OutDescription
bytepositionTypeoutPosition type: 0 (Latitude/Longitude), 1 (Zenith/azimuth angles) or 2 (Direction vector)

Return value

C++

0 = Error getting sun position type.

...

TypeNameIn/OutDescription
bytepositionTypeinPosition type: 0 (Latitude/Longitude), 1 (Zenith/azimuth angles) or 2 (Direction vector)

Return value

0 = Error setting sun position type.

...

TypeNameIn/OutDescription
realluminanceoutSky luminance. Must be a positive number.
Crgbcolor0outColor at the horizont.
Crgbcolor90outColor at the zenith.
realcontrolPointoutSets 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.

...

TypeNameIn/OutDescription
realluminanceoutSky luminance. Must be a positive number.
Crgbcolor0outColor at the horizont.
Crgbcolor90outColor at the zenith.
realcontrolPointoutSets 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.

...

TypeNameIn/OutDescription
reallongitudeoutLongitude in degrees (from -180.0 to 180.0).
reallatitudeoutLatitude in degrees (from -90.0 to 90.0).
intsmoutGMT.
intdayOfYearoutDay of the year (from 1 to 365, default = 100).
realtimeOfDayoutHour (from 0.0 to 24.0, default = 17.0 ).

Return value

C++

0 = Error getting sun longitude and latitude.

...

LanguageSyntax
C++byte getSunDirection( Cvector3DT& dir )
PythonCvector3DT getSunDirection()

Return value

C++

0 = Error getting sun direction.

...

LanguageSyntax
C++byte setSunDirection( Cvector3DT dir )
Pythonint setSunDirection( Cvector3DT dir )

Return value

0 = Error setting sun direction.

...

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

Return value

C++

0 = Error getting sun rotation.

...

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

Return value

0 = Error setting sun rotation.

...

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

Return value

Active sky name. "constant " = constant sky, "physical" = physical sky, NULL = no sky.

...

LanguageSyntax
C++byte getSunDirectionUsedForRendering( Cvector3DT& dir )
Python

Cvector3DT getSunDirectionUsedForRendering()

Return value

C++

0 = Error getting sun direction.

...

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).
realvTileOffsetoutOffset range: From 0.0 to 360.0 (default 0.0).

Return value

C++

0 = Error getting environment layer values.

...

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.

...

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).

...

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).

...

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).

...

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).

...

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

Return value

0 = Error erasing unused materials.

...

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

Return value

Requesting override material: File name of the MXM.

...

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

Return value

Requesting default material: File name of the MXM.

...

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

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/setting render parameter.

...

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.

...

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.

...

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

Return value

C++

0 = Error getting dependencies.

...

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

Return value

C++

0 = Error generating unique ID.

...

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.

...

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

...