Blender Tutorial: Animated Tree Growth


This is my first animation and animation tutorial. I wouldn't have written it, if something like this had already been made. One day I came across the problem that I had to animate the tree which I made in Blender. I needed to show how it grew. With neither experience nor examples I was about to fall into desperation, but the guys from blenderartists.org forum were very helpful. They reassured me that everything is possible, if one really wants it.

I won't tell anything new. The animation of the tree is based on the two articles from Blender documentation:

Relative Vertex Keys / Shape Keys
Your First Animation in 30 plus 30 Minutes

I will simply describe the process of how I made it.

We have a tree which will grow and the violin from which the tree will grow. The animation will go backward. Firstly we need to rig and skin the tree.

Rigging
rigging

enlarge

In Object Mode

Click Space --> Add --> Armature

Armature will appear at the 3D Cursor, and Blender will switch to Edit Mode.

Use Ctrl-LMB combination to add more bones. Each following bone will be a child of the previous one. This type of linking gives advantages and disadvantages. The advantage of this parent-child connection is that the branches can be easily scaled. You can select and scale only one bone, and the whole branch will be scaled as well. The disadvantage of this approach is that there is no way to use grabber to move individual bones. They only can be rotated.

When you are done, it's time for skinning.



Skinning
skinning

enlarge

In Object Mode

Select the tree first, then Shift select the armature. Press Ctrl-P --> Use Armature --> Create from Closets Bones.

Select the tree now and go to Edit Mode (Tab).

Now enlarge the image from the right and at the left lower corner find the the control we will use. It's pink.

The small square left from "Bone 20" and below "Vertex Group"is a button to switch between available bones.

Buttons Select and Deselect select and deselect vertices attached to the particular bone.

If you pressed Select and found that wrong vertices are attached, press Remove, then select the necessary vertices with your favorite method like with BKey, for example, and press Assign.



Animating
scale armature

Scaling down the armature

mesh keys scaling

Mesh Keys Animation Defect

When you are done with skinning, switch back to Object Mode, select your armature and switch to Pose Mode.

We will combine Armature and Shape Keys animation. Armature is nice but not flexible enough, since it acts as much as it is meant to, like the bones of a skeleton. The picture on the left illustrates that it is impossible to achieve a smooth, nicely shaped mesh when scaling down the armature of the branches of the tree.

Shape Keys are, on the contrary, very flexible, and it would be nice to use only them, but unfortunately I discovered that it is impossible to use an already animated group of vertices in another one (next picture), since vertices go out of control. The IPO of the previous keys smoothed to zero stop working, and the process of growth becomes just scaling down as if you scale down the object as a whole.

OK, let's start to animate.

Make sure you are in Frame 1.

In Pose Mode select the entire armature with the AKey.

Press IKey -->LocRotScale.

frame 1frame 14frame 20frame 30frame 35

As you see, some little branches disappeared in frame 14. This was made with Shape Keys. To achieve this disappearance in Object Mode click with RMB to select mesh and the press IKey --> Mesh. Then go to Edit Mode, roll some frames forward, 5 or so. How many it doesn't really matter because we will draw the IPO curve manually anyway. Now press IKey --> Mesh again to save the key and do as much manipulation to your mesh as you like. Note: unlike armature which is saved after the changes are done, mesh keys should be saved before.

mesh key base  

Base and 1 Mesh Keys

mesh key 1

Drawing the IPO curve

When the first key is inserted, in the IPO window under IPO Type Shape there appears a yellow line that indicates the base key. The blue line corresponds to the second key inserted, Key 1. To make your mesh move select the blue line with RMB and with Ctrl-LMB add two points. Now switch to Edit mode with Tab and place the points with GKey like on the picture. The points should be between 0 and 1 values vertically. Horizontal position corresponds to the number of the frame. In our case the mesh will move from Frame 1 up to Frame 14.

And here is the result. I haven't made leaves yet because I only needed the frames which I will later render in POV-ray. I will make the leaves separately and animate them with mesh keys in the way which is already described.

In conclusion, the frames were rendered in JPG format with a resolution of 800x600 in Blender, assembled into an AVI movie with JPGVideo 1.05.0.0, and converted into flash with Free Video to Flash Converter 2.3.2.1.


Last edited on November 22, 2007

flash OK, as I promised, I finished this project. I made enough of frame, added lieves, berries and starts, rendered them in POV-Ray as PNGs and modified in Xara Xtreme for Linux. I tryied to make a nice flash movie with some actionscript containing URLs in Macromedia Flash 8. Unfortunately the swf file came out to be so big (6.1 Mb with 100% quality) that it was impossible to use it on the Internet. Even reducing the quality up to 75% didn't help. It added only some JPEG artifacts which I call simply annoying noise, but didn't change much the situation itself. The file became 725.2 Kb that is considerably less than it was originally but still very big. I didn't find the solution. I am still new to Flash programming. Instead I fired up my Debian Etch and made just a nice movie of 338 Kb.

How I Made It

apt-get install imagemagick

I resized the whole directory of images:
find . -name "*.png" | xargs -l -i convert -resize 600x480 -quality 100 {} /home/user/output{}

Then I cropped them:
find . -name "*.png" | xargs -l -i convert -crop 350x350+267+128 +repage {} /home/user/output/{}

Note:
Actually the folder "output" should be named "output." with a dot in the end, otherwise it doesn't work.

Then I installed the necessary applications:

apt-get install mjpegtools ffmpeg

Then I made a movie in a yuv format:
png2yuv -j %d.png -f 10 -I p -b 1 > result.yuv

format for frames shouldlook like the following: 1.png, 2.png, 3.png, etc.
-f 10 means 10 frames per second (you can change this)
1 is the number of the frame to start streaming.

And finally I converted yuv format into swf:

ffmpeg -i result.yuv -sameq result.swf

This movie can be found on this page.

Home