GlobalUtilsInterface Class Reference

#include <globalimport.h>

Inheritance diagram for GlobalUtilsInterface:

Detailed Description

GlobalUtils provides some helper functionality to react to global import settings.

Static Public Member Functions

static MAXON_METHOD Result< void > ConvertObjects (BaseArray< BaseObject * > &objList, const Delegate< Result< void >(BaseObject *, BaseObject *)> &customOperation=nullptr)
 
static MAXON_METHOD Result< BaseMaterial * > CreateGenericMaterial (const material::MaterialExchangeData &materialData, Id nodeSpace, BaseDocument &baseDocument)
 
static MAXON_METHOD Result< void > ConvertTextureTosRGB (ImageTextureRef &textureRef)
 
static MAXON_METHOD Color ComputeColorTemperatureRGB (Float fTemperature, Bool bNormalize, Float fReference=6500)
 
static MAXON_METHOD Result< FloatRSLightGetBaseIntensity (BaseObject *object)
 
static MAXON_METHOD Result< void > RSLightConvertToUnit (BaseObject *object, Int32 targetUnitId)
 
static MAXON_METHOD Color GetRandomColor (Int32 seed)
 

Private Member Functions

 MAXON_INTERFACE (GlobalUtilsInterface, MAXON_REFERENCE_NORMAL, "net.maxon.exchange.interface.globalutils")
 

Private Attributes

 MAXON_INTERFACE_SINGLE_IMPLEMENTATION
 

Member Function Documentation

◆ MAXON_INTERFACE()

MAXON_INTERFACE ( GlobalUtilsInterface  ,
MAXON_REFERENCE_NORMAL  ,
"net.maxon.exchange.interface.globalutils"   
)
private

◆ ConvertObjects()

static MAXON_METHOD Result<void> ConvertObjects ( BaseArray< BaseObject * > &  objList,
const Delegate< Result< void >(BaseObject *, BaseObject *)> &  customOperation = nullptr 
)
static

Converts passed object to Redshift Objects.

Parameters
[in]objListThe list of objects to convert.
Returns
The converted list of objects.

◆ CreateGenericMaterial()

static MAXON_METHOD Result<BaseMaterial*> CreateGenericMaterial ( const material::MaterialExchangeData materialData,
Id  nodeSpace,
BaseDocument baseDocument 
)
static

Creates a generic material based on basic material data and node space.

Parameters
[in]materialDataThe properties of the material.
[in]nodeSpaceThe node space ID the material is created for.
[in]baseDocumentThe active document the import is happening. Note: The material will not be inserted into the document!
Returns
The pointer to the created material.

◆ ConvertTextureTosRGB()

static MAXON_METHOD Result<void> ConvertTextureTosRGB ( ImageTextureRef &  textureRef)
static

Convert an ImageTextureRef to an sRGB color profile.

Parameters
[in,out]textureRefThe texture to transform the color profile.
Returns
The error if any.

◆ ComputeColorTemperatureRGB()

static MAXON_METHOD Color ComputeColorTemperatureRGB ( Float  fTemperature,
Bool  bNormalize,
Float  fReference = 6500 
)
static

Convert a temperature value to a RGB color value.

Parameters
[in]fTemperatureThe temperature value to convert.
[in]fReferenceThe reference temperature usually 6500
[in]bNormalizeNormalize the color, so values are between 0 and 1.
Returns
The corresponding color value.

◆ RSLightGetBaseIntensity()

static MAXON_METHOD Result<Float> RSLightGetBaseIntensity ( BaseObject object)
static

Retrieve base intensity from the redshift light object. Base intensity is a raw (unnormalized, no scaling factor, in metric spatial system) intensity that is used for "Image" units in redshift lights.

Parameters
[in]objectredshift light object
Returns
base intensity calculated from the given redshift light object

◆ RSLightConvertToUnit()

static MAXON_METHOD Result<void> RSLightConvertToUnit ( BaseObject object,
Int32  targetUnitId 
)
static

Convert given redshift light intensity to the target units.

Parameters
[in,out]objectredshift light object to perform conversion on
[in]targetUnitIdid of the target light units (defined in orslight.h with prefix REDSHIFT_LIGHT_UNITSTYPE_)
Returns
The error if any

◆ GetRandomColor()

static MAXON_METHOD Color GetRandomColor ( Int32  seed)
static

Creates a random color with a random hue but consistent saturation and value (lightness).

Parameters
[in]seedSeed for random number generator
Returns
Random color

Member Data Documentation

◆ MAXON_INTERFACE_SINGLE_IMPLEMENTATION

MAXON_INTERFACE_SINGLE_IMPLEMENTATION
private