Browse Source

Fix casting typo in D3MFExporter::writeBaseMaterials (color channels < 1.0f were zeroed out) (#5681)

Co-authored-by: Kim Kulling <[email protected]>
Olivier Chafik 11 months ago
parent
commit
f39f53e860
1 changed files with 4 additions and 4 deletions
  1. 4 4
      code/AssetLib/3MF/D3MFExporter.cpp

+ 4 - 4
code/AssetLib/3MF/D3MFExporter.cpp

@@ -249,10 +249,10 @@ void D3MFExporter::writeBaseMaterials() {
             if (color.r <= 1 && color.g <= 1 && color.b <= 1 && color.a <= 1) {
             if (color.r <= 1 && color.g <= 1 && color.b <= 1 && color.a <= 1) {
 
 
                 hexDiffuseColor = ai_rgba2hex(
                 hexDiffuseColor = ai_rgba2hex(
-                        (int)((ai_real)color.r) * 255,
-                        (int)((ai_real)color.g) * 255,
-                        (int)((ai_real)color.b) * 255,
-                        (int)((ai_real)color.a) * 255,
+                        (int)(((ai_real)color.r) * 255),
+                        (int)(((ai_real)color.g) * 255),
+                        (int)(((ai_real)color.b) * 255),
+                        (int)(((ai_real)color.a) * 255),
                         true);
                         true);
 
 
             } else {
             } else {