Trying to update a custom terrain, made out of a single GeomNode, which has a series of GeomPrimitives, GeomTristrips. Building the terrain is fine. Trying to update it at 10 Hz is a problem though.
Sometimes it will work for a while, sometimes it will crash right away, so definitely a race condition.
I’m only modifying the positions of the geometries, not reordering the primitive array.
PT(GeomVertexData) moddata = terrain_geom_->modify_vertex_data();
GeomVertexRewriter vertex = GeomVertexRewriter(moddata, "vertex");
causes it to crash. I’m not even changing values yet.
The error I get is
/usr/include/panda3d/mutexPosixImpl.I:42: MutexPosixImpl::~MutexPosixImpl(): Assertion `result == 0' failed.
I was wondering if perhaps I have multiple primitives inside the Geom, but switched that to a single primitive and still doing the same.
Also, I’m setting up the GeomVertexData like this
new GeomVertexData("terrain", GeomVertexFormat::get_v3c4(), Geom::UH_static);
Ahh, I see. Any ideas to a workaround until the fix is released? I haven’t had this issue in the past when implementing similar dynamic geometry processes. Not sure what I’m doing this time that is different other than using a different primitive type.
The workaround is not to use threading for now.
I just encountered the same, while using Python. Searching revealed, that other topics seem to exist, e.g. [url]Help on a tenacious bug], but a real solution does not.
I would be fine, to un-Thread it, but how would I go about it?
Currently there is one function, which writes Panda-Things (e.g. insert and remove models), which runs as a Thread. When it would be called directly, it would block, never return and then Panda won’t render anything (The window stays black).
Important code parts:
############# handle incomming commands
# Current, Threaded solution:
Only this thread may call functions, that write any kind of data.
app = App()
Edit: The error occurs, when models are added using
The code is called from aforementioned Thread.