You are on page 1of 6

Chapter 15: Blender Bonuses

By Roland Hess
Blender s functionality goes way beyond what has been shown in this book. You ve no
doubt seen a lot of buttons that were never touched in the tutorials, and settin
gs that were not explained in the discussions. In addition, there are entire sec
tions of Blender that we haven t even mentioned. Just to give you a sense of what
to tackle after you ve mastered the basics, here is a brief look at some of those
items.
Rigid Body Dynamics: Bullet
A rigid body dynamics simulation environment lets you create setups of solid obj
ects and have the system treat them as though they were real objects, conforming
to the laws of physics. Rigid body dynamics can simulate something as simple as
a brick wall breaking to pieces, or something more elaborate like a complicated
Rube Goldberg device. Blender has built in support for rigid body dynamics simu
lation using the Bullet Physics SDK (Software Development Kit).
This is mainly used to support a Game Engine. Through the use of built in progra
mming tools and internal logic and control systems, you can create a fully-funct
ional game directly within Blender. A game could be a complex racing simulation li
ke Club SILO from Luma studio (http://luma.co.za), or a ball that you push around
a maze. Within any game, though, the Bullet physics engine is at work behind the
scenes, making things happen in an efficient, realistic manner.
Even if you don t want to create games, though, Bullet is useful to the
nd still artist. Many times, you need an added touch of realism, mostly
avity and collision are concerned, and it can be tough to keyframe such
elievably. In Blender, you can use the rigid body dynamics of Bullet to
eavy lifting.

animator a
where gr
things b
do the h

Record Game Physics to Ipo


Blender can record Bullet rigid body simulations into an object s animation curves
. On the main header is a Game menu, under which you will find the option Record Ga
me Physics to IPO. By enabling this setting, the game engine will bake the locati
ons and rotations of any dynamic physics objects into animation Ipos that can be
played back later as a standard animation.
A Basic Rigid Body Sample
On the included disk in the examples folder is a file called PhysicsAnimationBakin
gDemo.blend. Open this file, position the mouse inside the 3D view and press the
P-key to start the Game Engine. After a while, press the Esc-key to stop the si
mulation, and the newly generated Ipo curves should be visible inside the Ipo vi
ew.
Figure BB.01: The Physics Baking Demo
Rigid Body Settings
Objects are identified for use by the physics engine as Static objects by enabli
ng their Actor button in the Logic buttons. Static objects are useful to represe
nt environments in a simulation: the ground, buildings and other non-movable obj
ects. If objects need to be moved by the physics engine, the Dynamic and Rigid B
ody buttons must also be enabled.
Figure BB.02: The Logic buttons.

Collisions
Any objects that have their Actor button enabled are detectable for collisions.
Objects that collide with other objects will react as they would in the real wor
ld, knocking each other around based on their mass settings and momentum. Blende
r 2.43 added support for compound collision shapes for rigid body objects that a
re part of a parent-child hierarchy. You can enable compound objects by choosing
the new Compound button for the parent objects:
Figure BB.03: Compound collision objects.
Compound collision objects let you build complicated structures, with each part
having its own type of collision boundaries.
Rigid Body Constraints
Some objects may be dynamic rigid bodies, but their movements should be limited.
For example, a door can normally only rotate around its hinges. This hinge woul
d be a constraint. To simulate a chain of connected objects, you can limit the m
otion of each part in the chain so that the objects stay within a certain distan
ce of one another. These types of constraint relationships are built with the Ri
gid Body constraint type, in the Object buttons.
Figure BB.04: Rigid Body Constraints
More About Rigid Body Physics and Bullet
You are invited to visit http://www.bulletphysics.com for some cool demos, and l
ots more information.
COLLADA Physics Support
Several other 3D tools and game engines support COLLADA, an open interchange for
mat for interactive 3D. One of the unique features of COLLADA is it s capability t
o represent rigid body information. Blender 2.42 and later supports COLLADA Phys
ics import and export. This means that the rigid body information that has been
set up can be exported and imported through COLLADA 1.4. This can be useful when
authoring rigid body data for external game engines like Ogre 3D and C4.
Soft Body Dynamics
Blender has another physics simulator, one for working with soft bodies. Think o
f gelatin wiggling on a moving plate, a banner flapping in the wind, or the boun
ce of body fat as a character jumps across a landscape.
A mesh object is set to use Soft Body dynamics by enabling the Soft Body button
on the Soft Body panel of the Physics buttons, where the Particle controls are f
ound.
Figure BB.05: The Soft Body controls
If you load the file softbellyhank.blend from the examples folder on the included di
sk, you will find that Hank from the character animation and rigging chapters ha
s put on a few pounds. Soft body dynamics have been applied to his enlarged stom
ach so that it rebounds as he walks.
Figure BB.06: Soft belly Hank
Soft bodies work with the concepts of

goals

and

springs. In short, the goal is the o

riginal, modeled shape of the mesh, and the Goal controls on the panel tell the
simulator how rigorously the mesh should attempt to meet that goal shape. The Ed
ge controls at the bottom of the panel control stretchiness, or how and how much t
he edges of the mesh can act as springs and stretch as they go about their soft
body business.
In the case of Soft Belly Hank, only the stomach is affected by the soft body sy
stem. This is because soft bodies can be restricted based on a vertex group. By
creating a vertex group with a low weight on the stomach and a high weight on th
e rest of the mesh, the soft body system can be told to use those vertex group w
eights for goals.
Soft bodies can also be used to simulate cloth, although at this time a full clo
th simulation for something like an animated character s clothes isn t practical.
In addition to the basic soft body simulations, the system can take colliding ob
jects into account, as well as check for self-collision within a soft body objec
t to keep it from intersecting itself. Standard and self-collision detection add
another level of realism to the soft body simulator.
Fluid Simulation
In addition to rigid and soft body physics, Blender has an integrated fluid simu
lator. Based on the Lattice-Boltzmann Method, the fluid system produces excellen
t results that are limited only by the computational strength (RAM and CPU) of y
our particular machine.
A fluid simulation requires several components: a domain (the area within which
the simulation takes place), a fluid (a mesh that defines the starting shape and
location of the fluid) and obstacle objects. You can also include objects that
will add fluid to the simulation over time (inflows) or remove it (outflows). Th
ese are all defined by adding separate objects to your scene, then enabling each
for fluids on the Fluid Simulation panel of the Physics buttons. From there, yo
u use the buttons to define which role the object will play in the simulation.
Figure BB.07: The Fluid Simulation assignment buttons.
After all of the objects are defined, the simulation is run by pressing the Bake
button. Using high resolutions can take enormous amounts of time and memory, bu
t most modern systems should be able to handle small-scale needs like water pour
ing into a glass, etc., without much trouble.
The final product of the fluid simulation is an animated mesh object that can us
e any standard Blender material, with careful settings to mimic water or other f
luids producing excellent visual results.
Figure BB.08, .09: Some examples of Blender's fluid simulator, courtesy of Mike
Pan.
Creating your own fluid simulation is simple.
Start a new scene, select the default cube and Enable it as a Domain in the Flui
d Simulation buttons.
Figure BB.18: Click Enable, then Domain.
Add an Icosphere, positioning it within the cube and scaling it down to fit comp
letely inside. Then, Enable the sphere as the Fluid.
Figure BB.19: The icosphere inside the cube, Enabled as a Fluid.

One thing to be aware of before you actually do any simulation is that the Domai
n object, in addition to defining the area in which the simulation takes place,
becomes the actual animated fluid. Don t be surprised when you see your nice fluid
sim, but your Domain object is gone. The Domain object is the fluid sim.
In a timeline (or Render buttons) window, set the animation End frame to 75 or s
o. Reselect the cube and click "Bake" on the Fluid Simulation panel. Wait a coup
le of minutes. The progress bar on the main header will show how far the simulat
ion has progressed. It will also show itself working in the 3D view. When it's d
one, just press Alt-A in the 3D view to see the simulation. For a better look wi
th higher resolution data, you can change the dropdown menu that reads "Preview"
to "Final."
If you fluid simulation is taking too long to calculate, you can press the Esc-k
ey to cancel.
Python Scripting
Blender includes a programming language called Python. By writing or loading Pyt
hon programs within Blender's text editor, you can extend Blender's functionalit
y in almost any way you can imagine.
A simple script to select an object's parent looks like this:
Figure BB.11: [no text]
Of course, you don't have to be a programmer to take advantage of the creativity
of others. Tucked away inside several of Blender's menus are Python scripts, re
ady to use. In fact, you may have already used them without knowing it. Here are
some of the places you can find them:
Figure BB.12, .13, .14, .15: [no text]
The last image shows one of the UV Mapping pop-up menus, where the last item "Un
wrap (smart projections)" is a Python script. In the other menus, you can see th
e little Python snake icon beside the entries. Each and every one of those is a
Python script that is loaded and placed in the menus when Blender runs.
In addition to being integrated into the menu system, Python scripts can be exec
uted in a number of different ways. If they are loaded as a text file like the f
irst example, placing the mouse over the text window and pressing Alt-P will run
the script. Scripts in the text editor can also be linked to scenes, materials
and objects in the 3D view. Such linked scripts can be set to run whenever the s
creen redraws, whenever the frame number changes, or at render time. This kind o
f link gives scripts the ability to control and alter objects in real-time as yo
u work, over the course of an animation, or just during the render.
Figure BB.16: A script called "MakeMonster" linked to a selected object, and set
to update every time the frame number changes.
Some of the more complex Python scripts can do things like create an entire syst
em for exporting to and driving Renderman compliant renderers, or simulate crowd
motion with full character animation.
Figure BB.17, .20: The Neqsus Renderman exporter (courtesy of Bobby Parker), and
BlenderPeople crowd simulation.
Although a Blender installation comes with a Python interpreter built in, if you
have the full Python programming language installed on your system already, Ble

nder's Python environment will happily use your installation, including any spec
ial modules or packages you have installed. This means that your capabilities wi
th Python scripting in Blender are almost limitless. Future development plans fo
r Python within Blender include the ability for Python scripts to create and con
trol their own UI panels directly within the main Blender interface.
Coming Soon!
With an active and creative development team, there are even better things on th
e horizon.
Currently in the works:
- The ability to remap hotkeys and control events, meaning that users can truly
customize their own experience. Keyboard maps that simulate other 3D application
s to ease transitioning users will no doubt become popular.
- A completely new particle system with excellent support for hair and fur that
includes intuitive, interactive controls for combing, growing and cutting hair,
as well as a host of new methods of particle visualization and control.
- The next Google Summer of Code will no doubt include several great Blender pro
jects. In the past, the GSoC has brought us the modifier stack enhancements, mul
tiresolution sculpting, FFMPEG, the IK rewrite and improvements, and the fluid s
imulator.
BLENDER OPEN CONTENT LICENSE
Terms and Conditions for Copying, Distributing, and Modifying
Items other than copying, distributing, and modifying the Content with which t
his license was distributed (such as using, etc.) are outside the scope of this
license.
1. You may copy and distribute exact replicas of the OpenContent (OC) as you re
ceive it, in any medium, provided that you conspicuously and appropriately publ
ish on each copy an appropriate copyright notice and disclaimer of warranty; ke
ep intact all the notices that refer to this License and to the absence of any
warranty; and give any other recipients of the OC a copy of this License along w
ith the OC. You may at your option charge a fee for the media and/or handling i
nvolved in creating a unique copy of the OC for use offline, you may at your op
tion offer instructional support for the OC in exchange for a fee, or you may at
your option offer warranty in exchange for a fee. You may not charge a fee for
the OC itself. You may not charge a fee for the sole service of providing acces
s to and/or use of the OC via a network (e.g. the Internet), whether it be via
the world wide web, FTP, or any other method.
2. You may modify your copy or copies of the OpenContent or any portion of it,
thus forming works based on the Content, and distribute such modifications or
work under the terms of Section 1 above, provided that you also meet all of the
se conditions:
a) You must cause the modified content to carry prominent notices stating that
you changed it, the exact nature and content of the changes, and the date of an
y change.
b) You must cause any work that you distribute or publish, that in whole or i
n part contains or is derived from the OC or any part thereof, to be licensed a
s a whole at no charge to all third parties under the terms of this License, unl
ess otherwise permitted under applicable Fair Use law.

c) The name of the Copyright Holder or contributors to the OC may not be used
to endorse or promote products derived from this software without specific prior
written permission.
These requirements apply to the modified work as a whole. If identifiable sect
ions of that work are not derived from the OC, and can be reasonably considered
independent and separate works in themselves, then this License, and its terms
, do not apply to those sections when you distribute them as separate works. Bu
t when you distribute the same sections as part of a whole which is a work base
d on the OC, the distribution of the whole must be on the terms of this License
, whose permissions for other licensees extend to the entire whole, and thus to
each and every part regardless of who wrote it. Exceptions are made to this re
quirement to release modified works free of charge under this license only in c
ompliance with Fair Use law where applicable.
3. You are not required to accept this License, since you have not signed it.
However, nothing else grants you permission to copy, distribute or modify the O
C. These actions are prohibited by law if you do not accept this License. There
fore, by distributing or translating the OC, or by deriving works herefrom, you
indicate your acceptance of this License to do so, and all its terms and condi
tions for copying, distributing or translating the OC.
NO WARRANTY
4. BECAUSE THE OPENCONTENT (OC) IS LICENSED FREE OF CHARGE, THERE IS NO WARRANT
Y FOR THE OC, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE S
TATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE OC "AS I
S" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICU
LAR PURPOSE. THE ENTIRE RISK OF USE OF THE OC IS WITH YOU. SHOULD THE OC PROVE F
AULTY, INACCURATE, OR OTHERWISE UNACCEPTABLE YOU ASSUME THE COST OF ALL NECESSA
RY REPAIR OR CORRECTION.
5. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL
ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MIRROR AND/OR REDISTRIBUTE THE
OC AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPEC
IAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO
USE THE OC, EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILI
TY OF SUCH DAMAGES.

You might also like