Versions Compared

Key

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

Cmaxwell class describes the whole Maxwell Render scene.

...

CoptionsReadMXS, CsceneInfo, CmultiValue, Cmaterial, CmaterialLayer, CmaterialEmitter, Creflectance, Ccoating, Cbsdf, Ccamera and Cobject.

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.
isProtectionEnabledInternal use.
enableProtectionInternal use.
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.
readPreviewRead scene preview image from path.
setInputDataTypeSet the axis orientation of the scene.
setSinglePrecisionOfGeometryUses floats instead of doubles for geometry.
setSceneUserDataInternal use.
addClusterAdds a triangle cluster to the scene.
freeCluster--TODO-- not implemented
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
getToneMapping 
setToneMapping 
getActiveToneMapping 
setAdvancedToneMapping 
getAdvancedToneMapping 
Read/write scene methods
readMXSReads scene from disk.
writeMXSWrites scene to disk.
Glare methods
setDiffraction 
getDiffraction 
enableDiffraction 
disableDiffraction 
setColorSpace 
getColorSpace 
getColorSpaceGamma 
Miscellaneous methods
getLastErrorReturns 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 searchFileInCommonPaths Generates 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.

...

0 = Error writing scene to disk.

1 = Success.

Anchor
cmaxwell_typecallbackcmaxwell_typecallback

typeCallback

Callback types of messages given by the rendering callback.

...

getlasterror
getlasterror

getLastError

Returns the latest error occurred, Cerror is defined in error.h. Useful for finding out i/o problems when reading/writing MXS/MXI files.

LanguageSyntax
C++Cerror::error getLastError()
Python
0Cmaxwell::CALLBACK_WARNINGCmaxwell.CALLBACK_WARNING
1Cmaxwell::CALLBACK_int getLastError()

Anchor
getlasterrorstring
getlasterrorstring

getLastErrorString

Returns an human readable string containing the latest error occurred.

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

Anchor
getdependencies
getdependencies

getDependencies

Returns an array of strings (length and content) with all the extern dependencies of the scene (textures, ior files, hdr files, etc).

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.

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
cmaxwell_typecallback
cmaxwell_typecallback

typeCallback

Callback types of messages given by the rendering callback.

ValueC++Python
0Cmaxwell::CALLBACK_WARNINGCmaxwell.CALLBACK_WARNING
1Cmaxwell::CALLBACK_ERRORCmaxwell.CALLBACK_ERROR
2Cmaxwell::WRITE_USER_DATACmaxwell.WRITE_USER_DATA
3Cmaxwell:READ_USER_DATACmaxwell.READ_USER_DATA

...

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

...