only write custom properties if the Custom option is set

This commit is contained in:
Max Lyon
2023-02-06 10:10:59 +01:00
parent 4088194eee
commit e097a50a6e
2 changed files with 26 additions and 25 deletions

View File

@@ -110,7 +110,7 @@ public:
FaceTexCoord = 0x0400, ///< Has (r) / store (w) face texture coordinates
ColorAlpha = 0x0800, ///< Has (r) / store (w) alpha values for colors
ColorFloat = 0x1000, ///< Has (r) / store (w) float values for colors (currently only implemented for PLY and OFF files)
Custom = 0x2000, ///< Has (r) custom properties (currently only implemented in PLY Reader ASCII version)
Custom = 0x2000, ///< Has (r) / store (w) custom properties (currently PLY only supports reading and only ASCII version. OM supports reading and writing)
Status = 0x4000, ///< Has (r) / store (w) status properties
TexCoordST = 0x8000 ///< Write texture coordinates as ST instead of UV
};

View File

@@ -562,8 +562,8 @@ bool _OMWriter_::write_binary(std::ostream& _os, BaseExporter& _be,
// -------------------- write custom properties
if (_opt.check(Options::Custom))
{
const auto store_property = [this, &_os, swap, &bytes](
const BaseKernel::const_prop_iterator _it_begin,
const BaseKernel::const_prop_iterator _it_end,
@@ -590,6 +590,7 @@ bool _OMWriter_::write_binary(std::ostream& _os, BaseExporter& _be,
OMFormat::Chunk::Entity_Halfedge);
store_property(_be.kernel()->mprops_begin(), _be.kernel()->mprops_end(),
OMFormat::Chunk::Entity_Mesh);
}
memset(&chunk_header, 0, sizeof(chunk_header));
chunk_header.name_ = false;