Skip to content

Commit

Permalink
Write the COLR chunk into SURF, otherwise Lightwave will crash.
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed Jul 29, 2017
1 parent cc7d49a commit 57ab1bd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions plugins/model/Lwo2Exporter.cpp
Expand Up @@ -368,6 +368,14 @@ void Lwo2Exporter::exportToStream(std::ostream& stream)
writeString(surf->stream, surface.materialName);
writeString(surf->stream, ""); // empty parent name

// Define the base surface colour as <1.0, 1.0, 1.0>
Chunk::Ptr colr = surf->addChunk("COLR", Chunk::Type::SubChunk);

stream::writeBigEndian<float>(colr->stream, 1.0f);
stream::writeBigEndian<float>(colr->stream, 1.0f);
stream::writeBigEndian<float>(colr->stream, 1.0f);
writeVariableIndex(colr->stream, 0);

// Define the BLOK subchunk
Chunk::Ptr blok = surf->addChunk("BLOK", Chunk::Type::SubChunk);

Expand Down

0 comments on commit 57ab1bd

Please sign in to comment.