Sep 27 2009

Endorphin and Blender

Hi guys!

I’ve not been that active lately because I’m  really busy with work, personal stuff and the Blender Conference (oh yeah, I got my talk accepted and I’ll be there presenting it! :D ). Today I’m gonna talk about Endorphin and how to import BVH data from it in Blender. Browsing the web I noticed that there are not so many useful info about the workflow, actually I found just a couple of posts on blenderartists.org where somebody had problem with BVH data exported from Endorphin, but nothing more..

Well basically I had the same big problem with which I’ve been playing around the whole weekend. If you export the animation from Endorphin as BVH and import it in Blender, you will notice how the animation plays smoothly and everything looks in place. But if you try to check the rest pose of the armature, you will find out that is a weird pose, actually nonsense. This implies that parenting it to a mesh will give you an non-sense output as well, nor vertex painting will work! Don’t be desperate! Actually there is an easy way to go around it :D

First step: create your simulation in Endorphin, then export it as BVH

Second step: open Blender, import your BVH file as Empties, not as Armature! Now you will have plenty of empties flying around your 3D view when playing the animation. Now there are two things you can do before importing your character: you can either clean up the empties leaving only the very essential ones that will be used in the IK constrains in your armature or you can leave as they are. This would give a better resolution if your armature has a lot of bones. Personally 10-15 empties were enough for me :)

Third step: import your character! You need to position it as more precise as possible to the empties. This means that joints and empties have to be in the same place otherwise the animation will not be so nice to see :D First add two constrains to the armature root, which is usually in the hip. One IK solver and one copy location. Both to the empty which represents the hip in the simulation imported from endorphin. After that for each couple (bone, empty) add just an IK solver to the bone which has as a target the right empty generated from the BVH. Don’t use the tail! And chain length in some parts has to be changed to 1, lower legs and forearms for example, but you need to know something about rigging to do this. I have no time to explain it here right now :D

Fourth step: tweak and enjoy the final result!

Hope this helped, I’m actually really happy about results I’m getting right now. Oh and I forgot to mention that since all the other contrains, especially IK solvers, were taken in account in the endorphine simulation (for instance knees etc..) you can clear them from the character’s armature.

Here you have the blend file from a quick experiment I made (15 minutes)
Endorphin Blender test
Here it is another experiment I made

Marco


Jun 8 2009

Stress maps

Sometimes I noticed that is not realistic to animate softbodies without having a good stress map that makes the stretched object to look more realistic. Try for example to think about a balloon, when you fill it with air the material stretches, becoming more transparent on the stressed areas. This effect can be reproduced as well in Blender using stress maps. If you check the second tab of the Texture field in the Material view (Map Input) you can see that one of the possible choices is Stress. That’s what we are going to use in our tutorial and it means that the texture will be mapped on the basis of the difference of edges length compared to the original ones of the mesh. Since a softbody has springs and they stretch, this is perfect for us :D
In this tutorial I’ll assume that you are already familiar with Blender  and know how to follow the basics steps that are not explained in this tutorial ;)
Clear the scene and add a UV Sphere with default values. Add a plane and place it above the sphere, more or less 5 Blender units on the z-axis. Subdivide the plane pressing W and subdivide multi, input 18 and press enter. Switch to weight paint mode and give a weight of 1 to the corners of the plane, so that they don’t float away when we animate it, but they stay still. Name the vertex group softgoal from the Edit panel.
Here it should look the scene after the weight painting:

Weight painting

Weight painting

Create a simple rubber material for the plane, it’s enough to use the default material and assign it your favourite colour, change the specular shader to WardIso (my favourite :D ) to give a shiny, rubbery look. I’ll come back to its stress map later. Set the plane as a soft body from the physics menu and change the values in this way:
- Click “Use goal” and select softgoal that you created previously
- GStiff 0.186
- Bend 0.500

All the rest leave it as default. Now select the sphere and activate collision from the physics tab. Set damping 0.100 , Inner 0.020 and Outer 0.200.
Animate the plane downward, be careful to do not push too down the plane, otherwise it will go through the sphere. This part requires as usual with soft bodies in Blender, some tuning. So play with settings until you have something that looks like the picture below and you get the best result from the soft body solver.

The soft plane stretched

The soft plane stretched

Now you are ready for the stress mapping! First thing add a new texture to the plane material. It should be a Blend texture and the mapping has to be as below:
Map Input -> Stress
Map to -> Col, Alpha then change the mode from Mix to Add.

Now let’s play with the Blend texture! Basically you need something as in the picture below:

Blend texture settings

Blend texture settings

The range of the colorband determines teh range of values between high stress and low stress areas of the mesh. A gentler fade on the colorband yields a gentle fade from low stress to high stress areas and viceversa.
When you’re done, try to render the frame in which the rubber plane is stretched and it should look something like this:

Looks cool! Definitely a realistic soft body!

Looks cool! Definitely a realistic soft body!

Play with settings and try to customize this tutorial as you wish and for your needs! If you have any question, leave a comment below :D


Mar 27 2009

Hair, UV and grass

Here you go with another tutorial from super3boy! This time we are going to talk how to use vertex painting for hair for example or how to use UV and make some realistic-looking grass :D
Enjoy!


Mar 23 2009

Fly – Blender Timelapse Tutorial

I really liked this video in which Sebastian König models a fly. The quality of the the work is extremely high and of course this is not for newbies of Blender, but is more oriented to people who are already quite skilled with the software. :D
Anyway enjoy the video and see again what Blender is able to do!


Mar 11 2009

WIP – Blender Multiplayer Game

Well, in my spare time (it’s not that much unfortunately because my job steals 90% of my time in this period) I’m working on a simple multiplayer game using Blender and of course python to create the classes server and client that will be used to share realtime data such as positions, rotation etc. among the players. I’m thinking about Pong as baseline for my game, however some changes may happen due to a couple of things that I need to verify! :D
For now enjoy this amazing tutorial about arrays in Blender, really useful sometimes to achieve nice effects as shown in this video :D


Mar 6 2009

Exploder modifier

Just a quick post from Barcelona where I’m spending the week for a project review :D

Here you have a useful videotutorial from super3boy in Youtube, I suggest to check his channel especially if you are new to Blender. There are 28 tutorials in total, for now enjoy this one in which he explains how to use the explode modifier in Blender, enjoy! :D