浏览代码

Fix: Let OpenGEX accept color3 types (#6040)

- will set alpha channel to 1.0f, if no alpha channel was found.
- closes https://github.com/assimp/assimp/issues/6039
Kim Kulling 6 月之前
父节点
当前提交
c1eedbba8e
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      code/AssetLib/OpenGEX/OpenGEXImporter.cpp

+ 3 - 3
code/AssetLib/OpenGEX/OpenGEXImporter.cpp

@@ -783,10 +783,10 @@ static void fillColor4(aiColor4D *col4, Value *vals) {
     col4->b = next->getFloat();
     next = next->m_next;
     if (!next) {
-        throw DeadlyImportError("OpenGEX: Not enough values to fill 4-element color, only 3");
+        col4->a = 1.0f;
+    } else {
+        col4->a = next->getFloat();
     }
-
-    col4->a = next->getFloat();
 }
 
 //------------------------------------------------------------------------------------------------