Merge pull request #5184 from csritter/v0.8.0

Adding --surface-colour in conversion settings to force the use of surface color instead of diffuse color. Issue #5075
This commit is contained in:
Thomas Krijnen
2024-10-02 17:24:34 +02:00
committed by GitHub
8 changed files with 38 additions and 15 deletions
+2 -2
View File
@@ -97,9 +97,9 @@ int GltfSerializer::writeMaterial(const ifcopenshell::geometry::taxonomy::style:
std::array<double, 4> base;
base.fill(1.0);
if (style->diffuse) {
if (style->get_color()) {
for (int i = 0; i < 3; ++i) {
base[i] = style->diffuse.ccomponents()(i);
base[i] = style->get_color().ccomponents()(i);
}
}
if (style->transparency == style->transparency) {
+1 -1
View File
@@ -67,7 +67,7 @@ void WaveFrontOBJSerializer::writeMaterial(const ifcopenshell::geometry::taxonom
mtl_stream.stream << "newmtl " << material_name << "\n";
{
auto& diffuse = style.diffuse.ccomponents();
auto& diffuse = style.get_color().ccomponents();
mtl_stream.stream << "Kd " << diffuse(0) << " " << diffuse(1) << " " << diffuse(2) << "\n";
}
if (style.specular) {