Hi everyone, this question concerns the HDK 10.
I have a SOP node where I run a simulation and I want the ability to pause the simulation from a GUI button in the interface.
In short I want to start the simulation on a separate thread so houdini could be alive and answering to input (the pause button).
My current approach is to create a UT_Thread and start the simulation function in that thread, however the thread is terminated when my buttons callback function returns:
static callback_function, called when “start simulation” button is pressed:
UT_ThreadSet myThread(1);
myThread.setFunc((void *(*)(void *))&cewl);
myThread.go();
return 1; // myThread is terminated here.
So, what I would like to do is some sort of wait:
UT_ThreadSet myThread(1);
myThread.setFunc((void *(*)(void *))&cewl);
myThread.go();
myThread.wait()
return 1;
But that does not work either because it will still freeze the GUI in houdini. Are there any ‘refresh gui’ - functions or something like that? Any other suggestions on how I should do this?