The Cmaxwell class describes the whole Maxwell Render scene.
CoptionsReadMXS, CsceneInfo, CmultiValue, Cmaterial, CmaterialLayer, CmaterialEmitter, Creflectance, Ccoating, Cbsdf, Ccamera, Cobject and CmaxwellMxi.
CoptionsReadMXS, CsceneInfo, CmultiValue, Cmaterial, CmaterialLayer, CmaterialEmitter, Creflectance, Ccoating, Cbsdf, Ccamera and Cobject.
Type | Name | Description |
---|---|---|
unsigned char | _interactiveFlags | Internal use. |
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. |
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 | Gets the active tonemapping used ("BASIC" or "ADVANCED" ). |
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. Deprecated. |
getSceneInfo | Returns by reference a Cmaxwell::CsceneInfo structure with information about the scene. |
computeFresnelGraph | --TODO-- |
computeAbbeGraph | --TODO-- |
getCorrelatedColorTemperature | Gets the correlated RGB values given the temperature color. |
generateUuid | Generates an unique ID. |
searchFileInCommonPaths | Looks for the given file in all of the searching paths of the scene. |
createGeometryLoaderObject | --TODO-- |
createGeometryProceduralObject | --TODO-- |
applySkyExtension | --TODO-- |
applySceneModifierExtension | --TODO-- |
Name | Description |
---|---|
getEngineVersion | Returns the current engine version. |
getSdkVersion | Returns the current SDK version. |
isDepthSupportedForThisFormat | Returns true if for the given extension the depth is valid. |
getHighestDepthSupportedForThisFormat | Returns the highest bits per plane supported for the given format. |
isEmbeddingAlphaSupportedForThisFormat | Returns true if for the given format it is possible embedding the alpha channel. |
isEmbeddingAllChannelsSupportedForThisFormat | Returns true if for the given format it is possible embedding all channels in a multilayer file. |
isTextureExtensionSupported | Returns true if the extension of the given texture path is supported by the render engine. |
getSquareSwatchIES | Used to get the IES/EULUM emission pattern plotted into a square rgb buffer of size "resolution". The caller is responsible of freeing the buffer "buf" after using it. |
getSolidLobeIES | Used to get the IES/EULUM emission pattern plotted as a 3d object. The caller is responsible of freeing the buffers "faces, points" after using them. |
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.
Language | Syntax |
---|---|
C++ | Cmaxwell( byte ( *pCallBack )( byte type, const char* pMethod, const char* pError, const void* pValue ) ) |
Python | Cmaxwell( mwcallback ) |
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 ); |
# PyMaxwell includes a predefined callback function for Cmaxwell constructor called "mwcallback" pMaxwell = Cmaxwell( mwcallback ); |
Gets MXS file version.
Language | Syntax |
---|---|
C++ | float getMxsVersion() |
Python | float getMxsVersion() |
Gets most recent MXS version supported.
Language | Syntax |
---|---|
C++ | float getMostRecentVersionMXS() |
Python | float getMostRecentVersionMXS() |
Gets the plug-in identifier from which the MXS was created (string stored in the scene file to know which exporter has generated the MXS file).
Language | Syntax |
---|---|
C++ | const char* getPluginID() |
Python | str getPluginID() |
Gets the plug-in identifier from which the MXS was created (string stored in the scene file to know which exporter has generated the MXS file).
Language | Syntax |
---|---|
C++ | void setPluginID( const char* pID ) |
Python | void setPluginID( str ID ) |
Gets scene protection state in Maxwell Studio (ability to export to other formats). Protection is enabled by default.
Language | Syntax |
---|---|
C++ | void isProtectionEnabled( bool& enabled ) |
Python | bool isProtectionEnabled() |
Sets scene protection state in Maxwell Studio (ability to export to other formats). Protection is enabled by default.
Language | Syntax |
---|---|
C++ | void enableProtection( bool enable ) |
Python | void enableProtection( bool enable ) |
Deletes all geometry of the scene.
Language | Syntax |
---|---|
C++ | void freeGeometry() |
Python | void freeGeometry() |
Resets the scene. Cleans all objects, geometry, materials, etc.
Language | Syntax |
---|---|
C++ | void freeScene() |
Python | void freeScene() |
Preview image of the scene stored in the file (useful for thumbnals).
Language | Syntax |
---|---|
C++ | Crgb8* getScenePreview( dword& xRes, dword& yRes ) |
Python | array getScenePreview() |
Type | Name | In/Out | Description |
---|---|---|---|
dword | xRes | out | Preview image width. |
dword | yRes | out | Preview image height. |
Crgb8 pointer to the preview image. The memory pointed belongs to the scene, so the programmer must not free it.
NumPy array containing the RGB image. Array dimensions: (height, width, 3).
Sets the scene preview image.
Language | Syntax |
---|---|
C++ | byte setScenePreview( dword xRes, dword yRes, Crgb8* pRGB ) |
Python | bool setScenePreview( array image ) |
Type | Name | In/Out | Description |
---|---|---|---|
dword | xRes | in | (C++) Image width. |
dword | yRes | in | (C++) Image height. |
Crgb8* | pRGB | in | (C++) Image buffer. |
image | array | in | (Python) NumPy ubyte array. Shape is (width,height,3). |
0 = Error setting scene preview image.
1 = Success.
Sets the scene preview from another MXS.
Language | Syntax |
---|---|
C++ | Crgb8* readPreview( const char* pPath, dword& xResPreview, dword& yResPreview ) |
Python | array readPreview( str filename ) |
Type | Name | In/Out | Description |
---|---|---|---|
const char* | pPath | in | MXS file name. |
dword& | xResPreview | out | (C++) Preview width. |
dword& | yResPreview | out | (C++) Preview height. |
Crgb8 pointer to the preview image. The memory pointed belongs to the scene, so the programmer must not free it.
NumPy array containing the RGB image. Array dimensions: (height, width, 3).
Sets the axis orientation of the scene.
Language | Syntax |
---|---|
C++ | byte setInputDataType( const char* pInput ) |
Python | int setInputDataType( str pInput ) |
Type | Name | In/Out | Description |
---|---|---|---|
const char* | pInput | in | 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" |
Uses floats instead of doubles for geometry.
Language | Syntax |
---|---|
C++ | void setSinglePrecisionOfGeometry() |
Python | void setSinglePrecisionOfGeometry() |
Creates a triangle cluster in the scene.
Language | Syntax |
---|---|
C++ | Cmaxwell::Ccluster addCluster( const char* pName ) |
Python | Ccluster addCluster( pName) |
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.
Cmaxwell::Ccluster cluster = scene->addCluster( "cluster1" ); |
cluster = scene.addCluster( "cluster1" ); |
Gets a object reference from the scene.
Language | Syntax |
---|---|
C++ | Cmaxwell::Cobject getObject( const char* pObjectName ) |
Python | CmaxwellObject getObject( str objectName ) |
Returns the Cobject with the given name or a null object if there is not an object with that name ( Cmaxwell::Cobject::isNull() == true ).
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.
Language | Syntax |
---|---|
C++ | Cmaxwell::Cobject createMesh( const char* pName, dword nVertexes, dword nNormals, dword nTriangles, dword nPositionsPerVertex ) |
Python | CmaxwellObject createMesh( str pName, int nVertexes, int nNormals, int nTriangles, int nPositionsPerVertex ) |
Parameters
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). |
Cmaxwell::Cobject reference to the new mesh object created in the scene. Null object if it was not created (Cmaxwell::Cobject::isNull() = true).
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:
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.
Language | Syntax |
---|---|
C++ | Cmaxwell::Cobject createInstancement( const char* pName, Cmaxwell::Cobject& object ) |
Python | CmaxwellObject createInstancement( str pName, CmaxwellObject object ) |
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. |
Cmaxwell::Cobject reference to the new instance object created in the scene. Null object if it was not created (Cmaxwell::Cobject::isNull() = true).
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 ) |
Cmaxwell::Cobject reference to the new proxy object created in the scene. Null object if it was not created (Cmaxwell::Cobject::isNull() = true).
Method used to create RealFlow objects. Returns a null object that can be filled with Cmaxwell::Cobject::setRfrkParameters().
Language | Syntax |
---|---|
C++ | Cmaxwell::Cobject createRFRK( const char* objName ) |
Python | CmaxwellObject 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).
Adds an existent object into the scene. It is useful for instance for importing objects from one scene to other.
Language | Syntax |
---|---|
C++ | Cmaxwell::Cobject addObject( Cmaxwell::Cobject& object ) |
Python | CmaxwellObject addObject( CmaxwellObject object ) |
Cmaxwell::Cobject reference to the object added in the scene. Null object if it was not created (Cmaxwell::Cobject::isNull() = true).
Merges an array of meshes into a single mesh. The original meshes are not removed (it can be done later calling Cmaxwell::Cobject::free() ).
Language | Syntax |
---|---|
C++ | Cmaxwell::Cobject mergeMeshes( const char* pName, const Cmaxwell::Cobject* pMeshes, dword nMeshes ) |
Python | CmaxwellObject mergeMeshes( str pName, CmaxwellObject[] pMeshes ) |
Cmaxwell::Cobject reference to the new merged object created in the scene. Null object if it was not created (Cmaxwell::Cobject::isNull() = true).
list = [] list.append(scene.getObject('sphere')); list.append(scene.getObject('cube')); newobject = scene.mergeMeshes('merged',list); |
Adds a new camera to the scene with the given parameters.
Language | Syntax |
---|---|
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 ) |
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). |
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).
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 ); |
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 ); |
Gets a camera requested by name.
Language | Syntax |
---|---|
C++ | Cmaxwell::Ccamera getCamera( const char* pCameraName ) |
Python | CmaxwellCamera getCamera( str cameraName ) |
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).
Gets the active camera of the scene.
Language | Syntax |
---|---|
C++ | Cmaxwell::Ccamera getActiveCamera() |
Python | CmaxwellCamera getActiveCamera() |
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).
Sets the path and depth for the given channel.
Language | Syntax |
---|---|
C++ | byte setPath( const char* pType, const char* pPath, byte& outputBitDepthMode ) |
Python | int setPath( str pType, str pPath, int outputBitDepthMode ) |
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) |
const char* | pPath | in | Output path of the channel. |
byte | outputBitDepthMode | in | 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. |
0 = Error setting path.
1 = Success.
Gets path of the given channel.
Language | Syntax |
---|---|
C++ | const char* getPath( const char* pType, byte& outputBitDepthMode ) |
Python | (path,outputBitDepthMode) getPath( str pType ) |
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). |
Output path of the channel.
(path,outputBitDepthMode) = Tuple containing the output path of the channel and its bit depth.
Adds a path to look for missing textures, ior and ies files.
Language | Syntax |
---|---|
C++ | byte addSearchingPath( const char* pPath ) |
Python | int addSearchingPath( str pPath ) |
0 = Error adding searching path.
1 = Success.
Returns an array of strings (lenght and content) with all searching paths of the scene (textures, ior files, hdr files, ies etc).
Language | Syntax |
---|---|
C++ | byte getSearchingPaths( dword& numPaths, char**& paths ) |
Python | str[] getSearchingPaths() |
Type | Name | In/Out | Description |
---|---|---|---|
dword | numPaths | out | Number of paths returned. |
char** | paths | out | List of paths. |
0 = Error getting searching paths.
1 = Success
List of paths
Gets sun positon type.
Language | Syntax |
---|---|
C++ | byte getSunPositionType( byte& positionType ) |
Python | int getSunPositionType() |
Type | Name | In/Out | Description |
---|---|---|---|
byte | positionType | out | Position type: 0 (Latitude/Longitude), 1 (Zenith/azimuth angles) or 2 (Direction vector) |
0 = Error getting sun position type.
1 = Success.
Sun position type.
Sets sun position type.
Language | Syntax |
---|---|
C++ | byte setSunPositionType( byte& positionType ) |
Python | int setSunPositionType( int positionType ) |
Type | Name | In/Out | Description |
---|---|---|---|
byte | positionType | in | Position type: 0 (Latitude/Longitude), 1 (Zenith/azimuth angles) or 2 (Direction vector) |
0 = Error setting sun position type.
1 = Success.
Gets the parameters of the constant (non physical) sky.
Language | Syntax |
---|---|
C++ | byte getSkyConstant( real& luminance, Crgb& color0, Crgb& color90, real& controlPoint ) |
Python | { float 'luminance', Crgb 'color0', Crgb 'color90', 'controlPoint' } getSkyConstant() |
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. |
0 = Error getting constant sky parameters.
1 = Success.
Dictionary containing all constant sky parameters.
Sets the parameters of the constant (non physical) sky.
Language | Syntax |
---|---|
C++ | byte getSkyConstant( real luminance, const Crgb& color0, const Crgb& color90, real controlPoint ) |
Python | int getSkyConstant( float luminance, Crgb color0, Crgb color90, float controlPoint ) |
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. |
0 = Error setting constant sky parameters.
1 = Success.
Gets the location of the sun when Cmaxwell::getSunPositionType() = 0.
Language | Syntax |
---|---|
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() |
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 ). |
0 = Error getting sun longitude and latitude.
1 = Success.
Dictionary contaning all sun longitude and latittude values.
Sets the location of the sun when Cmaxwell::getSunPositionType() = 0.
Language | Syntax |
---|---|
C++ | byte setSunLongitudeAndLatitude( real longitude, real latitude, int sm, dword dayOfYear, real timeOfDay ) |
Python | int setSunLongitudeAndLatitude( float longitude, float latitude, int sm, int dayOfYear, float timeOfDay ) |
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 ). |
0 = Error setting sun longitude and latitude.
1 = Success.
It is an alternative way to get/set the sun position based on spheric angles.
Language | Syntax |
---|---|
C++ | byte getSunAngles( real& zenith, real& azimuth ) |
Python | (zenith,azimuth) getSunAngles() |
Type | Name | In/out | Description |
---|---|---|---|
real | zenith | out | Zenith angle (from 0.0 to PI/2 radians). |
real | azimuth | out | Azimuth angle (from 0.0 to 2PI in radians). |
0 = Error getting sun angles.
1 = Success
(zenith,azimuth) = Tuple containing zenith and azimuth angles.
byte ok; real zenith; real azimuth; ok = scene->getSunAngles( zenith, azimuth ); |
zenith,azimuth = scene.getSunAngles(); |
It is an alternative way to get/set the sun position based on spheric angles.
Language | Syntax |
---|---|
C++ | byte setSunAngles( real zenith, real azimith ) |
Python | int setSunAngles( float zenith, float azimuth ) |
Type | Name | In/out | Description |
---|---|---|---|
real | zenith | out | Zenith angle (from 0.0 to PI/2 radians). |
real | azimuth | out | Azimuth angle (from 0.0 to 2PI in radians). |
0 = Error setting sun angles.
1 = Success.
Gets sun direction vector. It is an alternative way to set the sun position based on a direction.
Language | Syntax |
---|---|
C++ | byte getSunDirection( Cvector3DT& dir ) |
Python | Cvector3DT getSunDirection() |
0 = Error getting sun direction.
1 = Success.
Sun direction vector
Sets sun direction vector. It is an alternative way to set the sun position based on a direction.
Language | Syntax |
---|---|
C++ | byte setSunDirection( Cvector3DT dir ) |
Python | int setSunDirection( Cvector3DT dir ) |
0 = Error setting sun direction.
1 = Success.
Gets the ground rotation of the sky hemisphere.
Language | Syntax |
---|---|
C++ | byte getSunRotation( real& rotation ) |
Python | float getSunRotation() |
Parameters
Type | Name | In/Out | Description |
---|---|---|---|
real | rotation | out | Ground rotation of the sky hemisphere (from 0 to 2PI radians). |
0 = Error getting sun rotation.
1 = Success.
Ground rotation.
Sets the ground rotation of the sky hemisphere.
Language | Syntax |
---|---|
C++ | byte setSunRotation( real rotation ) |
Python | int getSunRotation( float rotation ) |
Parameters
Type | Name | In/Out | Description |
---|---|---|---|
real | rotation | in | Ground rotation of the sky hemisphere (from 0 to 2PI radians). |
0 = Error setting sun rotation.
1 = Success.
Gets the sun properties used for both physical and constant skies when sun is enabled.
Language | Syntax |
---|---|
C++ | byte getSunProperties( byte& enabled, real& sunTemperature, real& sunPowerScaleFactor ) |
Python | {'enabled','sunTemperature','sunPowerScaleFactor'} getSunProperties() |
Type | Name | In/Out | Description |
---|---|---|---|
byte | enabled | out | Sun enabled (1) or disabled (0). |
real | sunTemperature | out | Temperature in kelvins. |
real | sunPowerScaleFactor | out | Total 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. |
0 = Error getting sun properties.
1 = Success.
Dictionary containing the sun properties.
Sets the sun properties used for both physical and constant skies when sun is enabled.
Language | Syntax |
---|---|
C++ | byte setSunProperties( byte enabled, real sunTemperature, real sunPowerScaleFactor ) |
Python | int setSunProperties( int enabled, float sunTemperature, float sunPowerScaleFactor ) |
Type | Name | In/Out | Description |
---|---|---|---|
byte | enabled | in | Sun enabled (1) or disabled (0). |
real | sunTemperature | in | Temperature in kelvins. |
real | sunPowerScaleFactor | in | Total 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. |
0 = Error setting sun properties.
1 = Success.
Gets the atmosphere parameters of the physical sky.
Language | Syntax |
---|---|
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() |
Type | Name | In/Out | Description |
---|---|---|---|
real | intensity | out | Intensity weight. Default: 1.0. Range: Any value greater than 0. |
real | ozone | out | (cms) Default: 0.4. Range: Any value greater than 0 (usually between 0 and 1). |
real | water | out | Water vapor (cms). Default: 2.0. Range: Any value greater than 0. |
real | angstromTurbidity | out | Angstrom turbidity coefficient. Default: 0.04. Range: Any value greater than 0. |
real | wavelengthTurbidity | out | Wavelength turbidity exponent. Default 1.2. Range: Any value greater than 0. |
real | aerosolAlbedo | out | Aerosol albedo. Default 0.8. Range: (0-1). |
real | asimmetryFactor | out | "Anisotropy" of aerosol. Default: 0.7. Range (-0.99999, 0.99999). |
real | planetReflectance | out | Planet reflectance. From 0 to 1. |
0 = Error getting atmosphere parameters.
1 = Success.
Dictionary containing all atmosphere parameters.
Sets the atmosphere parameters of the physical sky.
Language | Syntax |
---|---|
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 ) |
Type | Name | In/Out | Description |
---|---|---|---|
real | intensity | in | Intensity weight. Default: 1.0. Range: Any value greater than 0. |
real | ozone | in | (cms) Default: 0.4. Range: Any value greater than 0 (usually between 0 and 1). |
real | water | in | Water vapor (cms). Default: 2.0. Range: Any value greater than 0. |
real | angstromTurbidity | in | Angstrom turbidity coefficient. Default: 0.04. Range: Any value greater than 0. |
real | wavelengthTurbidity | in | Wavelength turbidity exponent. Default 1.2. Range: Any value greater than 0. |
real | aerosolAlbedo | in | Aerosol albedo. Default 0.8. Range: (0-1). |
real | asimmetryFactor | in | "Anisotropy" of aerosol. Default: 0.7. Range (-0.99999, 0.99999). |
real | planetReflectance | in | Planet reflectance. From 0 to 1. |
0 = Error setting atmosphere parameters.
1 = Success.
Gets the active sky used.
Language | Syntax |
---|---|
C++ | const char* getActiveSky() |
Python | str getActiveSky() |
Active sky name. "constant " = constant sky, "physical" = physical sky, NULL = no sky.
Sets the active sky.
Language | Syntax |
---|---|
C++ | byte setActiveSky( const char* pActiveSky ) |
Python | int setActiveSky( str pActiveSky ) |
Type | Name | In/Out | Description |
---|---|---|---|
const char* | pActiveSky | in | Active sky name. "constant " = constant sky, "physical" = physical sky, NULL = no sky. |
Return values
0 = Error setting active sky.
1 = Success.
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.
Language | Syntax |
---|---|
C++ | byte getSunDirectionUsedForRendering( Cvector3DT& dir ) |
Python | Cvector3DT getSunDirectionUsedForRendering() |
0 = Error getting sun direction.
1 = Success
Sun direction vector.
Saves current sky to an HDR file in the given path with the given resolution.
Language | Syntax |
---|---|
C++ | byte saveSkyToHDR( char* path, const dword& xRes, const dword& yRes ) |
Python | int saveSkyToHDR( str path, int xRes, int yRes ) |
0 = Error saving HDR.
1 = Success.
Saves current physical sky values to a sky preset file.
Language | Syntax |
---|---|
C++ | byte saveSkyToPreset( const char* path ) |
Python | int saveSkyToPreset( str path ) |
0 = Error saving sky.
1 = Success.
Loads a preset file into the scene replacing current physical sky values.
Language | Syntax |
---|---|
C++ | byte saveSkyToPreset( const char* path ) |
Python | int saveSkyToPreset( str path ) |
0 = Error loading sky.
1 = Success.
Returns sky RGB color (already tonemapped and after exposure is applied) of the current sky values in the given direction.
Language | Syntax |
---|---|
C++ | byte getSkyColor( Crgb& hdrRgb, Crgb8& ldrRgb, const Cvector& dir ) |
Python | dict getSkyColor( Cvector dir ) |
0 = Error getting sky color.
1 = Success.
Dictionary containing 'hdr' and 'ldr' colors.
Returns sky RGB color (without tonemapping nor exposure) of the current sky values in the given direction.
Language | Syntax |
---|---|
C++ | byte getSkyColorNoTonemapped( Crgb& hdrRgb, const Cvector& dir ) |
Python | dict getSkyColorNoTonemapped( Cvector dir ) |
0 = Error getting sky color.
1 = Success.
Cvector containing the HDR color.
Gets IBL (Image Based Lighting) state.
Language | Syntax |
---|---|
C++ | byte isEnvironmentEnabled( bool& enabled ) |
Python | bool isEnvironmentEnabled() |
0 = Error getting IBL state.
1 = Success.
IBL state.
Sets the IBL (Image Based Lighting) on/off.
Language | Syntax |
---|---|
C++ | byte enableEnvironment( bool enabled ) |
Python | int enableEnvironment( bool enabled ) |
0 = Error getting IBL state.
1 = Success.
Sets the value for the global multiplier of all the environment layers.
Language | Syntax |
---|---|
C++ | byte setEnvironmentWeight( real weight ) |
Python | int setEnvironmentWeight( float weight ) |
0 = Error setting environment weight.
1 = Success.
Sets the value for the global multiplier of all the environment layers.
Language | Syntax |
---|---|
C++ | byte getEnvironmentWeight( real& weight ) |
Python | float getEnvironmentWeight() |
0 = Error getting IBL state.
1 = Success.
Environment weight.
Gets the parameters of each environment layer.
Language | Syntax |
---|---|
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 ) |
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). |
0 = Error getting environment layer values.
1 = Success.
Dictionary containing all environment layer values.
Sets the parameters of each environment layer.
Language | Syntax |
---|---|
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 ) |
Python | int setEnvironmentLayer( str pLayerName, str pBitmapFilename, int state, bool sphericalMapping, bool interpolate, float intensity, float uTile, float vTile, float uTileOffset, float vTileOffset ) |
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). |
0 = Error setting environment layer values.
1 = Success.
Reads a material from disk.
Language | Syntax |
---|---|
C++ | Cmaxwell::Cmaterial readMaterial( const char* pFileName ) |
Python | CmaxwellMaterial readMaterial( str pFilename ) |
Returns a Cmaxwell::Cmaterial object. Null if it was not created (Cmaxwell::Cmaterial::isNull() = true).
Creates a material with the given name and adds it to the scene if the parameter addToScene is true (default).
Language | Syntax |
---|---|
C++ | Cmaxwell::Cmaterial createMaterial( const char* pMaterialName, bool addToScene = true ) |
Python | CmaxwellMaterial createMaterial( str pMaterialName, bool addToScene = True ) |
Returns a Cmaxwell::Cmaterial object. Null if it was not created (Cmaxwell::Cmaterial::isNull() = true).
Given the name of a material, returns its Cmaxwell::Cmaterial reference.
Language | Syntax |
---|---|
C++ | Cmaxwell::Cmaterial getMaterial( const char* pMaterialName ) |
Python | CmaxwellMaterial getMaterial( str pMaterialName ) |
Returns a Cmaxwell::Cmaterial object. Null if it was not created (Cmaxwell::Cmaterial::isNull() = true).
Adds a material to the scene and returns a reference to the added material.
Language | Syntax |
---|---|
C++ | Cmaxwell::Cmaterial addMaterial( Cmaxwell::Cmaterial& material ) |
Python | CmaxwellMaterial addMaterial( CmaxwellMaterial material ) |
Returns a Cmaxwell::Cmaterial object. Null if it was not created (Cmaxwell::Cmaterial::isNull() = true).
Removes unused materials from the scene.
Language | Syntax |
---|---|
C++ | byte eraseUnusedMaterials() |
Python | int eraseUnusedMaterials() |
0 = Error erasing unused materials.
1 = Success.
Sets the path and state (enabled/disabled) the material that overrides all the materials of the scene (except emitter materials).
Language | Syntax |
---|---|
C++ | void setOverrideMaterial( const char* pPathMaterial ) |
void setOverrideMaterial( bool enabled ) | |
Python | void setOverrideMaterial( str pPathMaterial ) |
void setOverrideMaterial( bool enabled ) |
Type | Name | In/Out | Description |
---|---|---|---|
const char* | pPathMaterial | in | MXM file name of the override material. |
bool | enabled | in | Sets override material state (enabled/disabled). |
Gets the path and state (enabled/disabled) of the material that overrides all the materials of the scene (except emitter materials).
Language | Syntax |
---|---|
C++ | const char* getOverrideMaterial() |
void getOverrideMaterial( bool& enabled ) | |
Python | str getOverrideMaterial() |
bool getOverrideMaterialEnabled() |
Requesting override material: File name of the MXM.
Requesting override material state: true if override material is enabled, false if not.
Sets the path and state (enabled/disabled) the material that will be used for all the objects/triangles without material.
Language | Syntax |
---|---|
C++ | void setDefaultMaterial( const char* pPathMaterial ) |
void setDefaultMaterial( bool enabled ) | |
Python | void setDefaultMaterial( str pPathMaterial ) |
void setDefaultMaterial( bool enabled ) |
Type | Name | In/Out | Description |
---|---|---|---|
const char* | pPathMaterial | in | MXM file name of the default material. |
bool | enabled | in | Sets default material state (enabled/disabled). |
Gets the path and state (enabled/disabled) of the material that will be used for all the objects/triangles without material.
Language | Syntax |
---|---|
C++ | const char* getDefaultMaterial() |
void getDefaultMaterial( bool& enabled ) | |
Python | str getDefaultMaterial() |
bool getDefaultMaterialEnabled() |
Requesting default material: File name of the MXM.
Requesting default material state: true if default material is enabled, false if not.
Gets/sets the value of the render parameter given by name.
Language | Syntax |
---|---|
C++ | byte setRenderParameter( const char* pParameterName, dword size, const void* pParameterValue ) |
byte getRenderParameter( const char* pParameterName, dword size, void* pParameterValue ) | |
Python | int setRenderParameter( str pParameterName, value ) |
value getRenderParameter( str pParameterName ) |
Type | Name | In/Out | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
const char* | pParameterName | in | Parameter name (see pParameterValue for parameter name list). | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
dword | 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:
|
0 = Error getting/setting render parameter.
1 = Success.
0 = Error setting render parameter.
1 = Success.
Parameter value.
Gets the tonemapping values.
Language | Syntax |
---|---|
C++ | byte getToneMapping( real& monitorGamma, real& burn ) |
Python | dict getToneMapping() |
0 = Error getting tonemapping value.
1 = Success.
Dictionary containing 'monitorGamma' and 'burn' values.
Sets the tonemapping values.
Language | Syntax |
---|---|
C++ | byte setToneMapping( real monitorGamma, real burn ) |
Python | int setToneMapping( float monitorGamma, float burn ) |
0 = Error setting tonemapping value.
1 = Success.
Gets the active tonemapping used: "BASIC" or "ADVANCED", default "BASIC" (Extensions only use "BASIC").
Language | Syntax |
---|---|
C++ | const char* getActiveToneMapping() |
Python | str getActiveToneMapping() |
Read scene from disk.
Language | Syntax |
---|---|
C++ | byte readMXS( const char* pPath, const Cmaxwell::CoptionsReadMXS& mxsOptions = CoptionsReadMXS() ) |
Python | int readMXS( str pPath, CoptionsReadMXS mxsOptions = CoptionsReadMXS() ) |
Type | Name | In/Out | Description |
---|---|---|---|
const char* | pPath | in | MXS file name. |
Cmaxwell::CoptionsReadMXS | mxsOptions | in | Read options. Useful to skip, in example, meshes in huge scenes. |
0 = Error reading scene.
1 = Success.
Write the scene to disk.
Language | Syntax |
---|---|
C++ | byte writeMXS( const char* pPath = NULL ) |
Python | int writeMXS( str pPath ) |
Return value
0 = Error writing scene to disk.
1 = Success.
Sets diffraction parameters.
Language | Syntax |
---|---|
C++ | byte setDiffraction( real intensity, real frequency, const char* pApperture, const char* pObstacle = NULL ) |
Python | int setDiffraction( float intensity, float frequency, str pAperture, str pObstacle = 0 ) |
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. |
0 = Error setting diffraction parameters.
1 = Success.
Gets diffraction parameters.
Language | Syntax |
---|---|
C++ | byte getDiffraction( bool& isEnabled, real& intensity, real& frequency, const char** pApperture, const char** pObstacle ) |
Python | { bool 'isEnabled', float 'intensity', float 'frequence', str 'aperture', str 'obstacle' } getDiffraction() |
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. |
0 = Error getting diffraction parameters.
1 = Success.
Dictionary containing all diffraction parameters.
Enables diffraction.
Language | Syntax |
---|---|
C++ | byte enableDiffraction() |
Python | int enableDiffraction() |
0 = Error enabling diffraction.
1 = Success.
Disables diffraction.
Language | Syntax |
---|---|
C++ | byte disableDiffraction() |
Python | int disableDiffraction() |
0 = Error disabling diffraction.
1 = Success.
Sets the output color space used by the render engine.
Language | Syntax |
---|---|
C++ | byte setColorSpace( dword type ) |
Python | int setColorSpace( int type ) |
Type | Name | In/Out | Description |
---|---|---|---|
dword | type | in | Color space selected. See COLOR_SPACES enum. |
0 = Error setting color space.
1 = Success.
Gets the output color space used by the render engine.
Language | Syntax |
---|---|
C++ | void getColorSpace( dword& type ) |
Python | int getColorSpace() |
Type | Name | In/Out | Description |
---|---|---|---|
dword | type | out | (C++) Color space used. See COLOR_SPACES enum. |
Color space used. See COLOR_SPACES enum.
Returns the gamma used by the active color space.
Language | Syntax |
---|---|
C++ | real getColorSpaceGamma() |
Python | float getColorSpaceGamma() |
Returns the latest error occurred, Cerror is defined in error.h. Useful for finding out i/o problems when reading/writing MXS/MXI files.
Language | Syntax |
---|---|
C++ | Cerror::error getLastError() |
Python | int getLastError() |
Returns an human readable string containing the latest error occurred.
Language | Syntax |
---|---|
C++ | const char* getLastErrorString() |
Python | str getLastErrorString() |
Returns an array of strings (length and content) with all the extern dependencies of the scene (textures, ior files, hdr files, etc).
Language | Syntax |
---|---|
C++ | byte getDependencies( dword& numDependencies, char**& paths ) |
Python | str[] getDependencies() |
Type | Name | In/Out | Description |
---|---|---|---|
dword | numDependencies | out | Number of dependencies. |
char** | paths | out | Dependencies' file names. |
0 = Error getting dependencies.
1 = Success.
String list containing all the dependencies.
Returns the number of objects in the scene.
Language | Syntax |
---|---|
C++ | byte getObjectsCount( dword& nObjects ) |
Python | int getObjectsCount() |
0 = Error getting objects count.
1 = Success.
Number of objects.
Returns the number of materials in the scene.
Language | Syntax |
---|---|
C++ | byte getMaterialsCount( dword& nMaterials ) |
Python | int getMaterialsCount() |
0 = Error getting materials count.
1 = Success.
Number of materials.
Returns the number of cameras in the scene.
Language | Syntax |
---|---|
C++ | byte getCamerasCount( dword& nCameras ) |
Python | int getCamerasCount() |
0 = Error getting cameras count.
1 = Success.
Number of cameras.
Returns by reference a CsceneInfo structure with information about the scene.
Language | Syntax |
---|---|
C++ | byte getSceneInfo( CsceneInfo& info ) |
Python | dict getSceneInfo() |
0 = Error getting scene info.
1 = Success.
Dictionary containing the scene info.
--TODO--
Language | Syntax |
---|---|
C++ | void computeFresnelGraph( float* pX, float* pY, dword n, real iorOutgoing ) |
Python | array list[2] computeFresnelGraph( int n, float ioirOutgoing ) |
Type | Name | In/Out | Description |
---|---|---|---|
float* | pX | out | Float array of size 'n' containing the fresnel graph in the X axis. It must be allocated before call computeFresnelGraph. --TODO-- |
float* | pY | out | Float array of size 'n' containing the fresnel graph in the Y axis. It must be allocated before call computeFresnelGraph. --TODO-- |
dword | n | in | Size of pX and pY float vectors. |
real | iorOutgoing | in | --TODO-- |
List containing both (pX and pY) vectors as NumPy arrays.
--TODO--
Language | Syntax |
---|---|
C++ | void computeAbbeGraph( float* pX, float* pY, dword n, real nd, real abbe ) |
Python | array list[2] computeAbbeGraph( int n, float nd, float abbe ) |
Type | Name | In/Out | Description |
---|---|---|---|
float* | pX | out | Float array of size 'n' containing the abbe graph in the X axis. It must be allocated before call computeAbbeGraph. --TODO-- |
float* | pY | out | Float array of size 'n' containing the abbe graph in the Y axis. It must be allocated before call computeAbbeGraph. --TODO-- |
dword | n | in | Size of pX and pY float vectors. |
real | nd | in | --TODO-- |
real | abbe | in | --TODO-- |
List containing both (pX and pY) vectors as NumPy arrays.
Gets the correlated RGB values given the temperature color.
Language | Syntax |
---|---|
C++ | byte getCorrelatedColorTemperature( Crgb& rgb, real temperature ) |
Python | Crgb getCorrelatedColorTemperature( float temperature ) |
0 = Error getting correlated Crgb. i.e. a negative temperature passed as input.
1 = Success.
Crgb color correlated to the temperature color passed as input.
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.
Language | Syntax |
---|---|
C++ | byte generateUuid( char** uuid ) |
Python | str generateUuid() |
0 = Error generating unique ID.
1 = Success.
String containing the unique ID.
Looks for the given file in all of the searching paths of the scene.
Language | Syntax |
---|---|
C++ | byte searchFileInCommonPaths( const char* fileToSearch, char*& newFoundFile ) |
Python | str searchFileInCommonPaths( str fileToSearch ) |
Type | Name | In/Out | Description |
---|---|---|---|
const char* | fileToSearch | in | File to search. |
char* | newFoundFile | out | File name of the found file. |
0 = File not found.
1 = File founded and returned in newFoundFile.
0 = File not found.
String containing found file name.
Returns the current version of Maxwell.
Language | Syntax |
---|---|
C++ | void getEngineVersion( char pVersion[64] ) |
Python | str getEngineVersion() |
Returns the current version of the Maxwell SDK.
Language | Syntax |
---|---|
C++ | void getSdkVersion( char pVersion[64] ) |
Python | str getSdkVersion() |
Returns true if for the given extension the depth is valid. In example:
Language | Syntax |
---|---|
C++ | bool isDepthSupportedForThisFormat( const char* extension, byte bitDepth ) |
Python | bool isDepthSupportedForThisFormat( str extension, int bitDepth ) |
Returns the highest bits per plane supported for the given format. In example:
Language | Syntax |
---|---|
C++ | byte isDepthSupportedForThisFormat( const char* extension ) |
Python | int isDepthSupportedForThisFormat( str extension ) |
Returns true if for the given format it is possible embedding the alpha channel.
Language | Syntax |
---|---|
C++ | byte isEmbeddingAlphaSupportedForThisFormat( const char* extension ) |
Python | int isEmbeddingAlphaSupportedForThisFormat( str extension ) |
Returns true if for the given format it is possible embedding all channels in a multilayer file.
Language | Syntax |
---|---|
C++ | byte isEmbeddingAllChannelsSupportedForThisFormat( const char* extension ) |
Python | int isEmbeddingAllChannelsSupportedForThisFormat( str extension ) |
Returns true if the extension of the given texture path is supported by the render engine.
Language | Syntax |
---|---|
C++ | byte isTextureExtensionSupported( const char* extension ) |
Python | int isTextureExtensionSupported( str extension ) |
Used to get the IES/EULUM emission pattern plotted into a square rgb buffer of size "resolution". The caller is responsible of freeing the buffer "buf" after using it.
Language | Syntax |
---|---|
C++ | byte getSquareSwatchIES( const char* file, int resolution, unsigned char*& buf ) |
Python | list getSquareSwatchIES( str file, int resolution ) |
Type | Name | In/Out | Description |
---|---|---|---|
const char* | file | in | IES/EULUM file name. |
int | resolution | in | Resolution requested. Output buffer will have resolution * resolution * 3 values. |
unsigned char*& | buf | out | Output buffer containing the emission patter. |
0 = Error getting IES/EULUM emission pattern.
1 = Success.
List of size = resolution * resolution * 3, containing the RGB emission pattern.
Used to get the IES/EULUM emission pattern plotted as a 3d object. The caller is responsible of freeing the buffers "faces, points" after using them.
Language | Syntax |
---|---|
C++ | byte getSolidLobeIES( const char* fileName, unsigned int& numPoints, unsigned int& numTriangles, unsigned int*& faces, float*& points, const char* pAxisSystem = NULL ) |
Python | dict getSolidLobeIES( str filename, str pAxisSystem = "" ) |
Type | Name | In/Out | Description |
---|---|---|---|
const char* | fileName | in | IES/EULUM file name. |
unsigned int& | numPoints | out | Number of points returned. |
unsigned int& | numTriangles | out | Number of triangles returned. |
unsigned int*& | faces | out | 0-based indices into points array : v00, v01, v02, v10, v11, v12, ..... |
float*& | points | out | Array of vertices, x0, y0, z0, x1, y1, z1, ..... |
const char* | pAxisSystem | in | Same as setInputDataType. |
0 = Error getting IES/EULUM 3D emission pattern.
1 = Success.
Dictionary containing 'numPoints', 'points', 'numTriangles' and 'faces'.
Callback types of messages given by the rendering callback.
Value | C++ | Python |
---|---|---|
0 | Cmaxwell::CALLBACK_WARNING | Cmaxwell.CALLBACK_WARNING |
1 | Cmaxwell::CALLBACK_ERROR | Cmaxwell.CALLBACK_ERROR |
2 | Cmaxwell::WRITE_USER_DATA | Cmaxwell.WRITE_USER_DATA |
3 | Cmaxwell:READ_USER_DATA | Cmaxwell.READ_USER_DATA |
Values of the _interactiveFlags property.
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 |