From dc79c22a2495f5485585e9cde0b735fe1db81d79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Mon, 19 Dec 2016 13:24:23 +0100 Subject: [PATCH] Fixed OMWriter when no faces are available (Thanks to Jamie Kydd for the patch) --- src/OpenMesh/Core/IO/writer/OMWriter.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/OpenMesh/Core/IO/writer/OMWriter.cc b/src/OpenMesh/Core/IO/writer/OMWriter.cc index b7af9ef2..9d234ccd 100644 --- a/src/OpenMesh/Core/IO/writer/OMWriter.cc +++ b/src/OpenMesh/Core/IO/writer/OMWriter.cc @@ -318,7 +318,7 @@ bool _OMWriter_::write_binary(std::ostream& _os, BaseExporter& _be, // ---------- write face normals - if ( _be.has_face_normals() && _opt.check(Options::FaceNormal) ) + if (_be.n_faces() && _be.has_face_normals() && _opt.check(Options::FaceNormal) ) { #define NEW_STYLE 0 #if NEW_STYLE @@ -353,7 +353,7 @@ bool _OMWriter_::write_binary(std::ostream& _os, BaseExporter& _be, // ---------- write face color - if (_be.has_face_colors() && _opt.check( Options::FaceColor )) + if (_be.n_faces() && _be.has_face_colors() && _opt.check( Options::FaceColor )) { #define NEW_STYLE 0 #if NEW_STYLE