Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 68 Next »

Cmaxwell class describes the whole Maxwell Render scene.

Friend classes

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

Sub-classes

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 
getRenderParameter 
Tonemapping methods
getToneMapping 
setToneMapping 
getActiveToneMapping 
setAdvancedToneMapping 
getAdvancedToneMapping 
Read/write scene methods
readMXS 
writeMXS 
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 

Static Methods

NameDescription
getEngineVersionReturns the current engine version.
getSdkVersionReturns the current SDK version.
isDepthSupportedForThisFormat 
getHighestDepthSupportedForThisFormat 
isEmbeddingAlphaSupportedForThisFormat 
isEmbeddingAllChannelsSupportedForThisFormat 
isTextureExtensionSupported 
getSquareSwatchIES 
getSolidLobeIES 

Properties

TypeNameDescription
unsigned char_interactiveFlagsInternal use.

Enumerations

typeCallback

InteractiveFlags

Cmaxwell

Class constructor. To create a Cmaxwell pointer it is needed to define a callback (function pointer). This callback returns errors/warnings/info during the read/write processes.

LanguageSyntax

C++

Cmaxwell( byte ( *pCallBack )( byte type, const char* pMethod, const char* pError, const void* pValue ) )
PythonCmaxwell( mwcallback )

Examples

C++
byte callback( byte isError, const char *pMethod, const char *pError, const void *pValue )
{
  if ( isError )
  {
    printf( err, "Error in Method = %s \n error = %s \n value = %d\n", pMethod, pError, pValue );
  }
  return ( 0 );
}
 
Cmaxwell* pMaxwell = new Cmaxwell( callback );
Python
# PyMaxwell includes a predefined callback function for Cmaxwell constructor called "mwcallback"
 
 pMaxwell = Cmaxwell( mwcallback );

setInputDataType

Sets the axis orientation of the scene.

LanguageSyntax
C++byte setInputDataType( const char* pInput )
Pythonint setInputDataType( str pInput )

Parameters

TypeNameIn/OutDescription
const char*pInputin

Must be one of the following: "YXZ", "ZXY" or "YZX".

The following equivalences are accepted as well:

"YXZ" = "LIGHTWAVE" or "CINEMA".

"ZXY" = "FORMZ" or "3DSMAX"

"YZX" = "MAXWELL", "MAYA", "XSI", "HOUDINI", "RHINO" or "SOLIDWORKS"

createMesh

Creates a mesh with the given parameters and adds it to the scene. If nVertes, nNormals and nTriangles are equal to 0, a NULL object is created.

LanguageSyntax
C++Cmaxwell::Cobject createMesh( const char* pName, dword nVertexes, dword nNormals, dword nTriangles, dword nPositionsPerVertex )
PythonCmaxwellObject createMesh( str pName, int nVertexes, int nNormals, int nTriangles, int nPositionsPerVertex )

Parameters

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

createInstancement

Creates an instance of the Cobject "object" (must be a mesh). If the object name exist, it will add a number at the end, in example: two instancements are created with the name "myname", the second one will be named "myname1". Creating huge amounts of instancements using the same name will be too slow because the name assignation algorithm will try alternative names this way:

  1. Creating instancement "instance": OK.
  2. Creating instancement "instance": Name exist. Trying "instance1": OK.
  3. Creating instancement "instance": Name exist. Trying "instance1": Name exists. Trying "instance2": OK.

And so on...

So it's highly reccommended to assign unique names in each instancement creation when we create a lot of them. A good example of creating instancements is provided here.

LanguageSyntax
C++Cmaxwell::Cobject createInstancement( const char* pName, Cmaxwell::Cobject& object )
PythonCmaxwellObject createInstancement( str pName, CmaxwellObject object )

Parameters

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

createRFRK

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

LanguageSyntax
C++Cmaxwell::Cobject createRFRK( const char* objName )
PythonCmaxwellObject createRFRK( str objName )

Cmaxwell::Cobject reference to the new RFRK object created in the scene. Null object if it was not created (Cmaxwell::Cobject::isNull() = true).

addObject

Adds an existent object into the scene. It is useful for instance for importing objects from one scene to other.

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

mergeMeshes

Merges an array of meshes into a single mesh. The original meshes are not removed (it can be done later calling Cmaxwell::Cobject::free() ).

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

Examples

Python
list = []
list.append(scene.getObject('sphere'));
list.append(scene.getObject('cube'));
newobject = scene.mergeMeshes('merged',list);    


addCamera

Adds a new camera to the scene with the given parameters.

LanguageSyntax
C++

Cmaxwell::Ccamera addCamera( const char *pName, dword nSteps, real shutter, real filmWidth, real filmHeight, real iso, const char *pDiaphragmType, real angle, word nBlades, dword fps, word xRes, dword yRes, real pixelAspect, byte projectionType = 0 );

Python

CmaxwellCamera addCamera( name, nSteps, shutter, filmWidth, filmHeight, iso, diaphragmType, angle, nBlades, fps, xRes, yRes, pixelAspect, proyectionType = 0 )

Parameters

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

Examples

C++
Cmaxwell* scene = new Cmaxwell(mwcallback);
Cmaxwell::Ccamera camera = scene->addCamera( "Camera1", 1, 0.1, 0.1, 0.1, 500, "CIRCULAR", 90.0, 0, 25, 800, 600, 1, 0 );
Python
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 );

setPath

Sets the path and depth for the given channel.

LanguageSyntax
C++byte setPath( const char* pType, const char* pPath, byte& outputBitDepthMode )
Pythonint setPath( str pType, str pPath, int outputBitDepthMode )

Parameters

TypeNameIn/OutDescription
const char*pTypeinPath type: "RENDER", "ALPHA", "SHADOW", "OBJECT", "MATERIAL", "MOTION", "Z". ("BITMAPS" is deprecated, use Cmaxwell::addSearchingPath() instead)
const char*pPathinOutput path of the channel.
byteoutputBitDepthModein

Bits depth per pixel (8/16/32). If the depth is not correct for the given format, the engine tries to change this parameter.

i.e. setPath( "image.jpg", 32 ) is not correct because jpg does not support 32 bits so the engine will change it to 8. Get more info about supported image formats.

Return values

0 = Error setting path.

1 = Success.

getPath

Gets path of the given channel.

LanguageSyntax
C++const char* getPath( const char* pType, byte& outputBitDepthMode )
Python(path,outputBitDepthMode) getPath( str pType )

Parameters

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.

Python

(path,outputBitDepthMode) = Tuple containing the output path of the channel and its bit depth.

addSearchingPath

Adds a path to look for missing textures, ior and ies files.

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

Return value

0 = Error adding searching path.

1 = Success.

getSearchingPaths

Returns an array of strings (lenght and content) with all searching paths of the scene (textures, ior files, hdr files, ies etc).

LanguageSyntax
C++byte getSearchingPaths( dword& numPaths, char**& paths )
Pythonstr[] getSearchingPaths()

Parameters

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

Return value

C++

0 = Error getting searching paths.

1 = Success

Python

List of paths

addCluster

Creates a triangle cluster in the scene.

LanguageSyntax
C++Cmaxwell::Ccluster addCluster( const char* pName )
PythonCcluster addCluster( pName)

Parameters

TypeNameIn/outDescription
const char*pNameinCluster name

Return value

Returns a Cmaxwell::Ccluster object, that is a reference to the cluster added to the scene.

Examples

Python
Cmaxwell::Ccluster cluster = scene->addCluster( "cluster1" );
Python
cluster = scene.addCluster( "cluster1" );

getSunPositionType

Gets sun positon type.

LanguageSyntax
C++byte getSunPositionType( byte& positionType )
Pythonint getSunPositionType()

Parameters

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

Return value

C++

0 = Error getting sun position type.

1 = Success.

Python

Sun position type.

setSunPositionType

Sets sun position type.

LanguageSyntax
C++byte setSunPositionType( byte& positionType )
Pythonint setSunPositionType( int positionType )

Parameters

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

Return value

0 = Error setting sun position type.

1 = Success.

getSkyConstant

Gets the parameters of the constant (non physical) sky.

LanguageSyntax
C++byte getSkyConstant( real& luminance, Crgb& color0, Crgb& color90, real& controlPoint )
Python{ float 'luminance', Crgb 'color0', Crgb 'color90', 'controlPoint' } getSkyConstant()

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

C++

0 = Error getting constant sky parameters.

1 = Success.

Python

Dictionary containing all constant sky parameters.

setSkyConstant

Sets the parameters of the constant (non physical) sky.

LanguageSyntax
C++byte getSkyConstant( real luminance, const Crgb& color0, const Crgb& color90, real controlPoint )
Pythonint getSkyConstant( float luminance, Crgb color0, Crgb color90, float controlPoint )

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.

1 = Success.

getSunLongitudeAndLatitude

Gets the location of the sun when Cmaxwell::getSunPositionType() = 0.

LanguageSyntax
C++byte getSunLongitudeAndLatitude( real& longitude, real& latitude, int& sm, dword& dayOfYear, real&timeOfDay )
Python

{ float 'longitude', float 'latitude', int 'sm', int 'dayOfYear', int 'timeOfDay'} getSunLongitudeAndLatitude()

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.

1 = Success.

Python

Dictionary contaning all sun longitude and latittude values.

setSunLongitudeAndLatitude

Sets the location of the sun when Cmaxwell::getSunPositionType() = 0.

LanguageSyntax
C++byte setSunLongitudeAndLatitude( real longitude, real latitude, int sm, dword dayOfYear, real timeOfDay )
Pythonint setSunLongitudeAndLatitude( float longitude, float latitude, int sm, int dayOfYear, float timeOfDay )

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 values

0 = Error setting sun longitude and latitude.

1 = Success.

getSunAngles

It is an alternative way to get/set the sun position based on spheric angles.

LanguageSyntax
C++byte getSunAngles( real& zenith, real& azimuth )
Python(zenith,azimuth) getSunAngles()

Parameters

TypeNameIn/outDescription
realzenithoutZenith angle (from 0.0 to PI/2 radians).
realazimuthoutAzimuth angle (from 0.0 to 2PI in radians).

Return values

C++

0 = Error getting sun angles.

1 = Success

Python

(zenith,azimuth) = Tuple containing zenith and azimuth angles.

Examples

C++
byte ok;
real zenith;
real azimuth;
ok = scene->getSunAngles( zenith, azimuth );
Python
zenith,azimuth = scene.getSunAngles();

setSunAngles

It is an alternative way to get/set the sun position based on spheric angles.

LanguageSyntax
C++byte setSunAngles( real zenith, real azimith )
Pythonint setSunAngles( float zenith, float azimuth )

Parameters

TypeNameIn/outDescription
realzenithoutZenith angle (from 0.0 to PI/2 radians).
realazimuthoutAzimuth angle (from 0.0 to 2PI in radians).

Return values

0 = Error setting sun angles.

1 = Success.

getSunDirection

Gets sun direction vector. It is an alternative way to set the sun position based on a direction.

LanguageSyntax
C++byte getSunDirection( Cvector& dir )
PythonCvector getSunDirection()

Return value

C++

0 = Error getting sun direction.

1 = Success.

Python

Sun direction vector

setSunDirection

Sets sun direction vector. It is an alternative way to set the sun position based on a direction.

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

Return value

0 = Error setting sun direction.

1 = Success.

getSunRotation

Gets the ground rotation of the sky hemisphere.

LanguageSyntax
C++byte getSunRotation( real& rotation )
Pythonfloat getSunRotation()

Parameters

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

Return value

C++

0 = Error getting sun rotation.

1 = Success.

Python

Ground rotation.

setSunRotation

Sets the ground rotation of the sky hemisphere.

LanguageSyntax
C++byte setSunRotation( real rotation )
Pythonint getSunRotation( float rotation )

Parameters

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

Return value

0 = Error setting sun rotation.

1 = Success.

getSunProperties

Gets the sun properties used for both physical and constant skies when sun is enabled.

LanguageSyntax
C++byte getSunProperties( byte& enabled, real& sunTemperature, real& sunPowerScaleFactor )
Python{'enabled','sunTemperature','sunPowerScaleFactor'} getSunProperties()

Parameters

TypeNameIn/OutDescription
byteenabledoutSun enabled (1) or disabled (0).
realsunTemperatureoutTemperature in kelvins.
realsunPowerScaleFactoroutTotal power refered to the Earth's sun. For example a value of 0.8 would mean a sun emitting 0.8 times less energy than ours. Default: 1.0. Range: is allowed any value greater than 0.

Return values

C++

0 = Error getting sun properties.

1 = Success.

Python

Dictionary containing the sun properties.

setSunProperties

Sets the sun properties used for both physical and constant skies when sun is enabled.

LanguageSyntax
C++byte setSunProperties( byte enabled, real sunTemperature, real sunPowerScaleFactor )
Pythonint setSunProperties( int enabled, float sunTemperature, float sunPowerScaleFactor )

Parameters

TypeNameIn/OutDescription
byteenabledinSun enabled (1) or disabled (0).
realsunTemperatureinTemperature in kelvins.
realsunPowerScaleFactorinTotal power refered to the Earth's sun. For example a value of 0.8 would mean a sun emitting 0.8 times less energy than ours. Default: 1.0. Range: is allowed any value greater than 0.

Return values

0 = Error setting sun properties.

1 = Success.

getPhysicalSkyAtmosphere

Gets the atmosphere parameters of the physical sky.

LanguageSyntax
C++

byte getPhysicalSkyAtmosphere( real& intensity, real& ozone, real& water, real& angstromTurbidity, real& wavelengthTurbidity, real& aerosolAlbedo, real& asimmetryFactor, real& planetReflectance )

Python

{ float 'intensity, float 'ozone', float 'water', float 'angstromTurbidity', float 'wavelengthTurbidity', float 'aerosolAlbedo', float 'asimmetryFactor', float 'planetReflectance' } getPhysicalSkyAtmosphere()

Parameters

TypeNameIn/OutDescription
realintensityoutIntensity weight. Default: 1.0. Range: Any value greater than 0.
realozoneout(cms) Default: 0.4. Range: Any value greater than 0 (usually between 0 and 1).
realwateroutWater vapor (cms). Default: 2.0. Range: Any value greater than 0.
realangstromTurbidityoutAngstrom turbidity coefficient. Default: 0.04. Range: Any value greater than 0.
realwavelengthTurbidityoutWavelength turbidity exponent. Default 1.2. Range: Any value greater than 0.
realaerosolAlbedooutAerosol albedo. Default 0.8. Range: (0-1).
realasimmetryFactorout"Anisotropy" of aerosol. Default: 0.7. Range (-0.99999, 0.99999).
realplanetReflectanceoutPlanet reflectance. From 0 to 1.

Return values

C++

0 = Error getting atmosphere parameters.

1 = Success.

Python

Dictionary containing all atmosphere parameters.

setPhysicalSkyAtmosphere

Sets the atmosphere parameters of the physical sky.

LanguageSyntax
C++

byte setPhysicalSkyAtmosphere( real intensity, real ozone, real water, real angstromTurbidity, real wavelengthTurbidity, real aerosolAlbedo, real asimmetryFactor, real planetReflectance )

Python

byte setPhysicalSkyAtmosphere( float intensity, float ozone, float water, float angstromTurbidity, float wavelengthTurbidity, float aerosolAlbedo, float asimmetryFactor, float planetReflectance )

Parameters

TypeNameIn/OutDescription
realintensityinIntensity weight. Default: 1.0. Range: Any value greater than 0.
realozonein(cms) Default: 0.4. Range: Any value greater than 0 (usually between 0 and 1).
realwaterinWater vapor (cms). Default: 2.0. Range: Any value greater than 0.
realangstromTurbidityinAngstrom turbidity coefficient. Default: 0.04. Range: Any value greater than 0.
realwavelengthTurbidityinWavelength turbidity exponent. Default 1.2. Range: Any value greater than 0.
realaerosolAlbedoinAerosol albedo. Default 0.8. Range: (0-1).
realasimmetryFactorin"Anisotropy" of aerosol. Default: 0.7. Range (-0.99999, 0.99999).
realplanetReflectanceinPlanet reflectance. From 0 to 1.

Return values

0 = Error setting atmosphere parameters.

1 = Success.

getActiveSky

Gets the active sky used.

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

Return value

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

setActiveSky

Sets the active sky.

LanguageSyntax
C++byte setActiveSky( const char* pActiveSky )
Pythonint setActiveSky( str pActiveSky )

Parameters

TypeNameIn/OutDescription
const char*pActiveSkyinActive sky name. "constant " = constant sky, "physical" = physical sky, NULL = no sky.

Return values

0 = Error setting active sky.

1 = Success.

getSunDirectionUsedForRendering

Returns the sun direction. If the sun position was set through a direction vector, it returns the same vector. If the sun position was set through latitude/longitude or through angles it returns the translation to a direction. This function is mainly used for drawing the sky in a viewport.

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

Cvector getSunDirectionUsedForRendering()

Return value

C++

0 = Error getting sun direction.

1 = Success

Python

Sun direction vector.

getEnvironmentLayer

Gets the parameters of each environment layer.

LanguageSyntax
C++byte getEnvironmentLayer( const char* pLayerName, const char*& pBitmapFileName, byte& state, bool& sphericalMapping, bool& interpolate, real& intensity, real& uTile, real& vTile, real& uTileOffset, real& vTileOffset )
Python

{ str 'bitmapFileName', int 'state', bool 'sphericalMapping', bool 'interpolate', float 'intensity', float 'uTile', float 'vTile', float 'uTileOffset', float 'TileOffset'} getEnvironmentLayer( str pLayerName )

Parameters

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.

1 = Success.

Python

Dictionary containing all environment layer values.

setEnvironmentLayer

Sets the parameters of each environment layer.

LanguageSyntax
C++byte setEnvironmentLayer( const char* pLayerName, const char* pBitmapFileName, byte state, bool sphericalMapping, bool interpolate, real intensity, real uTile, real vTile, real uTileOffset, real vTileOffset )
Pythonint setEnvironmentLayer( str pLayerName, str pBitmapFilename, int state, bool sphericalMapping, bool interpolate, float intensity, float uTile, float vTile, float uTileOffset, float vTileOffset )

Parameters

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.

1 = Success.

readMaterial

Reads a material from disk.

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

createMaterial

Creates a material with the given name and adds it to the scene if the parameter addToScene is true (default).

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

getMaterial

Given the name of a material, returns its Cmaxwell::Cmaterial reference.

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

addMaterial

Adds a material to the scene and returns a reference to the added material.

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

eraseUnusedMaterials

Removes unused materials from the scene.

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

Return value

0 = Error erasing unused materials.

1 = Success.

setOverrideMaterial

Sets the path and state (enabled/disabled) the material that overrides all the materials of the scene (except emitter materials).

LanguageSyntax
C++void setOverrideMaterial( const char* pPathMaterial )
 void setOverrideMaterial( bool enabled )
Pythonvoid setOverrideMaterial( str pPathMaterial )
 void setOverrideMaterial( bool enabled )

Parameters

TypeNameIn/OutDescription
const char*pPathMaterialinMXM file name of the override material.
boolenabledinSets override material state (enabled/disabled).

getOverrideMaterial

Gets the path and state (enabled/disabled) of the material that overrides all the materials of the scene (except emitter materials).

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

Return value

Requesting override material: File name of the MXM.

Requesting override material state: true if override material is enabled, false if not.

setDefaultMaterial

Sets the path and state (enabled/disabled) the material that will be used for all the objects/triangles without material.

LanguageSyntax
C++void setDefaultMaterial( const char* pPathMaterial )
 void setDefaultMaterial( bool enabled )
Pythonvoid setDefaultMaterial( str pPathMaterial )
 void setDefaultMaterial( bool enabled )

Parameters

TypeNameIn/OutDescription
const char*pPathMaterialinMXM file name of the default material.
boolenabledinSets default material state (enabled/disabled).

getDefaultMaterial

Gets the path and state (enabled/disabled) of the material that will be used for all the objects/triangles without material.

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

Return value

Requesting default material: File name of the MXM.

Requesting default material state: true if default material is enabled, false if not.

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

InteractiveFlags

Values of the _interactiveFlags property.

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

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  • No labels