Jump to content

save mesh


photo

Recommended Posts

Posted

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?

Posted

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:

Posted

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");
}

Posted

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:

Posted

With engine initialization it works, but
this is an excess operation for the export plugin to the .mesh format

Posted

how then to initialize the engine without launching the render window and other windows (in the background)

Posted

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:

×
×
  • Create New...