diff --git a/include/aiMaterial.inl b/include/aiMaterial.inl index 0221031db..520e88377 100644 --- a/include/aiMaterial.inl +++ b/include/aiMaterial.inl @@ -75,8 +75,9 @@ inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type, { unsigned int iNum = pMax ? *pMax : 1; - aiMaterialProperty* prop; - aiReturn ret = ::aiGetMaterialProperty(this,pKey,type,idx,&prop); + const aiMaterialProperty* prop; + const aiReturn ret = ::aiGetMaterialProperty(this,pKey,(aiTextureType)type,idx, + (const aiMaterialProperty**)&prop); if ( AI_SUCCESS == ret ) { if (prop->mDataLength < sizeof(Type)*iNum) { @@ -100,8 +101,9 @@ template inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type, unsigned int idx,Type& pOut) const { - aiMaterialProperty* prop; - aiReturn ret = ::aiGetMaterialProperty(this,pKey,type,idx,&prop); + const aiMaterialProperty* prop; + const aiReturn ret = ::aiGetMaterialProperty(this,pKey,(aiTextureType)type,idx, + (const aiMaterialProperty**)&prop); if ( AI_SUCCESS == ret ) { if (prop->mDataLength < sizeof(Type)) { @@ -156,6 +158,16 @@ inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type, } // --------------------------------------------------------------------------- template <> +inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type, + unsigned int idx,aiColor3D& pOut) const +{ + aiColor4D c; + const aiReturn ret = aiGetMaterialColor(this,pKey,type,idx,&c); + pOut = aiColor3D(c.r,c.g,c.b); + return ret; +} +// --------------------------------------------------------------------------- +template <> inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type, unsigned int idx,aiString& pOut) const {