Vladimir_tyutenkov Posted September 18, 2019 Posted September 18, 2019 Hello, need help I create mesh, add vertices, indexes, texture coordinates, normals to it Then I try to save and get an error "Attempting to read or write to protected memory" I tried to insert an example from sdk https://developer.unigine.com/en/docs/2.7/code/usage/mesh_class/index?rlang=cpp // create an empty Mesh instance MeshPtr box = Mesh :: create (); // add a box surface to the Mesh box-> addBoxSurface ("surface_box", Math :: vec3 (1.0f)); // save the box to a file box-> save ("box.mesh"); and also get an error, what could be the problem?
silent Posted September 18, 2019 Posted September 18, 2019 Hi Vladimir, Sorry, but we can't reproduce the same behavior on our side (tested on 2.7.3 SDK), save is working as expected. Could you please send us a minimal reproduction code? Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
Vladimir_tyutenkov Posted September 18, 2019 Author Posted September 18, 2019 minimal code #include <iostream> #include <UnigineApp.h> #include <UnigineConsole.h> #include <UnigineEngine.h> #include <UnigineGame.h> #include <UnigineLights.h> #include <UnigineLogic.h> #include <UnigineWorld.h> #include <UnigineEditor.h> #include <UnigineBounds.h> #include <UnigineInterpreter.h> using namespace Unigine; using namespace Unigine::Math; int main() { MeshPtr box = Mesh::create(); // add a box surface to the Mesh box->addBoxSurface("surface_box", Math::vec3(1.0f)); // save the box to a file box->save("box.mesh"); }
silent Posted September 18, 2019 Posted September 18, 2019 Try to initialize engine first: int main(int argc, char **argv) { EnginePtr engine(UNIGINE_VERSION, argc, argv); // engine init MeshPtr box = Mesh::create(); // add a box surface to the Mesh box->addBoxSurface("surface_box", Math::vec3(1.0f)); // save the box to a file box->save("box.mesh"); } How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
Vladimir_tyutenkov Posted September 18, 2019 Author Posted September 18, 2019 With engine initialization it works, but this is an excess operation for the export plugin to the .mesh format
silent Posted September 18, 2019 Posted September 18, 2019 I'm afraid, it's not possible to use Engine API without initialization of Engine itself. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
Vladimir_tyutenkov Posted September 18, 2019 Author Posted September 18, 2019 how then to initialize the engine without launching the render window and other windows (in the background)
silent Posted September 18, 2019 Posted September 18, 2019 You can use -video_app null command line option to run process without window and graphics context. In that case all GPU-related classes (Texture, Render and similar) will be unavailable. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
Recommended Posts