Assimp  v4.1. (December 2018)
MaterialSystem.cpp File Reference

Implementation of the material system of the library. More...

Functions

aiReturn aiGetMaterialColor (const aiMaterial *pMat, const char *pKey, unsigned int type, unsigned int index, aiColor4D *pOut)
 __cplusplus More...
 
aiReturn aiGetMaterialFloatArray (const aiMaterial *pMat, const char *pKey, unsigned int type, unsigned int index, ai_real *pOut, unsigned int *pMax)
 Retrieve an array of float values with a specific key from the material. More...
 
aiReturn aiGetMaterialIntegerArray (const aiMaterial *pMat, const char *pKey, unsigned int type, unsigned int index, int *pOut, unsigned int *pMax)
 __cplusplus More...
 
aiReturn aiGetMaterialProperty (const aiMaterial *pMat, const char *pKey, unsigned int type, unsigned int index, const aiMaterialProperty **pPropOut)
 Retrieve a material property with a specific key from the material. More...
 
aiReturn aiGetMaterialString (const aiMaterial *pMat, const char *pKey, unsigned int type, unsigned int index, aiString *pOut)
 Retrieve a string from the material property table. More...
 
aiReturn aiGetMaterialTexture (const C_STRUCT aiMaterial *mat, aiTextureType type, unsigned int index, C_STRUCT aiString *path, aiTextureMapping *_mapping, unsigned int *uvindex, ai_real *blend, aiTextureOp *op, aiTextureMapMode *mapmode, unsigned int *flags)
 
ASSIMP_API unsigned int aiGetMaterialTextureCount (const C_STRUCT aiMaterial *pMat, C_ENUM aiTextureType type)
 
aiReturn aiGetMaterialUVTransform (const aiMaterial *pMat, const char *pKey, unsigned int type, unsigned int index, aiUVTransform *pOut)
 Retrieve a aiUVTransform value from the material property table. More...
 

Variables

static const unsigned int DefaultNumAllocated = 5
 

Detailed Description

Implementation of the material system of the library.

Function Documentation

◆ aiGetMaterialColor()

aiReturn aiGetMaterialColor ( const aiMaterial pMat,
const char *  pKey,
unsigned int  type,
unsigned int  index,
aiColor4D pOut 
)

__cplusplus

Retrieve a color value from the material property table

See the sample for aiGetMaterialFloat for more information

◆ aiGetMaterialFloatArray()

aiReturn aiGetMaterialFloatArray ( const aiMaterial pMat,
const char *  pKey,
unsigned int  type,
unsigned int  index,
ai_real pOut,
unsigned int *  pMax 
)

Retrieve an array of float values with a specific key from the material.

Pass one of the AI_MATKEY_XXX constants for the last three parameters (the example reads the AI_MATKEY_UVTRANSFORM property of the first diffuse texture)

unsigned int max = sizeof(aiUVTransform);
(float*)&trafo, &max) || sizeof(aiUVTransform) != max)
{
// error handling
}
Parameters
pMatPointer to the input material. May not be NULL
pKeyKey to search for. One of the AI_MATKEY_XXX constants.
pOutPointer to a buffer to receive the result.
pMaxSpecifies the size of the given buffer, in float's. Receives the number of values (not bytes!) read.
type(see the code sample above)
index(see the code sample above)
Returns
Specifies whether the key has been found. If not, the output arrays remains unmodified and pMax is set to 0.

◆ aiGetMaterialIntegerArray()

aiReturn aiGetMaterialIntegerArray ( const aiMaterial pMat,
const char *  pKey,
unsigned int  type,
unsigned int  index,
int *  pOut,
unsigned int *  pMax 
)

__cplusplus

Retrieve an array of integer values with a specific key from a material

See the sample for aiGetMaterialFloatArray for more information.

◆ aiGetMaterialProperty()

aiReturn aiGetMaterialProperty ( const aiMaterial pMat,
const char *  pKey,
unsigned int  type,
unsigned int  index,
const aiMaterialProperty **  pPropOut 
)

Retrieve a material property with a specific key from the material.

Parameters
pMatPointer to the input material. May not be NULL
pKeyKey to search for. One of the AI_MATKEY_XXX constants.
typeSpecifies the type of the texture to be retrieved ( e.g. diffuse, specular, height map ...)
indexIndex of the texture to be retrieved.
pPropOutPointer to receive a pointer to a valid aiMaterialProperty structure or NULL if the key has not been found.

◆ aiGetMaterialString()

aiReturn aiGetMaterialString ( const aiMaterial pMat,
const char *  pKey,
unsigned int  type,
unsigned int  index,
aiString pOut 
)

Retrieve a string from the material property table.

See the sample for aiGetMaterialFloat for more information.

◆ aiGetMaterialTexture()

aiReturn aiGetMaterialTexture ( const C_STRUCT aiMaterial mat,
aiTextureType  type,
unsigned int  index,
C_STRUCT aiString path,
aiTextureMapping _mapping,
unsigned int *  uvindex,
ai_real blend,
aiTextureOp op,
aiTextureMapMode mapmode,
unsigned int *  flags 
)

◆ aiGetMaterialTextureCount()

ASSIMP_API unsigned int aiGetMaterialTextureCount ( const C_STRUCT aiMaterial pMat,
C_ENUM aiTextureType  type 
)

◆ aiGetMaterialUVTransform()

aiReturn aiGetMaterialUVTransform ( const aiMaterial pMat,
const char *  pKey,
unsigned int  type,
unsigned int  index,
aiUVTransform pOut 
)

Retrieve a aiUVTransform value from the material property table.

See the sample for aiGetMaterialFloat for more information

Variable Documentation

◆ DefaultNumAllocated

const unsigned int DefaultNumAllocated = 5
static