Skip to content

Commit

Permalink
fix: Mute partio error prints (#1774)
Browse files Browse the repository at this point in the history
Signed-off-by: Ole Gulbrandsen <[email protected]>
  • Loading branch information
olegul authored and lgritz committed Mar 1, 2024
1 parent ee3403a commit e94b0fe
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/liboslexec/pointcloud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage

#include <cstdarg>
#include <sstream>

#include "pointcloud.h"

Expand All @@ -29,7 +30,13 @@ PointCloud::get(ustringhash filename, bool write)
// Not found. Create a new one.
Partio::ParticlesDataMutable* partio_cloud = nullptr;
if (!write) {
partio_cloud = Partio::read(filename.c_str(), false);
// Mute Partio error prints: by default Partio::read sends errors directly
// to std::err, but in most cases we want errors to go via errorfmt so the
// renderer can recognize the message as an error, as we do in
// pointcloud_search and pointcloud_get.
std::stringstream m_errorStream;

partio_cloud = Partio::read(filename.c_str(), false, m_errorStream);
if (!partio_cloud)
return nullptr;
} else {
Expand Down

0 comments on commit e94b0fe

Please sign in to comment.