|
|||||||
![]() |
|
|
Thread Tools |
|
||||
|
Hi all,
i would like to know if or how i can access or render the 3d screen. I would like to write an "Onion skining"-script that displays character poses from certain frames in the background. |
||||
|
#1
|
||||
|
|
|
||||
|
You can probably do it with a View3d Draw space handler:
http://www.blender.org/documentation...ed-module.html
............................................
Rocket Scientists and Squirrel Preserves... Some Scripts I've Written |
||||
|
#2
|
|
||||
|
What i ment was: How do i capture the OpenGL viewport?
|
||||
|
#3
|
|
||||
|
I don't think you need to capture the viewport, instead use the BGL and Draw modules to do direct OpenGL drawing into the 3d viewport.
Concerning the onion skinning, I assume you are aware of the "ghost" option for armature visualisation? http://wiki.blender.org/index.php/Ma...ects#Options_3 http://en.wikibooks.org/wiki/Blender.../Armature/pose /Nathan
............................................
Your ideas: blenderstorm Your news: planetblender Finnish community: #blender.fi other: PyNodes | letwory.net |
||||
|
#4
|
|
||||
|
Hi Jesterking, thanks for your interest. I am aware of the onion skinning for armature in blender. But i think you cannot use it for an actual character mesh. A friend showed me this plugin for maya, where at desired frames the OpenGL screen is simlpy stored as a buffer once and displayed in the background instead of re-evaluating the whole Rig over and over. I love it. It feels more like traditional animation to work like that.
Here is the link to the maya plugin on HighEnd3d. Unfortunately the video does not work anymore though. Here is quick demo video Last edited by Loolarge; 16-Dec-08 at 09:20. Reason: added link |
||||
|
#5
|
|
||||
|
Quote:
/Nathan
............................................
Your ideas: blenderstorm Your news: planetblender Finnish community: #blender.fi other: PyNodes | letwory.net |
||||
|
#6
|
|
||||
|
Great, that would be awesome!
|
||||
|
#7
|
|
|||
|
Hello,
i have not seen the demo or video, but... You can add dynamic ghosting to the 3d window quite easily - though this may not be exactly what you're after: Code:
In the 3D window header menu you can then select View -> Space handler scripts -> ghosting.py You may want to do a proper initialisation. Also check for mousebuttons or changes to the viewmatrix etc. to detect if the user has changed the view and disable ghosting then (it's pretty much confusing this way). As said - this may not be what you need exactly. You could also grab a single frame (a keyframe for example) by creating a buffer using BGL.Buffer(...) and do a screencopy with BGL.glReadPixels(...) after the keyframe was drawn on screen. Then you can bind the buffer to a texture and render the textures of previous keyframes using alphablending - would give good control over the grabbing (only keyframes) and blending operation. In any case: BGL may be your friend... Michael |
|||
|
#8
|
|
||||
|
That might actually work, yes. Hadn't thought of that yet.
/Nathan
............................................
Your ideas: blenderstorm Your news: planetblender Finnish community: #blender.fi other: PyNodes | letwory.net |
||||
|
#9
|
|
||||
|
Hi Michael_S,
thank you very much for the hints! I will try that. With your code snippet i get some funky letters and memory artefacts, but i figured that you can use glClear(GL_ACCUM_BUFFER_BIT) to fix it. OpenGL is new to me, but i think it will be fun to figure things out. I am confident that i will get it done, since you pointed it all out allready. Thanks again
|
||||
|
#10
|
|
|||
|
Quote:
i think is hard to implement Onion Skin in 3d view with python. Need better access to deformed meshes. |
|||
|
#11
|
|
||||
|
I think i am stuck. I wanted to read a block from the screen and display it somewhere else. Nothing happens though. I am not quite shure about what types and formats to feed into the BGL commands. And i also am not shure how to attach the buffer to an Image object afterwards.
Quote:
|
||||
|
#12
|
|
|||
|
ok - try this
Code:
Michael |
|||
|
#13
|
|
||||
|
I had a try at writing an "onion skinning" script.
It consists of two parts: a normal python script with a gui and a spacehandler script. GUI Code:
Spacehandler Code:
Load the spacehandler in the 3d view. Run the gui in the text window. Tomorrow I'll post some more instructions on how to use it, and I will try to improve the speed of creating the onion skin, but now it's time to get some sleep. |
||||
|
#14
|
|
||||
|
Hi Crouch, thank you very much! This is awesome. Unfortunately i only see the screen getting brighter but nothing in the background. I will look at it again tomorrow.
Thanks everybody for the help, i am astonished! Blender rules. |
||||
|
#15
|
|
||||
|
Ok, i figured out that you have to set the OnionSkin Image as background image manually and set the camera to the exact resolution of the 3D View. Creating the buffers takes long time, but it is working.
Last edited by Loolarge; 18-Dec-08 at 18:16. |
||||
|
#16
|
|
||||
|
Creating the buffers does indeed take some time, especially when the 3d-view window is large, but unfortunately I can't think of a method to increase the speed.
It shouldn't be necessary to set the image as background image manually, or to adjust the camera. It sounds like you didn't activate the space handler. Full explanation on setting everything up: 1 - go to python text-editor 2 - text --> open --> # select the spacehandler script on your harddisk 3 - text --> open --> # select the gui script on your harddisk 4 - go to the 3d view and press CTRL+UParrow (to enlarge the window) 5 - View --> Space Handlers Script --> Draw: onionskin_spacehandle 6 - CTRL+DOWNarrow (to get the window back to its normal size) 7 - go to the text editor and press ALT+P Steps 4 and 6 are only necessary to be able to see the option in step 3, because it often happens that it falls off screen otherwise. Below you can find a demo-video of the script in action and links to download the script files. Script files: Spacehandler GUI EDIT: a new version was written. It's located a bit further in this thread. Last edited by Crouch; 24-Dec-08 at 14:00. Reason: new version |
||||
|
#17
|
|
||||
|
Hi Crouch. Thanks again for the script, it is awesome even now. But still when i do it like you described, the image is not displayed, the 3D screen just gets brighter. Maybe it is a thing with my gfx card. I am using a winxp laptop with a geforce card. What are you using?
Can someone else please confirm if it is working well for him? |
||||
|
#18
|
|
||||
|
I'm on a winxp desktop using a geforce card, so that resembles your situation. Next week I'll go to a friend of mine and test it on his computer, to see if it works there.
If I find the source of the problem and/or a solution, I'll post here again. |
||||
|
#19
|
|
||||
|
this looks like such a very useful script, thank you for your hard work. I plan on testing it soon, OSX, 2.48a, 10.5.6.
EDIT: The spacehandler loads fine, as did the script(interface) execute properly, however upon referencing your vimeo tutorial, and the instruction on the thread above, I was not able to get the onion skinning appear for me on my system, it produced no console errors that i noticed. The script would add and delete frames without error, but I just didn't see the other onion skinned frames in the 3d view no matter how many i added. Looks like a useful script, however doesnt seem to work for me on OSX with the specs i listed above. hopefully soon I can use it :-) Last edited by blenderificus; 20-Dec-08 at 19:23. Reason: additional info added |
||||
|
#20
|
![]() |
| Bookmarks |
| Thread Tools | |
|
|