diff --git a/code/MaterialSystem.cpp b/code/MaterialSystem.cpp index 50c403fe1..1921c7f78 100644 --- a/code/MaterialSystem.cpp +++ b/code/MaterialSystem.cpp @@ -247,6 +247,18 @@ aiReturn aiGetMaterialColor(const aiMaterial* pMat, return eRet; } +// ------------------------------------------------------------------------------------------------ +// Get a aiUVTransform (4 floats) from the material +aiReturn aiGetMaterialUVTransform(const aiMaterial* pMat, + const char* pKey, + unsigned int type, + unsigned int index, + aiUVTransform* pOut) +{ + unsigned int iMax = 4; + return aiGetMaterialFloatArray(pMat,pKey,type,index,(float*)pOut,&iMax); +} + // ------------------------------------------------------------------------------------------------ // Get a string from the material aiReturn aiGetMaterialString(const aiMaterial* pMat, diff --git a/include/assimp/material.h b/include/assimp/material.h index 9151c8ec5..2c8ad1d5c 100644 --- a/include/assimp/material.h +++ b/include/assimp/material.h @@ -1473,6 +1473,18 @@ ASSIMP_API C_ENUM aiReturn aiGetMaterialColor(const C_STRUCT aiMaterial* pMat, C_STRUCT aiColor4D* pOut); +// --------------------------------------------------------------------------- +/** @brief Retrieve a aiUVTransform value from the material property table +* +* See the sample for aiGetMaterialFloat for more information*/ +// --------------------------------------------------------------------------- +ASSIMP_API C_ENUM aiReturn aiGetMaterialUVTransform(const C_STRUCT aiMaterial* pMat, + const char* pKey, + unsigned int type, + unsigned int index, + C_STRUCT aiUVTransform* pOut); + + // --------------------------------------------------------------------------- /** @brief Retrieve a string from the material property table * diff --git a/include/assimp/material.inl b/include/assimp/material.inl index ffb000937..3c269cd1b 100644 --- a/include/assimp/material.inl +++ b/include/assimp/material.inl @@ -167,6 +167,12 @@ inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type, { return aiGetMaterialString(this,pKey,type,idx,&pOut); } +// --------------------------------------------------------------------------- +inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type, + unsigned int idx,aiUVTransform& pOut) const +{ + return aiGetMaterialUVTransform(this,pKey,type,idx,&pOut); +} // ---------------------------------------------------------------------------