Pārlūkot izejas kodu

Merge pull request #5161 from malytomas/master

fix incorrect default for material::get with aiColor3D
Kim Kulling 2 gadi atpakaļ
vecāks
revīzija
2f6f58707d
1 mainītis faili ar 2 papildinājumiem un 1 dzēšanām
  1. 2 1
      include/assimp/material.inl

+ 2 - 1
include/assimp/material.inl

@@ -211,7 +211,8 @@ AI_FORCE_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);
+    if (ret == aiReturn_SUCCESS)
+        pOut = aiColor3D(c.r,c.g,c.b);
     return ret;
 }
 // ---------------------------------------------------------------------------