Page 1 of 1

activate GUI via Python

Posted: Tue Jan 18, 2011 5:42 pm
by timao
Hello,

I just tried to use the scene.videoPreview() command as a SimulationPost event script. To speed up the simulation I've disabled the GUI (ALT+d). Is there a way to enable the GUI via python, so that the preview window is usefull?

At the moment I use two different video creation setups. Both are shell commands as a "Post Action"
1. On Windows a pyhton script edits and excecutes a Nuke script that creates a quicktime movie.
2. On Linux I use the ffmpeg tip from Jorge Medina.
http://rfwisdom.wordpress.com/2010/05/1 ... ne-option/

If there are other solutions to create a video after the simulation, please let me know.
Cheers

Re: activate GUI via Python

Posted: Tue Jan 18, 2011 5:49 pm
by Alex
Hi Timo,

at this moment there is no function to achieve that through scripting. We will try to add it in further releases.

For the moment, you could try to freeze the whole interface with the scene.enable_GUI_updates(False) function. Just make sure you enable it again before you perform the preview. It should improve simulation times as much as disabling viewports.

Sorry for the inconvenience.

Re: activate GUI via Python

Posted: Tue Jan 18, 2011 6:05 pm
by timao
Hello Alex,

nice trick to disable the GUI completely, a bit spooky :shock: to get no feedback, but it works.

Thanks for the fast response!

Re: activate GUI via Python

Posted: Tue Jan 18, 2011 6:09 pm
by Alex
Hi again,

yes, it's kind of scary, but you can call scene.paint() to force an update from time to time.

You may also want to have some big try-except block to re-enable GUI in case anything went wrong.