Skip to content

Commit 644689e

Browse files
committed
fix(MeshOutput): better handle native output requirements
1 parent 32c5831 commit 644689e

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

bindings/python/src/mesh/core/light_regular_grid.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,6 @@ namespace
4646
.def( pybind11::init< geode::Point< dimension >,
4747
std::array< geode::index_t, dimension >,
4848
std::array< geode::Vector< dimension >, dimension > >() )
49-
.def( "vertex_attribute_manager",
50-
&geode::Grid< dimension >::grid_vertex_attribute_manager,
51-
pybind11::return_value_policy::reference )
52-
.def( dimension == 2 ? "polygon_attribute_manager"
53-
: "polyhedron_attribute_manager",
54-
&geode::Grid< dimension >::cell_attribute_manager,
55-
pybind11::return_value_policy::reference )
5649
.def( "native_extension",
5750
&geode::LightRegularGrid< dimension >::native_extension );
5851
}

include/geode/mesh/io/geode/geode_bitsery_mesh_output.hpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,18 @@
3232
#include <geode/mesh/core/bitsery_archive.hpp>
3333

3434
#define BITSERY_WRITE( Mesh ) \
35+
bool is_saveable( const Mesh& mesh ) const final \
36+
{ \
37+
return mesh.impl_name() == OpenGeode##Mesh::impl_name_static(); \
38+
} \
39+
\
3540
std::vector< std::string > write( const Mesh& mesh ) const final \
3641
{ \
42+
OPENGEODE_EXCEPTION( \
43+
mesh.impl_name() == OpenGeode##Mesh::impl_name_static(), \
44+
"[Bitsery] Cannot save ", mesh.type_name(), \
45+
" in native format because it is not ", \
46+
OpenGeode##Mesh::impl_name() ); \
3747
std::ofstream file{ to_string( this->filename() ), \
3848
std::ofstream::binary }; \
3949
TContext context{}; \

0 commit comments

Comments
 (0)