essential blender 15 blender bonuses

Upload: ahmad-musaffa

Post on 30-May-2018

275 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/14/2019 Essential Blender 15 Blender Bonuses

    1/21

    Chapter 15: Blender Bonuses

    By Roland Hess

    Blenders functionality goes way beyond what has been shown in this book. Youve no doubt seen a lot ofbuttons that were never touched in the tutorials, and settings that were not explained in the discussions. Inaddition, there are entire sections of Blender that we havent even mentioned. Just to give you a sense ofwhat to tackle after youve 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 objects and have the systemtreat them as though they were real objects, conforming to the laws of physics. Rigid body dynamics cansimulate something as simple as a brick wall breaking to pieces, or something more elaborate like acomplicated Rube Goldberg device. Blender has built in support for rigid body dynamics simulation using theBullet Physics SDK (Software Development Kit).

    This is mainly used to support a Game Engine. Through the use of built in programming tools and internallogic and control systems, you can create a fully-functional game directly within Blender. A game could bea complex racing simulation like 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, makingthings happen in an efficient, realistic manner.

    Even if you dont want to create games, though, Bullet is useful to the animator and still artist. Many times,you need an added touch of realism, mostly where gravity and collision are concerned, and it can be toughto keyframe such things believably. In Blender, you can use the rigid body dynamics of Bullet to do theheavy lifting.

    Record Game Physics to Ipo

    Blender can record Bullet rigid body simulations into an objects animation curves. On the main header is aGame menu, under which you will find the option Record Game Physics to IPO. By enabling this setting,the game engine will bake the locations 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 PhysicsAnimationBakingDemo.blend. Open thisfile, 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 simulation, and the newly generated Ipo curves should be visible inside the Ipoview.

  • 8/14/2019 Essential Blender 15 Blender Bonuses

    2/21

    The Physics Baking Demo

    Rigid Body Settings

    Objects are identified for use by the physics engine as Static objects by enabling their Actor button in theLogic buttons. Static objects are useful to represent environments in a simulation: the ground, buildings andother non-movable objects. If objects need to be moved by the physics engine, the Dynamic and Rigid Bodybuttons must also be enabled.

  • 8/14/2019 Essential Blender 15 Blender Bonuses

    3/21

    The Logic buttons.

    Collisions

    Any objects that have their Actor button enabled are detectable for collisions. Objects that collide with otherobjects will react as they would in the real world, knocking each other around based on their mass settingsand momentum. Blender 2.43 added support for compound collision shapes for rigid body objects that arepart of a parent-child hierarchy. You can enable compound objects by choosing the new Compound buttonfor the parent objects:

  • 8/14/2019 Essential Blender 15 Blender Bonuses

    4/21

    Compound collision objects.

    Compound collision objects let you build complicated structures, with each part having its own type ofcollision boundaries.

    Rigid Body Constraints

    Some objects may be dynamic rigid bodies, but their movements should be limited. For example, a door cannormally only rotate around its hinges. This hinge would be a constraint. To simulate a chain of connectedobjects, you can limit the motion of each part in the chain so that the objects stay within a certain distance ofone another. These types of constraint relationships are built with the Rigid Body constraint type, in theObject buttons.

  • 8/14/2019 Essential Blender 15 Blender Bonuses

    5/21

    Rigid Body Constraints

    More About Rigid Body Physics and Bullet

    You are invited to visit http://www.bulletphysics.com for some cool demos, and lots more information.

    COLLADA Physics Support

    Several other 3D tools and game engines support COLLADA, an open interchange format for interactive 3D.One of the unique features of COLLADA is its capability to represent rigid body information. Blender 2.42and later supports COLLADA Physics import and export. This means that the rigid body information that hasbeen set up can be exported and imported through COLLADA 1.4. This can be useful when authoring rigidbody 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 of gelatin wiggling on amoving plate, a banner flapping in the wind, or the bounce of body fat as a character jumps across alandscape.

    A mesh object is set to use Soft Body dynamics by enabling the Soft Body button on the Soft Body panel ofthe Physics buttons, where the Particle controls are found.

  • 8/14/2019 Essential Blender 15 Blender Bonuses

    6/21

    The Soft Body controls

    If you load the file softbellyhank.blend from the examples folder on the included disk, you will find thatHank from the character animation and rigging chapters has put on a few pounds. Soft body dynamics havebeen applied to his enlarged stomach so that it rebounds as he walks.

  • 8/14/2019 Essential Blender 15 Blender Bonuses

    7/21

    Soft belly Hank

    Soft bodies work with the concepts of goals and springs. In short, the goal is the original, modeled shapeof the mesh, and the Goal controls on the panel tell the simulator how rigorously the mesh should attempt tomeet that goal shape. The Edge controls at the bottom of the panel control stretchiness, or how and howmuch the 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 system. This is because softbodies can be restricted based on a vertex group. By creating a vertex group with a low weight on thestomach and a high weight on the rest of the mesh, the soft body system can be told to use those vertexgroup weights for goals.

    Soft bodies can also be used to simulate cloth, although at this time a full cloth simulation for something likean animated characters clothes isnt practical.

    In addition to the basic soft body simulations, the system can take colliding objects into account, as well ascheck for self-collision within a soft body object to keep it from intersecting itself. Standard and self-collisiondetection 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 simulator. Based on the Lattice-Boltzmann Method, the fluid system produces excellent results that are limited only by the computationalstrength (RAM and CPU) of your particular machine.

  • 8/14/2019 Essential Blender 15 Blender Bonuses

    8/21

    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 alsoinclude objects that will add fluid to the simulation over time (inflows) or remove it (outflows). These are alldefined by adding separate objects to your scene, then enabling each for fluids on the Fluid Simulationpanel of the Physics buttons. From there, you use the buttons to define which role the object will play in thesimulation.

    The Fluid Simulation assignment buttons.

    After all of the objects are defined, the simulation is run by pressing the Bake button. Using high resolutionscan take enormous amounts of time and memory, but most modern systems should be able to handle small-scale needs like water pouring into a glass, etc., without much trouble.

    The final product of the fluid simulation is an animated mesh object that can use any standard Blendermaterial, with careful settings to mimic water or other fluids producing excellent visual results.

  • 8/14/2019 Essential Blender 15 Blender Bonuses

    9/21

  • 8/14/2019 Essential Blender 15 Blender Bonuses

    10/21

    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 Fluid Simulation buttons.

  • 8/14/2019 Essential Blender 15 Blender Bonuses

    11/21

    Click Enable, then Domain.

    Add an Icosphere, positioning it within the cube and scaling it down to fit completely inside. Then, Enable thesphere as the Fluid.

  • 8/14/2019 Essential Blender 15 Blender Bonuses

    12/21

    The icosphere inside the cube, Enabled as a Fluid.

    One thing to be aware of before you actually do any simulation is that the Domain object, in addition todefining the area in which the simulation takes place, becomes the actual animated fluid. Dont be surprisedwhen 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 so. Reselect the cube andclick "Bake" on the Fluid Simulation panel. Wait a couple of minutes. The progress bar on the main headerwill show how far the simulation has progressed. It will also show itself working in the 3D view. When it'sdone, just press Alt-A in the 3D view to see the simulation. For a better look with higher resolution data, youcan change the dropdown menu that reads "Preview" to "Final."

    If you fluid simulation is taking too long to calculate, you can press the Esc-key to cancel.

    Python Scripting

    Blender includes a programming language called Python. By writing or loading Python programs withinBlender's text editor, you can extend Blender's functionality in almost any way you can imagine.

    A simple script to select an object's parent looks like this:

  • 8/14/2019 Essential Blender 15 Blender Bonuses

    13/21

    Of course, you don't have to be a programmer to take advantage of the creativity of others. Tucked awayinside several of Blender's menus are Python scripts, ready to use. In fact, you may have already used themwithout knowing it. Here are some of the places you can find them:

  • 8/14/2019 Essential Blender 15 Blender Bonuses

    14/21

  • 8/14/2019 Essential Blender 15 Blender Bonuses

    15/21

  • 8/14/2019 Essential Blender 15 Blender Bonuses

    16/21

  • 8/14/2019 Essential Blender 15 Blender Bonuses

    17/21

    The last image shows one of the UV Mapping pop-up menus, where the last item "Unwrap (smartprojections)" is a Python script. In the other menus, you can see the little Python snake icon beside theentries. Each and every one of those is a Python script that is loaded and placed in the menus when Blenderruns.

    In addition to being integrated into the menu system, Python scripts can be executed in a number of differentways. If they are loaded as a text file like the first example, placing the mouse over the text window andpressing Alt-P will run the script. Scripts in the text editor can also be linked to scenes, materials and objectsin the 3D view. Such linked scripts can be set to run whenever the screen redraws, whenever the framenumber changes, or at render time. This kind of link gives scripts the ability to control and alter objects inreal-time as you work, over the course of an animation, or just during the render.

  • 8/14/2019 Essential Blender 15 Blender Bonuses

    18/21

  • 8/14/2019 Essential Blender 15 Blender Bonuses

    19/21

  • 8/14/2019 Essential Blender 15 Blender Bonuses

    20/21

    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 Pythonprogramming language installed on your system already, Blender's Python environment will happily use yourinstallation, including any special modules or packages you have installed. This means that your capabilitieswith Python scripting in Blender are almost limitless. Future development plans for Python within Blenderinclude the ability for Python scripts to create and control their own UI panels directly within the mainBlender interface.

    Coming Soon!

    With an active and creative development team, there are even better things on the horizon.

    Currently in the works:

    - The ability to remap hotkeys and control events, meaning that users can truly customize their ownexperience. Keyboard maps that simulate other 3D applications to ease transitioning users will no doubtbecome popular.

    - A completely new particle system with excellent support for hair and fur that includes intuitive, interactivecontrols for combing, growing and cutting hair, as well as a host of new methods of particle visualization andcontrol.

  • 8/14/2019 Essential Blender 15 Blender Bonuses

    21/21

    - The next Google Summer of Code will no doubt include several great Blender projects. In the past, theGSoC has brought us the modifier stack enhancements, multiresolution sculpting, FFMPEG, the IK rewriteand improvements, and the fluid simulator.