activate GUI via Python

Post Reply
timao
Posts: 11
Joined: Fri Jun 25, 2010 12:42 pm
Location: Hannover - Germany

activate GUI via Python

Post by timao » Tue Jan 18, 2011 5:42 pm

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

User avatar
Alex
Site Admin
Posts: 143
Joined: Mon Jun 14, 2010 9:35 am

Re: activate GUI via Python

Post by Alex » Tue Jan 18, 2011 5:49 pm

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.
Alex Ribao
RealFlow Team
Next Limit Technologies

timao
Posts: 11
Joined: Fri Jun 25, 2010 12:42 pm
Location: Hannover - Germany

Re: activate GUI via Python

Post by timao » Tue Jan 18, 2011 6:05 pm

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!

User avatar
Alex
Site Admin
Posts: 143
Joined: Mon Jun 14, 2010 9:35 am

Re: activate GUI via Python

Post by Alex » Tue Jan 18, 2011 6:09 pm

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.
Alex Ribao
RealFlow Team
Next Limit Technologies

Post Reply