diff --git a/include/mitsuba/render/trimesh.h b/include/mitsuba/render/trimesh.h index fb256d17..1ddac72c 100644 --- a/include/mitsuba/render/trimesh.h +++ b/include/mitsuba/render/trimesh.h @@ -54,6 +54,7 @@ struct TangentSpace { /** \brief Abstract triangle mesh base class * \ingroup librender + e \ingroup libpython */ class MTS_EXPORT_RENDER TriMesh : public Shape { public: diff --git a/src/libpython/render.cpp b/src/libpython/render.cpp index 8079405b..e70434b8 100644 --- a/src/libpython/render.cpp +++ b/src/libpython/render.cpp @@ -211,6 +211,25 @@ void export_render() { .def("getPrimitiveCount", &Shape::getPrimitiveCount) .def("getEffectivePrimitiveCount", &Shape::getEffectivePrimitiveCount); + void (TriMesh::*triMesh_serialize1)(Stream *stream) const = &TriMesh::serialize; + void (TriMesh::*triMesh_serialize2)(Stream *stream, InstanceManager *) const = &TriMesh::serialize; + + BP_CLASS(TriMesh, Shape, (bp::init())) + .def(bp::init()) + .def(bp::init()) + .def("getTriangleCount", &TriMesh::getTriangleCount) + .def("getVertexCount", &TriMesh::getVertexCount) + .def("hasVertexNormals", &TriMesh::hasVertexNormals) + .def("hasVertexColors", &TriMesh::hasVertexColors) + .def("hasVertexTexcoords", &TriMesh::hasVertexTexcoords) + .def("hasUVTangents", &TriMesh::hasUVTangents) + .def("computeUVTangents", &TriMesh::computeUVTangents) + .def("computeNormals", &TriMesh::computeNormals) + .def("rebuildTopology", &TriMesh::rebuildTopology) + .def("serialize", triMesh_serialize1) + .def("serialize", triMesh_serialize2) + .def("writeOBJ", &TriMesh::writeOBJ); + BP_STRUCT(BSDFSamplingRecord, (bp::init())) .def(bp::init()) .def(bp::init()) diff --git a/src/librender/trimesh.cpp b/src/librender/trimesh.cpp index a32bd3ac..7a85e25f 100644 --- a/src/librender/trimesh.cpp +++ b/src/librender/trimesh.cpp @@ -818,9 +818,10 @@ void TriMesh::writeOBJ(const fs::path &path) const { } for (size_t i=0; i