Synchronous Redraw?

MakeHuman python API, python plugins, etc

Moderator: joepal

Synchronous Redraw?

Postby Fodderine » Tue Nov 08, 2011 8:49 am

It's me again :oops:

I can't figure out how to perform a synchronous redraw (i.e. finish opengl render before proceeding) inside a plugin.

Is it also possible to perform a openGL "grabScreen()" at a custom resolution?
Fodderine
 
Posts: 5
Joined: Fri Oct 14, 2011 6:38 am

Re: Synchronous Redraw?

Postby mflerackers » Tue Nov 08, 2011 8:56 am

self.app.redrawNow()

self.app.scene3d.grabScreen(x, y, width, height, os.path.join(grabPath, 'grab.bmp'))
MakeHuman project Developer
mflerackers
 
Posts: 636
Joined: Thu Feb 05, 2009 11:53 am
Location: Kyoto

Re: Synchronous Redraw?

Postby Fodderine » Wed Nov 09, 2011 6:39 am

Thanks Marc. redrawNow(); works great

The intent of the grab screen was to get a higher resolution output from openGL.
Say my window was running at 800x600, I want to obtain an output around 2400x1800 px.
I have worked around this before by specifying in C code to launch at a huge resolution, but this seemed like a dumb way of doing it :lol: .
Could I send a "resize event" programmatically so that makeHuman is only enlarged when I need to capture the output? Or is there an even easier way of doing this.
Fodderine
 
Posts: 5
Joined: Fri Oct 14, 2011 6:38 am

Re: Synchronous Redraw?

Postby mflerackers » Wed Nov 09, 2011 1:14 pm

I guess in windows you can just call SetWindowPos with the hwnd of the makehuman window. You can get the hwnd by caption ("MakeHuman - [Untitled]" if not loaded or saved) or class ("SDL_app") or just take the first (and only) hwnd of the process.

Rendering to frame buffer (fbo) is planned, though not supported yet, so you can only get what's on the screen.
MakeHuman project Developer
mflerackers
 
Posts: 636
Joined: Thu Feb 05, 2009 11:53 am
Location: Kyoto


Return to Python scripts

Who is online

Users browsing this forum: No registered users and 1 guest