Hey guys,
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.
Just calling
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.
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:
opencommands=Queue()
class App(ShowBase):
def __init__(self):
ShowBase.__init__(self)
############# handle incomming commands
# Current, Threaded solution:
self.processing=True
command_thread=Thread(target=self.processCommands)
command_thread.daemon=True
command_thread.start()
def processCommands(self):
'''
Only this thread may call functions, that write any kind of data.
'''
while self.processing:
cmd=opencommands.get(True,None)
opencommands.task_done()
cmdID=cmd[0]
args=cmd[1]
self.commandToF[cmdID](args)
app = App()
app.run()
Edit: The error occurs, when models are added using