Mesh: Workaround to load 3mf files not supported by zipios library

This commit is contained in:
wmayer
2024-08-17 19:36:04 +02:00
committed by wwmayer
parent 3595c301b7
commit 8f18cfaf3a
5 changed files with 73 additions and 1 deletions

View File

@@ -393,3 +393,17 @@ std::vector<std::string> Base::Tools::splitSubName(const std::string& subname)
return subNames;
}
// ------------------------------------------------------------------------------------------------
void Base::ZipTools::rewrite(const std::string& source, const std::string& target)
{
Base::PyGILStateLocker lock;
PyObject* module = PyImport_ImportModule("freecad.utils_zip");
if (!module) {
throw Py::Exception();
}
Py::Module commands(module, true);
commands.callMemberFunction("rewrite", Py::TupleN(Py::String(source), Py::String(target)));
}