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
setRenderParameter Sets render parameter.
getRenderParameter Gets render parameter.
Tonemapping methods
getToneMapping 
setToneMapping 
getActiveToneMapping 
setAdvancedToneMapping 
getAdvancedToneMapping 
Read/write scene methods
readMXS Reads scene from disk.
writeMXS Writes scene to disk.
Glare methods
setDiffraction 
getDiffraction 
enableDiffraction 
disableDiffraction 
setColorSpace 
getColorSpace 
getColorSpaceGamma 
Miscellaneous methods
getLastError 
getLastErrorString 
getDependencies 
getObjectsCount 
getMaterialsCount 
getCamerasCount 
getTriangleGroupsCount 
getSceneInfo 
computeFresnelGraph 
computeAbbeGraph 
getCorrelatedColorTemperature 
generateUuid 
searchFileInCommonPaths 
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.

...

Anchor
getsetrenderparameter
getsetrenderparameter

getRenderParameter, setRenderParameter

Gets/sets the value of the render parameter given by name.

LanguageSyntexSyntax
C++byte setRenderParameter( const char* pParameterName, dword size, const void* pParameterValue )
 byte getRenderParameter( const char* pParameterName, dword size, void* pParameterValue )
Pythonint setRenderParameter( str pParameterName, value )
 value getRenderParameter( str pParameterName )

Parameters

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 nameSizeValuesValue
"ENGINE"sizeof( char ) * 3Selects render engine. "RS0" or "RS1".
"NUM THREADS"sizeof( dword ) Number of threads. 0 = automatic.
"STOP TIME"sizeof( dword )SecondsRender 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 ) 
   

 

// "SAVE LIGHTS IN SEPARATE FILES",
0 = no, 1 = yes.
"MXI FULLNAME"0const char* that specifies the MXI path.
"DO NOT SAVE MXI FILE"sizeof( byte )
// "MXI FULLNAME", 0, const char* that specifies the MXI path
//
0 = no, 1 = yes.
"DO NOT SAVE
MXI
IMAGE FILE"
,
sizeof( byte )
// "DO NOT SAVE IMAGE FILE",sizeof(byte)
//
0 = no, 1 = yes.
"RENAME AFTER SAVING"
,
sizeof( byte )
//
0 = no, 1 = yes.
"COPY MXI AFTER RENDER"
,
0
,
const char* that specifies the MXI path where output will be copied.
//
"COPY IMAGE AFTER RENDER"
,
0
,
const 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 )
// "DO INDIRECT
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 )
// "DO DEVIGNETTING", sizeof( byte )
// "DEVIGNETTING", sizeof( real )
// "DO SCATTERING_LENS", sizeof( byte )
// "SCATTERING_LENS", sizeof( real ) [Range 0-1]
// "DO SHARPNESS", sizeof( byte )
// "SHARPNESS", sizeof( real )

...

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.

1 = Success.

Python
  • Setting parameter:

0 = Error setting render parameter.

1 = Success.

  • Getting parameter:

Parameter value.

Anchor
readmxs
readmxs

readMXS

Read scene from disk.

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

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 writing scene to disk.

1 = Success.

Anchor
cmaxwell_typecallback
cmaxwell_typecallback

...

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

...