MCPcopy Create free account
hub / github.com/assimp/assimp / aiGetMaterialColor

Function aiGetMaterialColor

code/Material/MaterialSystem.cpp:278–292  ·  view source on GitHub ↗

------------------------------------------------------------------------------------------------ Get a color (3 or 4 floats) from the material

Source from the content-addressed store, hash-verified

276// ------------------------------------------------------------------------------------------------
277// Get a color (3 or 4 floats) from the material
278aiReturn aiGetMaterialColor(const aiMaterial *pMat,
279 const char *pKey,
280 unsigned int type,
281 unsigned int index,
282 aiColor4D *pOut) {
283 unsigned int iMax = 4;
284 const aiReturn eRet = aiGetMaterialFloatFloatArray(pMat, pKey, type, index, (float *)pOut, &iMax);
285
286 // if no alpha channel is defined: set it to 1.0
287 if (3 == iMax) {
288 pOut->a = 1.0;
289 }
290
291 return eRet;
292}
293
294// ------------------------------------------------------------------------------------------------
295// Get a aiUVTransform (5 floats) from the material

Callers 3

CreateMaterialMethod · 0.85
apply_materialFunction · 0.85
apply_materialFunction · 0.85

Calls 1

Tested by

no test coverage detected