What I'm doing is:
- Code: Select all
thread.start_new_thread(ThreadedUpdate, (self, self.blocks, self.blockTexture, self.x, self.y, self.z))
- Code: Select all
def ThreadedUpdate(self, blocks, blockTexture, x, y, z):
...
self.threadQueue.put_nowait(geom)
Then later
- Code: Select all
geom = self.threadQueue.get_nowait()
node.setGeom(geomId, geom)
I can print out the geom after the thread creates it, but the game freezes without displaying errors as soon as I call setGeom with the new geom. If I do everything the same, but call ThreadUpdate without giving it its own thread, it works successfully.
I noticed the warning in the API, but I'm not quite sure what it means:
Description: Replaces the nth Geom of the node with a new pointer. There must already be a Geom in this slot.
Note that if this method is called in a downstream stage (for instance, during cull or draw), then it will propagate the new list of Geoms upstream all the way to pipeline stage 0, which may step on changes that were made independently in pipeline stage 0. Use with caution.
