Thursday, July 22, 2010

2.53 Beta Add Ons




It's so new that the URL still says alpha! Versions of 2.53 Beta can be downloaded for Windows 32bit, Windows 64 bit, Linux 32bit and 64 bit, Mac OS X, and Solaris. As a beta version, the basic features should be in place, although bugs are still expected. There are many bug fixes, some reorganization of window choices, and some new features. You can read more about all the changes in Blender 2.5, at:

http://www.blender.org/development/release-logs/blender-250/

In this tutorial, I'm going to talk about the new Add-On repository, which is a way to extend Blender functionality by adding Python scripts. A number of these scripts are shipped with 2.53 beta. They are documented online in the Blender 2.5 Add-Ons Repository, at:

http://wiki.blender.org/index.php/Extensions:2.5/Py/Scripts


I will show you where the add-on scripts are stored and how to install and run them. I will also show you how to edit the source code of the installed scripts, which are a great resource for learning how to write add-ons.

Thursday, July 15, 2010

Blender 3D Cookbook, Volume 1



I am pleased to announce the publication of Volume 1 of my Blender 3D Cookbook available from lulu.com, either as a book or a PDF download, at:

http://www.lulu.com/product/paperback/the-blender-3d-cookbook-volume-1/11777448


The Blender 3D Cookbook consists of the scripts to 62 or my my Blender 3D tutorials, at http://www.youtube.com/irakrakow. Each script has a link to the Youtube video, if you purchase the book as a PDF. If you purchase the book, the URL is printed. Many of you have requested such a book. I called the book a “cookbook” because you can think of the scripts as “recipes” for producing a desired effect in Blender.

I don't assume any particular level of Blender expertise. My videos cover a wide variety of topics, from beginner to advanced, including some that I have not seen as tutorials anywhere else. Like a cookbook, you can pick and choose those recipes you are interested in and skip the ones that you either know about or that you're not interested in. I tried to include something for everyone, including topics such as the Blender Game Engine and Python scripting that have only been lightly covered in other tutorials. If you have suggestions for future tutorials, please email me at ira.krakow@gmail.com.

As of this date, Blender is undergoing a massive rewrite and restructuring. The current, production version, 2.49b, will eventually be replaced by version 2.5. 2.5 has a different user interface and has many improvements to old features, as well as many new features. It is currently in alpha, which means that there could be some changes made until the day when 2.5 becomes the production version of Blender. On my Blender 3D forum, at http://forum.irakrakow.com, I took a survey of who used what version. I discovered that roughly half worked in Blender 2.4x (although 2.49b is the most current production version, some were working in earlier versions), and the other half worked in Blender 2.5. I have written tutorials based on both versions. For each tutorial, I note which version (2.49 or 2.5) I made it for. Some of the 2.5 tutorials were done in different alpha versions, such as Alpha 0 or even pre Alpha. For the most part, the effects I write about can be produced in any version.

These tutorials are not intended to cover every conceivable Blender feature. That would, in my opinion, be too thick a volume. Note that I suffixed the title to this cookbook “Volume 1”. Blender is too complex and rich a program, undergoing constant upgrading and changing, for that. I plan on publishing many more volumes of the Blender 3D Cookbook, in the future, that will explore other amazing and unique Blender features.

I welcome your feedback and hope you enjoy my cookbook.

Saturday, July 10, 2010

2.5 Object Orientation



The name of this tutorial is Blender 2.5 Global and Local Orientation. Thank you to Near Hirsig (nhirsig@tufts.edu). The tutorial on which is this based is at http://www.gryllus.net. Blender uses 3 dimensions, X in red, Y in green, and Z in blue. The default orientation is global. The orientation remains constant, regardless of which object is selected or which view is active.

Friday, July 9, 2010

2.5 Empty Object



The name of this video tutorial is Empty Object. A big Thank You to Neal Hirsig (nhirsig@tufts.edu), who created the tutorial on which this tutorial is based, at http://www.gryllus.net. An Empty Object is a non renderable object that represents a point in space.

Thursday, July 8, 2010

2.5 Splitting and Joining Windows



The name of this video is Splitting, Joining, and Expanding Editor Windows. It is possible to expand an editor window by moving the cursor to the edge of the window until you see a double arrow. Left click and drag the window open. This can be done horizontally or vertically.

2.5 Object Origin Center




The name of this tutorial is Blender 2.5 Object Origin Center Tutorial. Each object in Blender has a center point. In 2.5, this is called the Object Origin. In Blender 2.49 the origin was called the Object Center, although the problem is that the object's origin is not always at the center, and this can cause problems.

Wednesday, July 7, 2010

2.5 Default Scene



The name of this video tutorial is Ira Krakow's Blender 2.5 Default Scene Tutorial. I would like to give a big Thank You shoutout to Neal Hirsig, of Tufts University, at http://www.gryllus.net, who created the video on which my video is based.

When you first open Blender a number of default windows, panels, and controls, are displayed. At first you might be intimidated by it, but as you become more familiar with the Blender interface, you'll find that the layout is very well organized and provides an efficient interface for modeling and animation.

Monday, May 17, 2010

2.49b Yafaray Tutorial



YafaRay is an external renderer (download it from www.yafaray.org) that is integrated with Blender 2.49 via Python scripts. You can add many dramatic features, such as global illumination, caustics, enhanced ray tracing, and self illuminated objects, to your renders, with YafaRay. YafaRay extends Blender's built in renderer with special types of lighting, new material options, and enhanced world settings.

Sunday, May 9, 2010

2.49b Hat Creation



This tutorial is based on the Blender 3D Noob to Pro Wikibook Hat Creation Tutorial, at: http://en.wikibooks.org/wiki/Blender_3D:_Noob_to_Pro/Creating_a_Simple_Hat. Even though the hat is simple, creating it shows off an advanced Blender mesh feature, the Spin tool. The wikibook actually creates the hat as one step in creating a simple person. In this tutorial, I will just focus on how to create the hat object. We will create the hat from a mesh circle. Although I used Blender 2.49b, this tutorial should work in any Blender 2.4x version, because we will set up the user preferences explicitly.

Monday, April 12, 2010

2.49b Animated 3D Text

Watch the Video



In this tutorial, I will show you how to create animated 3D text in Blender 2.49b. You can use this type of effect to create, for example, rolling credits in your video. Or, perhaps, you can do something like the Star Wars introduction..."A long, long time ago, in a galaxy far away...".

The techniques are based on Paolo Ciccone's excellent Blender 3D Survival Guide, which you can find at CreativeCow. Specifically, you can find how Paolo creates animated 3D text in Parts 3 and 4. The URLs are at:

http://library.creativecow.net/articles/ciccone_paolo/blender-survival-guide-3.php
http://library.creativecow.net/articles/ciccone_paolo/blender-survival-guide-4.php

Sunday, March 28, 2010

Python 3, Part 6 (Functions)



In this tutorial, we are going to see how to write and call functions in Python 3, as well as how to pass arguments, both as keyword and value, to a Python function. I will also introduce you to some of the neat features of the Blender 2.5 text editor, such as source code color coding, which help make coding Python scripts much easier. This video is based on the Python 3.1 function tutorial at: http://docs.python.org/release/3.0.1/tutorial/controlflow.html#more-on-defining-functions.

Wednesday, March 10, 2010

Python 3, Part 5 (List Methods)



In Part 4, we saw how to use slicing to work with parts of a string, list, or tuple, as well as how to insert, delete, and add to these types of variables. Python has a number of built in methods -- also called functions -- that can do these operations in a way that makes the code easier to read. Sometimes it's a bit hard to understand all those colons and square brackets, and it's easier to use words like append, remove, or insert, which are, indeed the names of methods associated with lists. We'll also see how these easy to understand methods can be used to build a simple stack (where the last element added is the first element retrieved) or queue (where the first element added is the first element retrieved). We'll also discover how to sort, count, and locate items in a list. Along the way, we'll learn about the autocomplete feature of Blender's Python console, a handy feature that documents available methods.

Python 3, Part 4 (Slicing)



In Part 3, we were introduced to lists, which lets us work with more than one variable at once. We also saw how to reference parts of the list, say the 3rd element in the list x as x[2] (since we start numbering from 0), using the [] operator, and how to use negative numbers to reference list elements from the end. In this tutorial, we will go into more detail about how to get parts of strings and lists, by use of slicing. Slicing also uses the square brackets, but in a new and different way.

Monday, March 8, 2010

Python 3, Part 3 (Lists)



In Part 2, we saw different ways that string variables can be defined. In this tutorial, we will see how lists of variables can be defined and used. You're basically creating more than one variable at a time, in a structure called a list. Lists are a very important part of Python. If you want to be able both program in Python and to read Python code written by others, you need to know how lists work. Don't worry, you'll get the hang of it if you practice a bit.

Python 3, Part 2 (Strings)



In Part 1 of this series, we saw how to use Blender's Python 3 console, as well as how to write simple one line programs and make variable assignments. In this tutorial we are going to dig deeper in strings, arguably the most important type of variable in Python. We'll discover how to write strings, what happens when strings become very long or span more than one line, and how to use operators to combine strings or to make multiple copies of the same string text.

Saturday, March 6, 2010

Python 3, Part 1 (Expressions)



The goal of this tutorial is to introduce Blender users, whether or not they are programmers, to Python 3. Blender 2.5 supports Python 3 scripts, which can let you program Blender behavioer very precisely. Of course, before you can create Blender scripts, you need to know Python 3. We will use the Blender 2.5 Scripting environment, which includes a Python console that supports most (but not all) of Python 3, as well as a fully featured text editor, with advanced features such as autocomplete and automatic indenting of code. I will point out where Blender's Python implementation differs from the standard Python 3 distribution. There are minor differences, none that should prevent you from writing fully featured scripts in Blender 2.5.

Wednesday, March 3, 2010

2.50 Alpha 1 Python Part 4



Up to this point, we have been looking at the Blender 2.5 Python environment and to scripts to control windows, panels, and operators. We haven't done anything with actual Blender objects. It's time to see how to change and even create new Blender objects in Python.

Tuesday, March 2, 2010

2.50 Alpha 1 Python Part 3



In Part 2, we saw how windows are built from building blocks called Panels in Blender 2.5. You can lay out a panel and get data from the user. The next step is to actually do something with the data. For that, Blender 2.5 lets you define operators. Once you create an operator, it works anywhere within Blender. In this tutorial, we will create a simple operator, using the simple_operator.py template, one of a number of pre-designed templates that makes it easy for you to just add the functionality you need.

2.50 Alpha 1 Python Part 2



In Part 1 of this series on Blender 2.50 Python, we explored the new Blender 2.50 Python User Interface. In Part 2, we will look at the new user interface, consisting of windows and panels. You are already familiar with windows -- things like the 3D window, the Outline Window, and the UV / Image Editor Window. These still behave as 2.4x type windows, which you can resize, split, join, and so on.

However, the way windows are built is completely different. In Blender 2.5, windows are assembled in units called Panels. You program each panel as a Python class. A window is a group of panels, with each panel in the window registered to it. In this tutorial, we will explore how Blender 2.5 windows are put together by both looking at the scripts that build the windows in the user interface, and actually changing these windows. Then we will create a panel based on Blender's panel template script, and register it to a window, adding our own panel to a Blender window. In the process, we will see where the python scripts for the windows shipped with Blender are kept and examine how the user interface is created. The goal is to show you how to find the code for the windows, as a starting point for you to change the Python code to add panels to existing windows. The way of building the User Interface has changed so much in 2.50 that just about all Blender Python 2.4x scripts that use windows need to be rewritten, basically from the ground up.

This tutorial is based on the Blender 2.5 Tour 9, Python tutorial, by Michael Fox (mfoxdogg), at: .

So start up Blender 2.5 Alpha 1. The 3D window has a default cube. We won't be doing anything with any Blender objects in this tutorial. We'll only be looking at the user interface scripts. First off, where are they? To find out, switch the 3D window to a Text window by going to the window type buttons menu. The text icon is the same as in Blender 2.4x. From the Text menu, select Open. Bundled into the distribution files is a .blender folder. It may be hidden on your computer, so enable unhiding folders in your operating system, if you don't see that folder. The Blender Python scripts are in the Scripts folder. By the way, there are other Python scripts in the Python/lib folder. You can look at these, which are part of the Python 3.1 distribution, to learn more about Python itself. Today, we're going to look at the Scripts folder.

The Scripts folder itself contains a number of folders: extensions, IO, modules, op, presets, templates, and ui. We're going to start by going to the ui folder, which contains the scripts for the windows in Blender's user interface. The script names start with either "properties_" or "space_". The ones starting with "properties_" are the scripts for the various properties windows. The scripts starting with "space_" are scripts for Blender's windows, such as console, dopesheet, and 3D. Space_view3d.py, for example, is the script for the 3D window.

We're going to start with the script for the Material window, properties_material.py. In the window on the far right, which you may need to expand a bit, click on the big spherical icon. This is the Material window, which is the window produced by this script. The window is divided into sections, which are coded as Property panels. Hide the details of each panel, so that only the headers -- things like Preview, Diffuse, Specular and so on -- show.

Corresponding to each of these panels is a Python class of starting with the words MATERIAL_PT. In the code, the panels are not coded in the order that you see them. In fact, there are panels that you don't see. The panel for the Diffuse settings is labeled "Diffuse", and the code to build the user interface elements, such as the list of shaders, is in the class called MATERIAL_PT_diffuse, specifically in the Draw function, which is required for any panel, some of the code of which is highlighted in pink. There's a class called MATERIAL_PT_specular for the specular panel, with its Draw function, a class called MATERIAL_PT_shading for the Shading panel, and so on.

All the way at the bottom is a list of the panel classes in this window, which are highlighted. This is the order that the panels will display in, although not all of them may display. These classes are registered when the register function, highlighted here, is called. Note that the Physics panel is not displayed. That's because Physics is not appropriate to the Blender Render material window. However, if we switch to Blender Game, where Physics is relevant, the panel displays. In the code for the Physics panel, we see that the panel only should display for the Blender Game engine.

One last thing. The material window class has the following properties:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "material"

Remember this when we build our panel, to add to the Material window. To build a panel, Blender has a template script called panel_simple.py, in the Templates folder. This script, by default, adds a "Hello World" panel, which displays the active object name, to the Object panel. Since we want to add this panel to the material window, we change bl_context to "material". The draw function actually draws the layout on the panel. The row() function creates a row. Three rows are created, one of which displays "Hello World" with an icon. The second row displays the name of the active object. The third row is an input area where we can change the name of the cube. Finally, this new class is registered.

If we press the Run Script button, the script runs. Look at the Material window. The Hello World panel was added at the bottom. Change the name of the cube to MyCube. Look in the outliner. The name of the object has changed.

Of course, there's a lot more, such as the details of how panels are drawn. We'll leave that for another tutorial. For now, I hope you have a better idea of how the new 2.5 interface works and how the scripts are organized. If you liked this tutorial, please hit the Subscribe button on Youtube, and discuss this video at forum.irakrakow.com. Happy Blendering!

Sunday, February 28, 2010

2.49 Camera Changer



Adding cameras, which have different views of the scene, and then changing them during your animation, can add more drama and realism to your animations. Blender lets you have as many cameras as you want, and to position them anywhere in your scene. Blender also has many Python scripts. You've probably used a few of them. For example, if you have ever saved the UV face layout from the UV/Image editor,to export the UV face layout to an image editor, you've used a Python script.

Friday, February 26, 2010

2.49 Pixar Eye Tutorial



The goal of this tutorial is to make a Pixar-looking eye. The idea for this tutorial came from a post by KSF2010 on my Blender 3D Forum, at http://forum.irakrakow.com. He rendered a whale with "Pixar eyes". You can see his render at:

I was curious how to do Pixar eyes. He mentioned some tutorials on the web.

This tutorial is based on:
Iris texture: http://en.wikibooks.org/wiki/File:Iris.png

This tutorial uses the same modelling and texturing technique described in the well-known MAX tutorial by Adam Baroody.

Tuesday, February 23, 2010

2.50 Alpha 1 Python Part 1



The purpose of this video is to give you an idea of the Python scripting environment in the new Blender 2.5, as well as to give you places to start if you either don't know Python at all, or are new to programming. Don't be afraid if you are not a programmer. Python is not a difficult language to learn. This tutorial is based on Blender Labrat (mfoxdogg) tour of the Python setup in Blender 2.5, and the Blender 2.5 Python API introduction at blender.org. I based this tutorial on Blender 2.5 Alpha 1, released in mid-February, 2010.

Monday, February 22, 2010

2.49b Soft Bodies



Purpose:
Soft bodies are materials that have some flexibility, that can deform themselves when forces such as friction or gravity are applied to them. Soft body objects are common in real life. Think of clothing draped on a person or model, jello, rubber, or even metals under certain circumstances. They range in their degree of flexibility. You need to tweak the soft body settings to get the object to resemble the type of material you're trying to model. Rubber tires certainly doesn't deform in the same way as a balloon or a cape on Batman. In this tutorial, I will introduce you to the basic concepts behind soft body physics.

Thursday, February 18, 2010

2.49 Skybox for BGE



Creating a great background is a huge help towards making your Blender game realistic. Unlike in Blender 3D, where you can create a world as a background, in the Blender Game Engine, you need to use an actual textured mesh as your background. This mesh is called a skybox. Inside the skybox is a projection of a 360° environment. When the player (camera) is inside this environment, the scene is rendered with the illusion of being inside a gigantic world. This tutorial shows you how to create such a skybox. It's based on the Build a Skybox tutorial at tutorialsforblender3d.com. We will also animate the camera inside the Blender Game Engine so we can tour our imaginary sky box world.

Saturday, February 13, 2010

Import Google Earth KMZ Files

Download blend files with imported models from Google 3D Warehouse and Google SketchUp 7.



The KMZ file is Google's standard file format for models created in Google Earth, Google 3D Warehouse, and Google SketchUp. The goal of this tutorial is to show you how to import any of the many thousands of models from the Google 3D Warehouse, Google Earth, or Google Sketchup, into Blender. Why reinvent the wheel? It's highly likely that models such as background scenes, and common objects like chairs and tables, are already available in these programs. If all you want is to use these as a background, for your game or animation, why not import them into Blender?

Sunday, February 7, 2010

2.49b Snap Tools 1



One of the most important skills in Blender mesh modeling is the ability to position objects precisely. This is especially true in architectural models, where you are closely following a blueprint, or in a product model, where you need to position a part, such as the tires or doors on a car, exactly. If your mesh is complicated, it can be a difficult task because of the many vertices or faces that are close together.

Tuesday, February 2, 2010

BGE 2.49 Character Creation

Discuss this video at Ira Krakow's Blender 3D Forum!



Creating a character for Blender's Game Engine is different from creating a character in Blender 3D. In Blender 3D, you have a wider range of options for creating detailed characters, such as adding geometry for details, using curves and surfaces, and sculpt mode. These high-polygon models work well for rendering. However, if such a model is placed in the Game Engine, the animation would slow down to an unacceptable level. Some commonly used techniques, such as subsurf, are not available in the BGE. BGE characters should be low-polygon for best performance.

However, they can't be too low-poly, because the characters will look too much like rectangles and squares. In addition, you need enough geometry to do realistic animations in the BGE, such as walk cycles and lattice deformations. So creating a character for the Blender Game Engine is a tradeoff. In this tutorial, which is based on Tony Mullen's discussion in Mastering Blender, a book I recommend if you want a great introduction to Blender in more depth, I show a recipe for creating a character for the BGE. It's more a set of steps than a fully realized character. I leave that to you. I encourage you to use these steps to create your own character and post your result on my Blender 3D Forum at http://forum.irakrakow.com. I used Blender 2.49b.

So let's get started. Start with the default Blender scene. Go into Front View (Num1), the best view for the BGE because it shows the effect of gravity. Make sure you are in Edit mode, with all vertices selected. Press the W key to bring up the Specials Menu. Select Subdivide Smooth, accepting the default of 1.00 by clicking OK. The result is a polygon with 24 faces.

Press the Z key to go into wireframe mode. Deselect the 3D Transform Widget, which gets in the way of this demo. Press the A key to deselect all vertices. Position the cursor in the lower right area of the polygon, and press the B key to box select. Box select the lower right vertices. Press the E key, and select Region, to extrude the region of vertices. Scale the extruded vertices by pressing the S key, and then the Z key, and then the number 0. Finally, with the vertices still selected, press the E key again and extrude the vertices downward to complete the leg.

We're going to model the rest of our character with the Mirror Modifier. To do that, press the A key to deselect the vertices. Box select (B key) the vertices on the left side of the model. Press the X key to delete, and select Vertices. Now we have half the model. We're going to mirror the model along the X axis. Go to the Editing Buttons (F9). From the Modifiers tab, click the Add Modifer button. Select Mirror. You should see a mirror of the right side of the model on the left side. Make sure that the X button and the Do Clipping button are enabled, and that the Merge Limit is 0.001.

Now we're going to do the shoulders and arms. Box select the upper right vertices. Press the E key to extrude the forearm. You can use the S key to scale the forearm either more or less. Press the E key again to extrude another part of the arm, and use the S key to scale it down. Press the R key to rotate a bit as well. Extrude one more time by pressing the E key. Note that the left arm is being created as well, a mirror of the right arm.

Let's bend the knees a bit. Go to side view (Num3). Box select (B key) the knee vertices (the ones in the lower middle of the leg), and move them a bit on the Y axis by pressing the G key, then the Y key, then moving the vertices, then pressing Enter.

Let's add a head. Go to Front View (Num1). Press Alt-A to deselect the vertices. Box select (B key) the upper right vertices. Press the E key, selecting Region, to extrude the head upwards.

The shape of the character is done. We don't need the Mirror Modifier any more. To apply the Mirror Modifier to the model, press Tab to go into Object Mode. Then press the Apply button to add the geometry on the left side to the mesh on the right side. Pressing Tab to go into Edit mode shows that we have a complete character. We need a bit more geometry to make this character work well in the BGE. To do that, press the A key to select all vertices. Then press the W key for the Specials menu. Select Subdivide Smooth. Our character has a few hundred faces, enough for moving around in the BGE but not so complex as will slow down the BGE.

We're going to paint our character using Texture Paint. To do that, we first need to mark a seam for unwrapping. Go to Front View (Num1). Position the cursor at the center of the character, at the border of the left and right part, and press Alt-Right click to select the edge loop. Press Ctrl-E to bring up the Edge Specials menu, and select Mark Seam. Split the 3D window to create a UV / Image Editor in the right part of the window. Press the A key to select all vertices. Then press the U key, selecting Unwrap, to unwrap the mesh. In the UV / Image Editor, select Image, then New. The default size is fine. We want to click on the UV Test Grid as well. Then press OK.

Change the view to Textured. At this point, we can change the mode to Texture Paint and actually paint our character. We can play with the brush, opacity, size, blend, and other settings by changing the options in the Paint panel.

At this point, we have a modeled and textured character. Save your Blend file because we will use it in the next video, to rig our character and have it fully participate in the game. Just to prove that our character works in the Blender Game Engine, go to the Logic Buttons (F4). Change the Physics type of our character to Rigid Body (Dynamic would work as well). With the cursor in the 3D window, press the P key. Our character falls int the abyss, pulled by the Bullet Physics calculations. Congratulations, we have made a character for use in the Blender Game Engine. Show off your character at http://forum.irakrakow.com. Subscribe to my Youtube videos. See you next time. Happy Blendering!

Friday, January 29, 2010

BGE Blender 2.49b Part 3

Discuss this video at Ira Krakow's Blender 3D Forum



The purpose of this video is to show some basic sensor and actuator behavior. We'll look at the Always, Touch, and Keyboards sensors. I'll show you some basic techniques for moving an object, how the movement interacts with gravity, how to bounce an object, and how to replace one object with another object. I used Blender 2.49b for the demo.

Setup:
We'll use the default cube. Go to Front View (NUM1), the best for the BGE because it shows the effect of gravity the best, as objects actually fall down in response to simulated gravity. Add a ground plane for the cube to bounce off of (Shift - Add - Mesh - Plane). Scale the plane 8 times (S - 8 - Enter). Move the plane down about 5 Blender Units. It doesn't really matter - you could have moved the cube up as well to get the same effect. Select the cube. Go to the Logic buttons (F4). Select Rigid Body from the Physics types dropdown. This turns on the Actor button as well, so that the cube becomes an actor, with the realistic Rigid Body physics applied, in the Game Engine.

Show:
1) The default sensor is the Always sensor. Click the Add buttons to add a Sensor, a Controller, and an Actuator, to the cube. Wire up the logic bricks, connecting the sensor to the controller and the controller to the actuator. Enter .10 in the LocX area. What this logic block is saying is that, each time the logic blocks are evaluated (the Always sensor - it's not strictly Always, it's when the logic is evaluated), the cube will be moved .10 Blender Units in the X direction. Press P to start the game. Note how the cube moves in the X direction (because of the logic brick), as well as down (because of the rigid body physics) until it touches the plane (which is an obstacle that prevents the cube from falling any further). For a while, the cube moves in the X direction on the plane, until eventually it falls off the plane. Press Esc to end the game.

2) How to make the cube bounce. Enter 0 in the Loc X area. Now enter .1 in the Loc Z area, the third location area. Press P to start the game. Now, on every evaluation of the logic, the cube goes upward in the Z direction .1 Blender unit. At the beginning this causes the cube to go up a bit. Eventually, however, gravity takes over, being more powerful than the displacement in the Z direction, and the cube bounces down, until it hits the plane. After that, the cube bounces up in the Z direction, then gravity takes over, in an infinite cycle. Press ESC to stop the game.

3) Perhaps you want the cube to start bouncing only when it touches the ground, allowing gravity to control the cube fully before it hits the ground. To do that, change the Always sensor to a Touch sensor. Press the P key with the cursor in the 3D window to start the game. Note that the bounce doesn't take place until the plane touches the ground.

4) How to make the go in the X direction. Set the LocZ parameter back to 0. Set the LinV, linear velocity, to 0.10. This makes the cube's speed, in the X direction, become .10 blender units, every time it touches the plane. The cube indeed goes into the X direction that way, but its motion is unrealistic because the cube seems to penetrate into the plane. Perhaps you can do better. Hint: a more realistic way is to use the Servo type of motion. Post your render at http://forum.irakrakow.com to show the cube moving more realistic, without going into the cube. Press ESC to end the game.

Now click the little Add button on the LinV row, at the right. What that does is add .10 Blender Units to the speed of the cube. It accelerates quickly along the X axis until it falls from the plane. Press Esc to end the game.

5) Here's an interesting effect. We can replace one mesh with another while the Game Engine runs. We'll use the Keyboard sensor to trigger this effect. We will replace the cube with Suzanne. Here's how it's done. Go to Level 2 by clicking on the second rectangle. Add Suzanne (Space - Add - Mesh - Monkey). Click back on Level 1. The Game Engine only shows the objects on Level 1. We'll substitute the cube with Suzanne when we hit the R key (for replace, I guess). First, change the Sensor to a Keyboard sensor by selecting Keyboard from the Sensor Type dropdown. Left click in the Key area. In the rectangle, where it says Press A Key, move the cursor. Then press the R key. Now the key area displays the letter R. Whatever happens will be triggered when the user presses the R key.

In the Actuator area, select Edit Object. Below is a popup menu which lets you select the type of object editing you want. Select Replace Mesh. In the Obj: field, enter Suzanne. Wire the sensor to the controller and the controller to the actuator. Run the game by moving the cursor into the 3D window and pressing the P key. Press the R key. Suzanne magically replaces the cube. This is a great technique if, say, you want, say, your Cinderella mesh to be replaced by a pumpkin, as in the story. Press Esc to end the game.

6) Now suppose you want the cube back. We can show and hide the details about the sensor and actuator by clicking on the little arrow at the right. This is useful when you want to show a lot of logic bricks in a small area. So click these arrows to hide the details about the sensor and actuator. Let's make the C key restore the cube back. To do that, we need another set of logic bricks. Click the Add buttons on the Sensor, Controllor, and Actuator tabs. Set the sensor type to Keyboard. Left click in the Key area. In the rectangle where it says Press a Key, press the C key. Now the key area displays the letter C.

In the Actuator area, select Edit Object. In the popup menu which lets you select the type of object editing you want, select Replace Mesh. In the Obj: field, enter Cube. Wire the sensor to the controller and the controller to the actuator. Run the game by moving the cursor into the 3D window and pressing the P key. Let the cube fall to the ground. Press the R key first, replacing the cube with the monkey. Press the C key next, replacing the monkey with te cube. Pretty neat...you can make objects appear and disappear.

One last thing I want to point out before my 10 minutes runs out. Don't worry. I'll show more stuff in the next part. It's a good idea to name your sensors something meaningful instead of Sensor and Sensor1, the default names. To do this, expand the details for each sensor. Name the first sensor Monkey. Then click the arrow to hide the details. Expand the details for the second sensor. Name the second sensor Cube. Now you can tell what each sensor does.

I hope this gives you a better idea of how to wire up logic bricks to do basic object movement, as well as how to replace one object with another under Game Engine control. Leave your comments at http://forum.irakrakow.com. Happy Blendering!

Tuesday, January 26, 2010

2.49b BGE (Animation) Part 2



The purpose of this video is to compare animation in Blender 3D modeling with animation in the Blender Game Engine. The animation results are different because the BGE uses a different physics engine, Bullet Physics, than the 3D animation engine. As you will see, because the default frame rates are different, animations generated in the BGE are faster (60 frames per second) than in Blender 3D (25 frames per second). I will show how to visualize animations in both, how to synchronize the animations between the BGE and Blender 3D, and the basic visualization settings in the BGE that will let you fine tune your game animations.

I am using Blender 2.49b because, as far as I can tell, this is the only Blender version where you don't need Python scripting to synchronize the animations. Versions before 2.49 required you to have a Python script to set the default frame rate in the BGE. Blender 2.50, Alpha 0, has not fully implemented BGE animation yet. In 2.50 alpha 0, you can run a game and show visualizations, but you can't do animations in Blender 3D and have them show up in the BGE, or vice versa. Both of these can be done in 2.49b. I'll show you how to do both and why it's a good idea to be able to move smoothly back and forth between Blender 3D and the Blender BGE. So 2.49b seems to be the way to go if you want to do animation with the Blender Game Engine.

By the way, I have not seen this type of discussion anywhere, either as a video, in documentation, or in a book. The closest is Tony Mullen's book Bounce, Tumble, and Splash, which is an excellent introduction to Blender physics libraries such as the fluid simulator, soft bodies, cloth, boids, particles, and so on. However, he uses an older Blender version which needs a Python hack to synchronize the animation speeds between Blender 3D and the Blender BGE. My conclusions are the result of pure experimentation. If you have any comments on this, please join my Blender 3D forum at http://forum.irakrakow.com, and comment on this video.

Here are the steps:

a) Setup: Go into Animation View by selecting it from the different views available. Go into Front View, the best view for the BGE because of the gravity simulation, by pressing Num1 or View Front from the menu. Start by deleting the default cube (Select, right click, then confirm with the Delete key), Add an icosphere (Add - Mesh - Icosphere), accepting the defaults. Add a plane (Space - Add - Mesh - Plane). Tilt the plane 45 degrees (R - 45 - Enter) to tilt it. This will make the icosphere fall off the plane when we press P to play the game in the Blender Game Engine.

b) Before running the BGE, we need to make the icosphere an Actor, with rigid body physics. The plane will be an obstacle for the sphere, which will react according to gravity by falling off the plane. Movement of the sphere down the plane is dependent on gravity and the calculations of the Bullet Physics engine, as well as the mass of the object and other things. Press the P key with the 3D cursor in the 3D window to run the game. Press Esc to stop the game.

c) We can generate IPO curves from running the game. Check the Record Game Physics to IPO check box. Press the P key to run the game. Note how the IPO curves are generated in the IPO Curve Editor.

d) Here's how to fine tune collisions in the game engine. Select the icosphere. Select Bounds, and then Sphere. Check the Show Physics Visualization menu item from the Game menu. The visualization shows the rectangular area which is the collision area of the plane, as well as the spherical area which is the collision boundary for the sphere. This is how you check for valid collisions in the game engine. Press the P key to run the game. Press Esc to stop the game.

e) Let's see how our animation runs in the 3D part of Blender. Run the animation with Alt-A. Note how the animation runs much slower. Why is this? This is because the 3D animation is at 25 frames per second. Go to Scene buttons and find the FPS indicator. The BGE runs at 60 frames per second. In the World buttons, and this is ONLY in 2.49, in the Mist/Stars/Physics panel, the Physics part refers to the Blender Game Engine. The dropdown shows Bullet, the default engine. There's also Servo Physics. We'll leave the engine at Bullet. The FPS is at 60. We can change it to 25. Then rerun the BGE by pressing the P key. Press the ESC key and new IPO curves are generated.

f) We can also change Gravity. The default is earth's gravity at 9.8. Let's decrease it to 2, simulating a planet with less gravity. Press the P key to rerun the BGE. Press ESC to end the game and generate new curves.

g) We'll change gravity back to earth, 9.8. We're going to clear out the IPO curves we created. Press the A key in the IPO Curve Editor to select all the curves. Press the Delete key and confirm the deletion.

Another way to generate IPOs, which bypasses actually running the game, is to press Ctrl-Alt-Shift-P with your objects in the position as if you were going to run a game. Go to Frame 1. Position the icosphere above the plane. Disable Record Game Physics to IPO in the Game Menu. Instead, press Ctrl-Alt-Shift-P. The Bullet Physics engine runs, generating the IPO curves. Press Alt-A. Change gravity to 16. Press Ctl-Alt-Shift-P. Then press Alt-A. We now have the IPOs for gravity in a bigger planet, like Jupiter.

h) Let's go the other way, from 3D to the Game engine. We'll create a simple animation in Blender 3D. First, get rid of the previous IPO curves by going to the IPO Curve Editor, pressing the A key to select all the curves, and pressing Delete. Set keyframes from 1 to 100. Start with the ball. Keyframe it at Frame 1 by pressing the I key and selecting LocRot. Go to Frame 100. Move it 5 or so Blender Units up. Keyframe it by pressing the I key and selecting LocRot. Press Alt-A. Now we have an animation in Blender 3D over 100 frames.

i) We can get the Game Engine to run this animation using Logic Bricks. Do the Always Sensor with the IPO actuator. Select the Play type. Connect the sensor to the controller and the controller to the actuator, as usual. Make the end frame the same as the end frame in the 3D engine. Then run the BGE, to show that the BGE can run the IPO curves created in the IPO Curve Editor.

I hope you now have a better idea of how animation works in Blender 3D as compared with the animation of the Blender Game Engine. They're totally separate, yet, with more understanding of how Bullet Physics and gravity work, they can work well together. I look forward to seeing your animations, both in the BGE and in 3D, on my Blender 3D forum at http://forum.irakrakow.com. And don't forget to subscribe to my videos as well. Happy Blendering!

Monday, January 18, 2010

BGE Blender 2.50 Part 1

Join my Blender 3D forum where you can network with other Blender friends and get your Blender 3D questions answered.

Download the blend file



This is the first in a series of tutorials on the Blender Game Engine (BGE) in Blender 2.5. The purpose of this tutorial is a quick tour of the BGE user interface in 2.5. If you have used the BGE in 2.4x, the process should be fairly familiar to you. Even if you have never used the BGE, after watching this tutorial you should be comfortable enough to experiment with creating more complicated games. I'm using Blender 2.5 Alpha 0, which you can download from blender.org.

So let's get started. We'll use the default cube, in the default scene. We're going to bounce the cube onto a plane, simulating the ground. To create the plane, press Shift-A, then Mesh, then Plane. Scale the plane 10 times (S - 10 - Enter). Position the plane so that its center is roughly at the center of the cube. Select the cube. Move the cube upwards, in the positive Z direction, about 5 blender units, by pressing the G key, then the Z key, then 5. Now the cube appears to be ready to be dropped.

Blender 2.5 contains a series of views that are designed for things you would commonly want to do. Click on the icon to the left of the Default text. You should see selections such as Animation, Compositing, Scripting, and so on. Select Game Logic. Let's do a litte tour of the Game Logic setup. At the upper left is the outliner. In addition to the Camera and the Lamp, we have the cube, which is the active object, and the plane, which is just called Mesh. To the right of the outliner is the 3D view, set to Top View to start. Let's change to front view and rotate the view a bit so that we can watch the cube drop. With the cursor inside the 3D view, press Num1, or from the View Menu select Num1, to go to Front View. I used the middle mouse button to give the view a bit of an angle from the Front View, so you can see the cube drop.

Blender's game engine uses the Bullet Physics library to simulate gravity, collisions, bouncing, and the physics of the game world. This is actually a different type of physics library than, say, the fluid simulator or soft bodies. One of the challenges of working with the game engine is getting used to the differences. Animation and texturing, as examples, work a bit differently in the BGE than in the 3D modeling part of Blender.

Having said that, to make the cube participate, so to speak, in the game, we need to select the cube and click on the Physics buttons (all the way to the right). Right now, the settings for the BGE are not available to us. It appears as if the 3D physics options, such as Fluid and Cloth, are what's available. To make the BGE settings active, change the the renderer from Blender Render to Blender Game. Now the Blender Game Physics options can be set. To make the cube do its thing in the game engine, change the Physics type to Rigid Body. Note that the Actor check box is checked automatically.

This is enough to make the cube participate in the game. As in 2.4x, with the cursor in the 3D window, press the P key to start the Game Engine. The cube falls onto the plane, and rolls over a bit. Press ESC to go back to the 3D view.

Another way to start the Game Engine is to click on the Camera icon, the first one on the left, in the Properties Window. The buttons here also changed when we changed the view from Blender Render (which shows the image and animation settings) to Blender Game. Now, there's a big Start button. We can press the Start button to start the game as well.

Now we're going to add some interactivity to the game. We'll push the cube to the edge of the plane by nudging it a bit, until eventually the cube falls off into oblivion. To do that, we'll work with the bottom middle window. We'll maximize this window by pressing Control - Down Arrow. Then we'll zoom, using the Num- key, until we can see the Sensor, Controllor, and Actuators button groups. There are 3 Add keys. Click each Add key to add a Sensor, a Controller, and an Actuator. Here's the deal. The Sensor looks for some type of activity, in this case it's going to look for a particular key to be pressed. The Controller can control the logic as to what happens when that key is pressed. The Actuator determines what exactly happens after the sensor and controller logic has been set.

Let's make it so that when the user presses the R key, the cube moves a bit in the X direction. To do that, click on the Always dropdown in the Sensor area. Note that there are all types of sensors. We're going to use the Keyboard sensor. Select Keyboard. Position the mouse at the Key area, and left click. The prompt Press A Key displays. Press the R key. Any key will do.

Now go to the Actuators area. In the first Loc area, enter 0.5. The idea is that when we press the R key, the cube will go .2 Blender Units in the X direction. If you had entered 0.2 in the second area the cube would go .2 Blender Units in the Y direction, and similarly 0.2 in the 3rd area would make the cube go .2 Blender Units in the Z direction. There are other things you could have made the cube do, such as add a force or rotate (torque).

Finally, we need to hook up the Sensor, Controller, and Actuator. Connect the right socket of the Sensor with the left socket of the Controller. Then connect the right socket of the Controller to the left sockete of the Actuator. Now, when the BGE detects the R keypress, the cube will go .2 Blender Units in the X direction.

Let's see if this is what happens. Press Control-down arrow to return this logic window back to its original position. Click the Start button. The cube does what it did before. Now I will press the R key a few times. The cube bounces up a bit because that's what the Bullet Physics calculation might think a cube resting on its point might do as well. Eventually, the cube falls off the plane and bounces into space.

Let's add some more interactivity. Add an icosphere next to the cube (Shift-A, Mesh, Icosphere), accepting the defaults. Position the icosphere under the cube, between the cube and the plane. Go to the Physics tab. Give it a Rigid Body physics preoperty. Let's make the icosphere go .2 Blender Units in the -Y direction when we press the Space Bar. Maximize the bottom middle window, the one with the Sensor, Controller, and Actuator tabs. Press the 3 Add buttons for Sensor, Controller, and Actuator. Select the Keyboard sensor. Move the cursor to the Key area and left click. When prompted to press a key, press the Space Bar.

Press the P key in the 3D window to start the game. If you positioned the icosphere underneath the cube, watch the cube hit the icosphere and then react as if it was affected by the collision. Depending on how large the plane is and how big the cube and icosphere are, you might get different effects. The cube and or the icosphere might fall off the plane. Pressing the space bar causes the icosphere to move.

I hope this gives you a start with using the Game Engine in Blender 2.5. Press the SUBSCRIBE button on Youtube to make sure you won't miss my future BGE and Blender tutorials. Happy Blendering!

Sunday, January 17, 2010

Free Blender Render Farms

Join my Blender 3D forum where you can network with other Blender friends and get your Blender 3D questions answered.



One of the most significant challenges for Blender users is that, when scenes become complex, with meshes containing many thousands, or even millions, of polygons, complicated physics, many texture and material channels, many render layer passes, all of which are animated, render times on even a powerful PC can become unacceptably high. These can stretch into even days or weeks. You might think that you would need a Pixar-size budget to get acceptable render times. In fact, it's possible to significantly reduce render times, I mean by factors of 10 or 100, for free. The answer is to use one of the free render farm options available. I believe that Blender, combined with using one of these render farm options, can help you to approach Pixar-like, or Avatar-like, quality videos with a fraction of Pixar's budget, or even with no budget at all. That's why I call Blender "Pixar on your laptop". I hope Pixar doesn't sue me for this slogan. My goal for this video is to show you how to either create your own render farm if you have some spare PCs hanging around, and you have a wireless Internet connection, or how you can use one of the free, open source, to grab the computer power you need.

First, here's a quick and dirty way to create a render farm with some spare PCs that you have networked. The only real requirement is that you have enabled file sharing on, say, a Public folder in your network. I don't know what operating system - Windows XP, Vista, System 7, Linux, Mac OS X, whatever - that you're working on, but I'll assume that you have some way to share files. Once you've done that, create the Blend file that you want to render. Press the Scene button (F10) and in the Output directory, enter the name of the shared folder (I entered /IRA-PC/Public just as an example). Then press the Touch and the No Overwrite buttons. What this does is allow any temporary files to stay around. Save the file. Then copy the Blend file to the Public folder, making sure the file is shareable. The last step is to go to each PC on your network, open up the blend file, and press the ANIM button. Each computer will then start up at the next unrendered frame, thus sharing the rendering load. Try it. Tell us your results by going to my blog for these tutorials, at http://blender3dvideos.blogspot.com, and adding a comment.

OK, now suppose you don't have spare PCs available and want to speed up your renders like the big guys. No problem. There are a number of free, open source, render options available. I'll show you two of them. The most commonly used one is FarmerJoe, which you can download at www.farmerjoe.info (Make sure you use the .info suffix.) I haven't installed it, but I did download the zip file. The install appears to be simple enough. Unzip the file, in Windows, run the exe file, and then run the Python script to schedule jobs. There's a Web app server to check the status of your job. Again, try it and tell us your results by adding a comment to my blog at http://blender3dvideos.blogspot.com. I'll post the full URL of the blog page on the Youtube notes to this video.

Another possibility is the University of California, Berkeley's BOINC project, which uses the spare computer cycles of PCs around the world, available for anyone to share. You can join the network, at http://boinc.berkeley.edu and trade your idle CPU cycles with other PCs. There's plenty of idle computer time to go around. Why not make use of it?

Maybe you have other ideas? If so, please share them by commenting, either on my blog at http://blender3dvideos.blogspot.com, or leave a comment on this video. If you liked this, remember to hit the Youtube Subcribe button so you won't miss any of my future Blender tutorials. Happy Blendering!

Friday, January 15, 2010

2.49 Armature Animation

Join my Blender 3D forum where you can network with other Blender friends and get your Blender 3D questions answered.

Download the blend file



The purpose of this video is to show how armature animation works in Blender 2.49b. Understanding how to move the bones in an armature is the key to being able to rig a character. We'll first create a basic skeleton-like armature. Then, I will show the difference between FK (Forward Kinematics) and IK (Inverse Kinematics). I like IK in particular because my initials are IK. It's also something we both have in common with the exquisitely unreadable German philosopher, Immanuel Kant.

Leaving the Categorical Imperative aside, we will create a simple hand wave cycle and introduce the Action Editor and the Non Linear Action Editor (NLA Editor), to give you an idea of how actions are defined and how they can be layered together to produce complex movement. We're concentrating on the armature only, how the skeleton moves, so to speak, not the object to be rigged. Once you have an armature, say, of a human, moving correctly, you can then rig it to a human-like object. This is the theory behind the ManCandy rig. I will discuss skinning, the process of associating an armature with a character, either 2 or 4 footed, or I guess any-other-number-of-footed creature, in another tutorial.

Steps:

1) Delete the default cube. We're going to create a primitive skeleton. Go to Animation view by selecting it from the View dropdown. Go to Front View (Num1). Add an armature (Space - Add - Armature). Scale the bone up 4 times (S - 4 - Enter). Look at the Outliner. Expand the Armature outline. Note that the Armature has one bone, called Bone.

Tab into Edit mode. A bone is a child object to the armature. A bone has three parts, the tip, the root, and the body. A bone can be selected in one of two ways. One way is to select the bone's body, which will also select the bone's tip and root. The other way is to right click on the body and shift right click on the root, which selects the body, which is between the tip and the root. Press W for the Specials menu. Select Subdivide Multi, with 4 cuts. So now we have 5 bones, which can function as a primitive spinal cord. Expanding the Armature display in the outliner shows that the bones are named Bone.001, Bone.002, Bone.003, and Bone.004, parented to Bone. You can also see the names in the 3D view by going to the Edit buttons (F9)and pressing the Names button. Press the Names button again to turn the names off.

2) Turn on X-Axis Mirror. This is a handy tool which lets you create mirrored bones on the X axis. When the bones are symmetrical, using X axis mirror means that you only need to create bones on one side. Mirrored bones are created on the other side. Normally, to simply add a bone, you press the E key, which extrudes the bone. However, with X-axis mirror turned on, you can add mirrored bones by pressing Shift-E. If X-Axis Mirror is turned off, Shift-E acts like the E key, just extruding one bone. we'll also mirror extrude 2 legs with Shift-E.

Here's how it works. We're going to create two primitive arm bones, on the left and the right, at the same time. With the tip of the 4th bone of the "spine" selected, press Shift-E. This creates two bones, on the left and the right, which can be scaled. Press Enter when the bones are at the desired size. Select the tip of the newly created bone on the right and press Shift-E again. This creates two more mirrored bones.

We can create mirrored legs. Select the root of the lowest bone of the armature. Press Shift-E to create two "legs". Then select the tip of the bone on the lower right. Press Shift-E to create two more bones, for the feet. I hope you get the idea. I'll leave it to you to create fingers and hands, but for now, we have the basic skeletal bone strucure.

Let's see how bones are named. From the Editing buttons, in the Armature panel, click on Names. Names shows you the names of the bones that were generated. An easy way to see how the bones are named is by using the Outliner. The original bone is called Bone. The spine bones were created with the suffix .001, .002, .003, when the big bone was subdivided. Mirrored bones, the ones created with Shift-E, have an additional _R and _L, depending on whether they are created on the left or the right. Look at the outliner. You can see that each leg is parented off the base bone, Bone. If you look at a detailed armature, such as the Mancandy rig, you'll see that the bones have meaningful names, like Left Arm, Right Pinky, and so on.

The outliner clearly shows parent-child relationships in the armature. This is important when we start posing the armature. Turn off names.

3) OK. Now we have a basic skeleton. Let's see how the bones move, in particular the difference between forward kinematics (FK) and Inverse Kinematics (IK). Blender has a special mode, called Pose Mode, allowing us to move bones so that the armature ends up in the position we want. We're going to create a simple arm wave, what Blender calls an Action. Blender has a special mode, called Pose Mode, for moving armature bones. We're at Frame 1. Select the two bones for the right arm (Right click on the arm, then Shift-Right click on the second bone). Press the I key. Select LocRot.

The curves don't appear in the IPO Curves editor, although they were created. The reason you don't see the curves is that you need to go to the Pose curves. Change the curve type from Object to Pose.

A handy feature in the timeline is the red button that automatically records keyframes as you move bones around. If you don't press it, you would need to remember which bones you moved as you keyframe. This way, Blender keyframes each move as you do it.

Now go to Frame 11 by pressing Up arrow or entering the number 11 in the current frame area. Select the arm bone and press the G key to move it up a bit. Then select the other arm bone and press the G key to move it up in a salute type position.

We've actually created half of the waving action. We'll complete it now. Switch the window from the IPO editor to the Action Editor. Note that there are 2 keyframed bones, Bone.003_L, and Bone.003_L.001. The diamonds indicate the keyframe. To complete the wave, select the two diamonds (they're yellow when selected and white when unselected), at Frame 1. Then press Shift-D to copy. Finally, drag the two diamonds to Frame 21. Drag the vertical green arrow and watch the wave. Press Control-DownArrow to maximize the Action Editor. Rename the action to Wave, from Action. Press Control-DownArrow to return the Action Editor to it's original position.

Let's see the difference between FK and IK. Select the right arm bone. Turn on the AutoIK button. Grab the arm and move it. Note how the whole skeleton, except for the legs, move. This is definitely not how an arm moves. It's actually more appropriate for a leg. IK actually does movement backwards, to the root of the skeleton. You can change how far back the IK calculates by disconnecting a bone. To show this, select the third bone, go into Edit Mode (Tab), and click the CON button, which disconnects this bone. Go back into Pose Mode. Select the arm again, and move it. Note that the movement stops at the disconnected bone. FK does movement forwards.

There's one last window to see, the NLA Editor. This lets us mix different types of actions. Change the window type to NLA Editor. You should see the Wave action. If you press the C key while the Wave action is highlighted, you're prompted to change the action to an NLA Strip. Press Enter. These strips can be combined (wave + walk + hip swivel + talk, and so on). A detailed explanation of the NLA Editor is the subject of a future tutorial.

So that's a brief look into the basics of animating an armature. I hope you enjoyed it. If you did, be sure to hit the Youtube Subscribe button so you won't miss any of my future tutorials. Happy Blendering!

Wednesday, January 13, 2010

2.50 Animation Part 2

Join my Blender 3D forum where you can network with other Blender friends and get your Blender 3D questions answered.

Download the Blend file



In my first animation video, I showed how to keyframe location, rotation, scale, and material color, as well as how to group keyframed properties into keying sets. I left you probably wondering how, considering that the IPO window has disappeared, you can change the curves by editing them as you could do in Version 2.4x. In this video, I will show you how this is done, and how, overall, the animation process is easier than before. We will also look at some properties that now can be keyframed, such as modifiers, as well as the new F-Curve system.

Steps:

1) Start with the default scene, with the default cube. Change to the Animation view. In the Animation view, there are a number of new windows, in addition to the 3D window. The three that specifically relate to animation are on the left part of the screen. At the top is the Dopsheet, which is the new name for the Action Editor. As before, pressing Ctrl-down arrow makes the window full screen. We'll be doing this a lot in this video, to see what's going on in a particular window. Pressing Control-down arrow again returns the window to its original size.

In the middle left part is the Graph Editor, which is the new version of the 2.4x IPO Editor. You can edit animation curves in the Graph Editor. The organization of the curves has been redone, with major enhancements which I'll point out as we go.

At the bottom right corner is the timeline, the window which has changed the least. As before, you can scrub the animation by dragging the vertical green arrow, and the VCR llke keys do roughly what they did before. As I mentioned in the 2.50 Animation Part 1 tutorial, you can now run the animation backwards.

Before we start, set the end frame of the animation to 50 frames by entering 50 in the End area of the Timeline.

We're going to insert a LocRotScale keyframe at Frame 1, to start the animation process. It works the same way. Position the cursor over the 3D window. Press the I key. Select LocRotScale. Let's see what happened. It looks like there were some curves added in the Graph Editor. Press Ctrl-Down Arrow to see what was added. We can't see what curves were added until we click on the left arrow, to expand the display.

Nine curves indeed were added, location, rotation, and scale, in the X, Y, and Z direction, as in 2.4x. The rotation curve has a new term - Euler - that wasn't there before. That's because rotation can be done in what's called Quaternions, as well as Eulers. For the time being, ignore this. Eulers are what we know as XYZ. We'll go into more detail about these curves after we actually animate the cube.

Press Control-Down Arrow to return the Graph Editor back to its original size.

Go to Frame 25. Press the G key and drag to move the cube over 4 or 5 Blender Units. Press Enter when done. Scale the cube up 2 times (S - 2 - Enter). Rotate the cube 45 degrees (R - 45 - Enter). Press the I key and insert an LoRotScale keyframe. Let's see what happened in the various graphs.

Start with the Graph Editor. Indeed, there are now 9 curves that we can see. They're all visible because all the check boxes at the left are checked. There's also an individual color assigned to each curve, such as red for the cube's X location. Let's in fact edit the curve for the cube's X location. To do that, uncheck all the boxes except for the X location curve. As before, each curve (they're now called F-curves) is a Bezier curve. You're in edit mode, with all the points, each representing a keyframe, selected. Press A to deselect all. Then right click on the ending keyframe. Move it up 2 Blender units or so by pressing the G key and moving it up. If you uncheck the Cube group and then check it again, all the curves display.

The lock icon controls whether or not a particular curve can be edited. If you click on it, the lock icon goes into the locked position and it can't be edited. If you click on it again, the curve is unlocked and can be edited.

Press Ctrl-Down Arrow to return the Graph Editor to its original location.

Press Alt-A to run the animation. The cube goes in the X direction, according to how you edited it.

The eye icon controls whether or not that particular curve contributes to the animation. It's a toggle. When the curve contributes to the animation, you see an eye. When it doesn't, the icon is greyed out. To show you how it works, click on all the eyes except the one associated with the X location curve. Press Control-Down Arrow to return the Graph Editor back to its original location. Press Alt-A or use the VCR keys to animate. Now the cube just moves in the X direction.

While we were animating, note that the Dopesheet, the graph at the top right part of the screen, was populated. Position the cursor over the Dopesheet and press Control-Down Arrow. These are actions that can be combined in the NLA editor. We won't discuss these in this video. I just wanted to point this out. There still seem to be some problems with screen refreshing of this window.

Let's see what happens when we animate another object. Let's add Suzanne to the scene (Shift-A, Add, Mesh, Monkey). Let's insert a LocRotScale keyframe for her. Press the I key, then select LocRotScale. Some more curves were added. Amazingly, we can edit the curves of both objects. What happened? First, Suzanne is now called "Mesh". There's an object called Mesh, as well as a mesh called "Mesh". As with the cube, the curves for what we used to know as Suzanne are in the Mesh's mesh. If you expand the Mesh Mesh, you'll see them. You can also view the Cube's curves.

Press Alt-Down Arrow to return the Graph Editor back to its original position.

The last thing I'll show in this video is that modifiers can be keyframed. This can make for amazing effects. Let's add an Array Modifier to the monkey. Set the current frame to 1. Then, click on the Modifier icon in the Mesh's Properties. Select Array. Change the count to 4. With the cursor on Count, in the Array Modifier area, right click. Select Insert Keyframe. Then go to Frame 25. Change the count to 2. With the cursor on Count, select Insert Keyframe. Press Alt-A to run the animation. Note how the number of monkeys changed.

Look at the Graph Editor. A new curve, called Count(Array) was created. There also is a Count(Array) curve created in the Dopesheet.

The goal is that any property you can see can be animated. Think of all the modifiers and all their properties that you can now animate easily.

Believe it or not, this only scratches the surface. I hope this tutorial gets you to think about how to use Blender 2.5's animation in your scenes. Don't forget to subscribe to my videos on Youtube so you won't miss any. Happy Blendering!

Monday, January 11, 2010

2.50 Animation Part 1

Join my Blender 3D forum where you can network with other Blender friends and get your Blender 3D questions answered.


Download the blend file


Watch mfoxdogg's Blender 2.50 Tour 9 Part 2 (Animation) video



This tutorial is based on the Blender 2.5 Tour 9 (Animation) video, published by Michael Fox, aka mfoxdogg. Michael works closely with the Blender developers and has detailed knowledge of all the new features in 2.5. At my blog, at http://blender3dvideos.blogspot.com, is a link to his animation tutorial, as well as to his blog at blenderlabrat.blogspot.com. He has been doing Blender 2.5 tours for a while now, as evidenced by the fact that this is Tour 9. What's nice is that Michael also frequently contributes comments to my videos as well. If you have 2.5 questions, just email him or post a response to his comment.

I won't go into nearly as much detail as Michael does. My goal for this video is to give you a basic understanding of how animation in 2.5 works, and how it differs from 2.4x animation. For one thing, animation is much easier in 2.5. For another, you can animate just about anything in 2.5. In 2.4x there were many features that you could not animate. The developers completely rewrote, and significantly improved, the animation code in 2.5.

So start up Blender 2.5. I'm using the Alpha 0 version, which you can download from blender.org. We'll start with the default cube. Just as in 2.4x, with the cursor in the 3D window, you can press the I key to insert a keyframe. You can insert combinations of location, rotation, and scale keyframes. At Frame 1, insert a LocRotScale to insert location, rotation, and scale keyframes. The timeline window is right below the 3D window.

Move the timeline slider to Frame 50. Move the cube 3 or 4 blender units to the right (Right click to select, G to grab, then drag, then press ENTER). Scale the cube up 3 times (S - 3 - Enter). Rotate the cube 45 degrees (R - 45 - Enter). Insert a LocRotScale keyframe (press the I key, then select LocRotScale). Set the animation end frame to 50 by entering 50 in the End area. Press Alt-A to animate. Note how the cube grows, moves, and rotates from Frame 1 to Frame 50. Press ESC to stop the animation.

Alt-Shift-A behaves a bit differently from Blender 2.4x. If you press Alt-Shift-A, the animation goes backwards, from Frame 50 back to Frame 1. You can see the backwards animation in the timeline, as the slider goes backwards. In 2.4x Alt-Shift-A pleys the animation forward in all windows. In the VCR controls in the timeline, you see two arrows, a left pointing arrow and a right pointing arrow. The left pointing arrow plays the animation backwards, and the right pointing arrow plays the animation forwards.

Just as in 2.4x, you can animate material properties, such as diffuse color. In 2.4x, you had to go to the material context and press I to insert a keyframe. In 2.50, the material properties are grouped together in the materials panel. Let's change the diffuse color from red at frame 1 to green at frame 25 and blue at frame 40. First, go to the materials panel by clickinig on the grey ball icon. Then go to Frame 1 by setting the current frame number. A basic goal of Blender 2.5 is that anything that you see can be keyframed. The way to do that is to right click on a property and then select Insert Keyframe. Click on the Diffuse Color rectangle. Change it to a reddish color by selecting it in the color wheel. Right click on the rectangle and choose Insert Keyframes. Keyframes are inserted for the Red, Green, Blue, and Alpha channels.

Now go to Frame 25 by setting the Current Frame slider. Click on the Diffuse Color rectangle. Change the color to a greenish color. Right click on the diffuse color rectangle. Select Insert Keyframes.

Go to Frame 40 by setting the Current Frame slider. Click on te Diffuse Color rectangle. Change the color to something blue like. Right click on the diffuse color rectangle. Select Insert Keyframes. Now press Alt-A. Now the cube grows, moves, rotates, and changes color, based on the keyframes you have set.

You can add bunch of properties at a time, including properties you could not set in 2.4x. You do this by defining a keying set. Here's how it's done. We're going to change a group of properties related to specularity, the little spot that's reflected from the lamp. To do this, go to Frame 1, in the usual way. Right click on the Specular color rectangle. Click on Add Single To Keying Set. Then right click on the Specular Shader. Click Add Single to Keying Set. Right click on Hardness. Click Add Single to Keyiing Set. We've now defined properties related to specularity that we can keyframe all at once. At Frame 1, change Specular color to magenta, Shader to Phong, and Hardness to 255.
Click the little Key icon next to the word ButtonKeyingSet. This keyframes all those specular properties. Go to Frame 33. Change Specular color to yellow, Shader to Blinn, and Hardness to 3. Click the Key Icon next to the word ButtonKeyingSet. Keyframes are added at that point. If you press Alt-A, you might not see all the changes, but if you created an actual video, you would see it.

At this point, if you have worked in 2.4x with animation, you might be wondering where all these curves are kept and whether you can edit them in the IPO window. Well, I have news for you. The IPO Curve Editor is gone. Now you're probably even more confused. The IPO Curve Editor has been replaced by the Graph Editor. These curves are, after all, graphs. The graphs are grouped in a way that you really can edit them easily. The curves are grouped into action oriented curves (the location, rotation, and scale curves), and the Materials oriented curves. The Button Keying Set, when expanded, shows the curves related to specularity, that we defined in the keying set. If you collapse the Button Keying Set, you see the diffuse color curves.

How can you edit just one curve? By clicking on the eye icon, you can hide (or show) a particular curve. You can hide or show all the curves in a keying set by clicking on its eye icon. If you click enough eyes, you can get down to the particular curve you want to edit. By the way, these curves are now called F-curves. These curves are Bezier curves, just as in 2.4x. I'll discuss the Graph Editor, as well as the other visual editors related to animation, in Part 2 of the 2.5 Animation Tutorial.

I hope this gives you a leg up on how animation has changed in Blender 2.5. If you want to play with the Blend file I created, go to my blog related to this tutorial, at blender3dvideos.blogspot.com. Also, don't forget to press the Subscribe button on Youtube so you can find out how this 2.5 animation story ends. Happy Blendering!

Friday, January 8, 2010

Animated Procedural Textures

Join my Blender 3D forum where you can network with other Blender friends and get your Blender 3D questions answered.

Download the blend file



My last tutorial demonstrated how to animate object location, using Insert Loc keyframes from the 3D window, manipulating curves in the IPO Curve Editor, as well as how to use IPO drivers and PyDrivers. You might get the idea that location, rotation, and scale are the only things you can animate. In fact, there are many other areas in which you can animate. In this tutorial, I will show how to animate a procedural texture to create a wavelike or moving cloud effect. This technique is based on the excellent series of tutorials by Colin Litster, at www.cogfilms.com. If you really want to create a realistic ocean effect, make clouds float by realistically, make a flag wave, and so on, you should check out all of Colin's tutorials. This techniques has become very popular in the Blender community. Colin been a driving force in the Blender community for a long time.

Blender's textures come in two forms, procedural and image. If you've worked with Blender for even a short time, you've probably encountered the Image texture, which is simply the projection of a 2D image into an object, such as a plane. Image textures are non-procedural. The image, what you see, is what you get. Procedural textures are really little programs that you can tweak to get a particular special effect. One of the most commonly used procedural texture is Clouds. We're going to animate the Clouds procedural texture, projected onto a colorless, shadeless plane, to produce a wavelike effect.

You can download the blend file that I created, that you can use in your own projects and share freely. You can find the link at my blog, http://blender3dvideos.blogspot.com, where you can also read the script for my tutorial, as well as the scripts for all the tutorials I've published.

So start with the default Blender scene. Delete the default cube (Right click to select, press the Delete key, then Enter to confirm). Add a plane (Space - Add - Mesh - Plene). Scale it 3 times (S - 3 - Enter). Orient the camera so that it faces the plane (View - Align View - Align Active Camera to View, or press Ctrl - Alt - Num 0). Scale the plane in the X and Y direction so that it fills out the outer dashed line rectangle. This will ensure that the camera sees the entire plane, without the background rendering.

Press the Shading button (F5) and use the default material (Material). Press F12 to render. The plane renders with the default gray color and the specular highlight. We're going to make the animated procedural texture control both the shape and the color of the rendered plane. To get rid of the specular highlight, click the Shadelees button. Press F12 to render. In the Map To panel, all the way at the right, make the color black.

Press F6 or click on the icon next to the ball to go to the Texture buttons. The first texture channel (channel 0, technically, we need to remember that), with the word Tex is selected. The texture we select will be mapped to that channel. There are 10 texture slots. We can blend all sorts of textures (images, clouds, blending types, and so on) using these slots. We'll use the default Channel 0. From the Texture Type dropdown, choose Clouds. You can control how the clouds look using the sliders and the various types of noise, such as soft noise or hard noise. Accept the defaults. You can play with these later to get the effect you want.

Press F12 to render. You get a sort of black and white wavy picture produced by the clouds texture. We are now going to animate this so that it looks like real waves. Split the 3D view. From the bottom border of the window, right click when you see the double arrows. Select Split Area. Move the cursor to where you want the view to be split. Press Enter. Then change the type of the newly created window at the right to IPO Curve Editor.

We're going to work with the IPO Curve Editor in full screen mode. To do that, position the cursor inside the editor area and press Control- Down Arrow. The IPO Type is set t Object by default. There are other types that can be set. Change the IPO Type to Material. Note on the right all the different things that can be changed - red, green, and blue channels, the alpha (for transparency), specularity, hardness, and so on.

We're going to change two offsets, the X offset (OfsX) and the Z offset (OfsZ). The X offset controls the track of the texture across the Z axis, making it seem to move across the window. The Z offset changes the shape of the cloud/wave texture. We'll animate this over 100 frames. Start with OfsX. Left click OfsX. Zoom the view using the Num+ and Num-, so that you can see the 1 and -1 values on the right. These represent the number of blender units to offset as the animation proceeds. At about Frame 1 (it's not necessary to be totally exact), with the value at -1, press Control-Left Click. A horizontal curve is created. Go to Frame 100 or so. Control-Left Click where the value is 1.
You now created a Bezier curve interpolated between those two values, for the 100 frames. To make the curve interpolate linearly, go to the Curve menu, then select Interpolation, then Linear. We can extrapolate this line both forward and backward in time by selecting Curve - Extend Mode - Extrapolation.

We'll do the opposite for OfsZ, going from 1 to -1. Shift-Left Click OfsZ at the right. At Frame 1, find the value of 1, and press Control-Left Click. Then go to Frame 100. Find the value of -1, and press Control-Left Click. Then go to the curve menu and change the interpolation to linear. Finally, from the Curve Menu, we'll change Extend Mode to Extrapolation. We now have our two curves created.

Press Control-Down Arrow to return the IPO Curves Editor back to its original position. We can't see the animation effect in the texture with Alt-A. We need to actually animate the scene. To do that, go to the Scene buttons by pressing F10. Change the end frame to 100. Select the Preview preset by pressing the Preview button, all the way at the right. Just for this demo, we'll animate this as a series of JPEGs. You can create a video out of this by selecting AVI or MOV format. So press the ANIM button to animate. Looks sort of wavy, doesn't it?

We can make it a bit more realistically water looking. To do that, select the Material buttons, go to the Map To panel, and change the color to something bluish. Press F10 to go back to the scene buttons. Then press ANIM.

That's it! You're now an animated procedural texture guru. You might also tweak the clouds setting, especially the noise type and amount, or try some of Blender's other procedural textures. If you liked this tutorial, be sure to hit the Youtube SUBSCRIBE button so you won't miss any of my future videos. Happy Blendering!