Tải bản đầy đủ (.pdf) (475 trang)

sybex mastering blender (2009)

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (9.98 MB, 475 trang )

MASTERING BLENDER
Tony Mullen
Mullen
SERIOUS SKILLS.
Mastering Blender
The CD includes Blender 2.48 installers for Windows and
Macintosh, a source tarball for users of Linux and other
fl avors of Unix, and a variety of .blend fi les.
Are you ready to push the envelope on your Blender
abilities? This professional resource takes you
step by step through intermediate and advanced
techniques for Blender’s modeling, texturing,
scripting, game-creation, and visual effects tools.
It covers advanced topics on sculpting, compositing,
and video editing, as well as provides a complete
introduction to Python
®
scripting suitable for people
with no programming background.
Intermediate Blender users will explore specific
workflow topics that will help boost productivity
and enhance the quality of their work. Advanced
users will find tips and techniques not covered
elsewhere that will help them optimize Blender’s
functionality for professional projects. Learn how
to create assets for use in a game engine, how to
use Python in the game engine environment, and
much more.
If you want professional tips to reach new
heights and create visually stunning 3D
animations in Blender, this is the book for you.


Tony Mullen, PhD, has a broad background in CG-related work. He teaches at Tsuda College, where
his courses include modeling and animation with Blender as well as the Python programming language
(used for scripting in Blender). Mullen has been a cartoonist and an illustrator; his screen credits
include writer, codirector, or lead animator on several short fi lms, including the award-winning short
The Devices of Gustav Braüstache, Bachelor of Science, and the recent live-action/stop-motion fi lm
Gustav Braüstache and the Auto Debilitator, appearing at several international fi lm festivals. He is the
author of Introducing Character Animation with Blender and Bounce, Tumble, and Splash!: Simulating
the Physical World with Blender 3D, both from Sybex.
$59.99 US / $71.99 CAN
ISBN: 978-0-470-40741-7
T
T
T
Th
Mac
Learn advanced
texturing tricks,
such as how to
use Blender’s own
2D texture paint-
ing functionality
to create game
assets
Create Amazing 3D Animations
As You Build Your Blender Skills
COMPUTERS/Computer Graphics/General
www.sybex.com
Learn video editing and compositing with the Blender Video
Sequence Editor and node-based compositor
07417ffirs.indd ii07417ffirs.indd ii 2/20/09 9:14:13 AM2/20/09 9:14:13 AM

Mastering
Blender
07417ffirs.indd i07417ffirs.indd i 2/20/09 9:14:12 AM2/20/09 9:14:12 AM
07417ffirs.indd ii07417ffirs.indd ii 2/20/09 9:14:13 AM2/20/09 9:14:13 AM
Mastering
Blender
Tony Mullen
07417ffirs.indd iii07417ffirs.indd iii 2/20/09 9:14:13 AM2/20/09 9:14:13 AM
Acquisitions Editor: Mariann Barsolo
Development Editor: Kathryn Duggan
Technical Editor: Nathan Letwory
Production Editor: Rachel Gunn
Copy Editor: Sharon Wilkey
Production Manager: Tim Tate
Vice President and Executive Group Publisher: Richard Swadley
Vice President and Publisher: Neil Edde
Assistant Project Manager: Jenny Swisher
Associate Producer: Shawn Patrick
Quality Assurance: Angie Denny
Book Designer: Maureen Forys, Happenstance Type-O-Rama
Compositor: Jeff Lytle, Happenstance Type-O-Rama
Proofreader: Josh Chase, Word One New York
Indexer: Ted Laux
Project Coordinator, Cover: Lynsey Stanford
Cover Designer: Ryan Sneed
Cover Image: Soenke Maeter
Copyright © 2009 by Wiley Publishing, Inc., Indianapolis, Indiana
Published simultaneously in Canada
ISBN: 978-0-470-40741-7
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic,

mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States
Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-
copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the
Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ
07030, (201) 748-6011, fax (201) 748-6008, or online at />Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with respect to the
accuracy or completeness of the contents of this work and specifi cally disclaim all warranties, including without limitation warran-
ties of fi tness for a particular purpose. No warranty may be created or extended by sales or promotional materials. The advice and
strategies contained herein may not be suitable for every situation. This work is sold with the understanding that the publisher is not
engaged in rendering legal, accounting, or other professional services. If professional assistance is required, the services of a compe-
tent professional person should be sought. Neither the publisher nor the author shall be liable for damages arising herefrom. The fact
that an organization or Web site is referred to in this work as a citation and/or a potential source of further information does not mean
that the author or the publisher endorses the information the organization or Web site may provide or recommendations it may make.
Further, readers should be aware that Internet Web sites listed in this work may have changed or disappeared between when this
work was written and when it is read.
For general information on our other products and services or to obtain technical support, please contact our Customer Care
Department within the U.S. at (877) 762-2974, outside the U.S. at (317) 572-3993 or fax (317) 572-4002.
Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available in electronic
books.
Library of Congress Cataloging-in-Publication Data
Mullen, Tony, 1971-
Mastering Blender / Tony Mullen.
p. cm.
ISBN 978-0-470-40741-7 (paper/cd-rom)
1. Computer graphics. 2. Computer animation. 3. Three-dimensional display systems. 4. Blender (Computer fi le) I. Title.
T385.M847 2009
006.6’930285536 dc22
2009001899
TRADEMARKS: Wiley, the Wiley logo, and the Sybex logo are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or
its affi liates, in the United States and other countries, and may not be used without written permission. All other trademarks are the
property of their respective owners. Wiley Publishing, Inc., is not associated with any product or vendor mentioned in this book.

10 9 8 7 6 5 4 3 2 1
07417ffirs.indd iv07417ffirs.indd iv 2/20/09 9:14:13 AM2/20/09 9:14:13 AM
Disclaimer: This eBook does not include ancillary media that was packaged with the
printed version of the book.
Dear Reader,
Thank you for choosing Mastering Blender. This book is part of a family of premium-quality
Sybex books, all of which are written by outstanding authors who combine practical experience
with a gift for teaching.
Sybex was founded in 1976. More than thirty years later, we’re still committed to producing con-
sistently exceptional books. With each of our titles we’re working hard to set a new standard for
the industry. From the paper we print on, to the authors we work with, our goal is to bring you
the best books available.
I hope you see all that refl ected in these pages. I’d be very interested to hear your comments and
get your feedback on how we’re doing. Feel free to let me know what you think about this or any
other Sybex book by sending me an email at , or if you think you’ve found a
technical error in this book, please visit . Customer feedback is criti-
cal to our efforts at Sybex.
Best regards,

Neil Edde
Vice President and Publisher
Sybex, an Imprint of Wiley
07417ffirs.indd v07417ffirs.indd v 2/20/09 9:14:13 AM2/20/09 9:14:13 AM
To Hana Marie Mullen, with love
07417ffirs.indd vi07417ffirs.indd vi 2/20/09 9:14:13 AM2/20/09 9:14:13 AM
Acknowledgments
As always, my thanks go fi rst and foremost to Ton Roosendaal and all the Blender developers
for all their hard work and dedication. You guys are doing important work and deserve the
heartfelt gratitude of the entire community of Blender users. I am tempted to begin naming
names, but I would not know where to stop. Please visit />List_of _Contributors for a complete list of the current developers and the specifi c work they

have done. I would, however, like to single out Blender developer Nathan Letwory (jesterKing),
who allowed me to benefi t from his expertise as technical editor of this book.
Many other developers and users have helped me in researching and writing this book, and
I’m very grateful for all the support I’ve received from the Blender community. I can’t list all of
the individuals at BlenderArtists.org whose artwork, comments, and tutorials have helped me
to learn what I know about Blender, but I am particularly grateful for those who helped me as
I ventured outside my comfort zone to write about the Blender Game Engine. Special thanks to
BlenderArtists.org forum members Social, Mmph!, Blendenzo, and the other BGE gurus who
were always eager to help me with my questions and investigations of this sometimes arcane
functionality. I’m also very grateful to Dolf Veenvliet (macouno) and Campbell Barton (ideas-
man_42), who helped me enormously to deepen my knowledge of Blender’s Python API.
Throughout this book, I have referred to websites, tutorials, support threads, and other
resources created by members of the community, and I am very grateful to all of those who
have shared their knowledge. Once again, many thanks to Bart Veldhuizen and the contribu-
tors to BlenderNation.com, and to Roel Spruit and all the moderators and administrators
at BlenderArtists.org for their support and for the great service they provide the Blender
community.
This book would not have been possible without the efforts of my editors and colleagues at
Sybex/Wiley, and I’m very grateful to all of them. Thank you to Mariann Barsolo, Pete Gaughan,
Kathryn Duggan, Rachel Gunn, Kelly Trent, and everyone else who had a hand in publishing
and promoting the book.
I’m also very grateful to my colleagues and students at Tsuda College for their support and
encouragement of my Blender-related work.
As always, I am grateful to my wife, Yuka, for her tireless support, and especially for looking
after the baby while I was spending all those hours working on this book!
07417ffirs.indd vii07417ffirs.indd vii 2/20/09 9:14:13 AM2/20/09 9:14:13 AM
About the Author
Tony Mullen is a college lecturer, animator, independent fi lmmaker, and writer living in Tokyo.
He has worked as a newspaper cartoonist, a graphic designer, a software developer, and a
researcher in natural language processing, among other things.

Since discovering Blender, he has been involved in CG animation to the point of obsession,
but he also maintains a keen interest in stop-motion techniques, notably as the lead anima-
tor and codirector of the award-winning 16mm fi lm Gustav Braüstache and the Auto-Debilitator
and other independent shorts. He is an active member of the Blender community and one of
the original members of the Blender Foundation’s Trainer Certifi cation Review Board. He is
the author of Introducing Character Animation with Blender (Sybex, 2007) and Bounce, Tumble, and
Splash!: Simulating the Physical World with Blender 3D (Sybex, 2008), as well as numerous maga-
zine articles and tutorials on Blender for the Japanese magazine Mac People.
07417ffirs.indd viii07417ffirs.indd viii 2/20/09 9:14:13 AM2/20/09 9:14:13 AM
Contents at a Glance
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
PART I



MASTERING BLENDER 3D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Chapter 1 • Controlling Your Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Chapter 2 • Sculpting and Retopo Workfl ow. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Chapter 3 • Creating Realistic Images with UV Textures
and Node-Based Materials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Chapter 4 • Video Compositing with Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Chapter 5 • Working with the Video Sequence Editor . . . . . . . . . . . . . . . . . . . . . . . . . 151
PART II



MASTERING BLENDER PYTHON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
Chapter 6 • Python for the Impatient . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
Chapter 7 • Python Scripting for Blender. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
Chapter 8 • The Many-Headed Snake: Other Uses of Python in Blender . . . . . . . . . 235

PART III



MASTERING THE BLENDER GAME ENGINE . . . . . . . . . . . . . . . . . . . . . 265
Chapter 9 • Creating Assets for the Blender Game Engine . . . . . . . . . . . . . . . . . . . . . 267
Chapter 10 • Making Things Happen in the Game Engine . . . . . . . . . . . . . . . . . . . . . 307
Chapter 11 • Python Power in the Blender Game Engine . . . . . . . . . . . . . . . . . . . . . . 341
Appendix A • Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
Appendix B • Blender-Python API Module and Class Hierarchies . . . . . . . . . . . . . . 379
Appendix C • The Evolution of Blender’s User Interface . . . . . . . . . . . . . . . . . . . . . . . 385
Appendix D • About the Companion CD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
07417ffirs.indd ix07417ffirs.indd ix 2/20/09 9:14:13 AM2/20/09 9:14:13 AM
07417ffirs.indd x07417ffirs.indd x 2/20/09 9:14:13 AM2/20/09 9:14:13 AM
Contents
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
PART I



MASTERING BLENDER 3D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Chapter 1 • Controlling Your Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3
Getting Your Way with Blender. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
User Preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Other Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Improving Your Workfl ow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
View Hot Keys and Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Grouping and Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Object Manipulation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

Keeping Up with the Blender Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
The Coming Changes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
The 2.5 Event Recode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
The Evolution of the Interface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
The Bottom Line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Chapter 2 • Sculpting and Retopo Workfl ow . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Sculpting with Blender . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Multiresolution Modeling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Sculpting a Baby’s Head . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Using the Retopo Tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Normal Map Baking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
The Bottom Line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Chapter 3 • Creating Realistic Images with UV Textures
and Node-Based Materials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .75
Creating UV Textures with Blender and GIMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Textures and Texture Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
UV Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Texturing a Locomotive Smokestack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Smoothing the Seams with Texture Baking. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Achieving Realism with Material Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
The Bottom Line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Chapter 4 • Video Compositing with Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Pulling a Green Screen Matte with Nodes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Working with Green Screen Video . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Working with Composite Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
07417ftoc.indd xi07417ftoc.indd xi 2/20/09 9:14:28 AM2/20/09 9:14:28 AM
XII
|
CONTENTS
Garbage Matting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119

Animating the Garbage Matte . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
Using Render Layers and Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Garbage Matting the Figure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
Working with Node Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
Using Alpha Overlays and Premultiplication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
Spill Correction and Cleaning Up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
Tweaking Color Channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
Finishing Off the Matte . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Muting Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
Learning More about Compositing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
The Bottom Line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
Chapter 5 • Working with the Video Sequence Editor. . . . . . . . . . . . . . . . . . . 151
Working with the Video Sequence Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
Importing Video and Image Sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
Setting Frame Rates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
Working with Sequence Strips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
Editing Sound . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
Using Markers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
Accessing Other VSE Display Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
Adding Transitions and Compositing in the VSE. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
Alpha Overlays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
Fades and Transitions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
Fading to Black . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
Transform. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
Other Effects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
Working with Plug-ins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
Meta-Strips. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
Working with Blender Scenes in the VSE. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
Adding Captions to a Video . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
Composited Scenes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181

Rendering and Output. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
The Bottom Line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
PART II



MASTERING BLENDER PYTHON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
Chapter 6
• Python for the Impatient . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
Introducing Python . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
What Is Python? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
Why Python? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
Further Resources. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
Understanding the Python Development Environment . . . . . . . . . . . . . . . . . . . . . . . . . 192
Getting Python . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
Using the Command-Line Shell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
07417ftoc.indd xii07417ftoc.indd xii 2/20/09 9:14:28 AM2/20/09 9:14:28 AM
CONTENTS
|
XIII
Using the IDLE Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
Running Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
Using the Blender-Python Environment. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
Understanding Python Syntax. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
Data Types and Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
Control Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
Classes and OOP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
The dir() Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206

The Bottom Line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
Chapter 7 • Python Scripting for Blender. . . . . . . . . . . . . . . . . . . . . . . . . . . . .209
Editing and Running Scripts in Blender . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
The Blender Text Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
Script Format and Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
The Scripts Window. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
Introducing the Blender-Python API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
Creating an Interactive Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
Working with Meshes, Objects, and Ipos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
Building the Interface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
Putting It All Together . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
The Bottom Line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
Chapter 8 • The Many-Headed Snake: Other Uses of Python in Blender . . . .235
Extend Blender Functionality with Python . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
Working with PyDrivers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
Using PyNodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
Working with PyConstraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
Using Script Links and Space Handlers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
On-the-Fly Script Execution with Script Links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
Viewport Interactivity with Space Handlers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
The Bottom Line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
PART III



MASTERING THE BLENDER GAME ENGINE . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
Chapter 9 • Creating Assets for the Blender Game Engine . . . . . . . . . . . . . . .267
Creating Content for the Game Engine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
Modeling a Simple Low-Poly Character . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
Texture Painting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275

Rigging and Animating the Character . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
Setting Up the World . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
Baking Procedural Textures for a Simple Skybox . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
Creating a Simple Maze. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
07417ftoc.indd xiii07417ftoc.indd xiii 2/20/09 9:14:28 AM2/20/09 9:14:28 AM
XIV
|
CONTENTS
Getting More Familiar with the BGE Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
Placing Your Objects in the Game World . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
Setting Material Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
Using Lighting in the Game Engine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304
Vertex Painting for Light Effects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
The Bottom Line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
Chapter 10 • Making Things Happen in the Game Engine . . . . . . . . . . . . . . . .307
Working with Logic Blocks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
Understanding Logic Block Basics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
Setting Up the Camera. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
Using Properties, Messages, and States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
Setting Up Bad Guys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
Collecting Treasure and Racking Up Points. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
Creating Special Effects with Textures. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
Creating Dynamic Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
Creating Animated Textures. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
The Bottom Line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338
Chapter 11 • Python Power in the Blender Game Engine . . . . . . . . . . . . . . . .341
From Logic Blocks to Python . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341
Controlling a Character with Python . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
Python Power for the BGE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346
Creating a Teleportation Machine with Python . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346

Creating a Login Screen. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350
Working with Viewports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358
Accessing Sound with Python . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
Further Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364
The Bottom Line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
Appendix A • Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .367
Chapter 1: Controlling Your Environment. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
Chapter 2: Sculpting and Retopo Workfl ow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368
Chapter 3: Creating Realistic Images with UV Textures
and Node-Based Materials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369
Chapter 4: Video Compositing with Nodes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370
Chapter 5: Working with the Video Sequence Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . 370
Chapter 6: Python for the Impatient . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
Chapter 7: Python Scripting for Blender . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373
Chapter 8: The Many-Headed Snake: Other Uses of Python in Blender . . . . . . . . . . . 373
Chapter 9: Creating Assets for the Blender Game Engine. . . . . . . . . . . . . . . . . . . . . . . . 375
Chapter 10: Making Things Happen in the Game Engine . . . . . . . . . . . . . . . . . . . . . . . 375
Chapter 11: Python Power in the Blender Game Engine . . . . . . . . . . . . . . . . . . . . . . . . . 376
07417ftoc.indd xiv07417ftoc.indd xiv 2/20/09 9:14:28 AM2/20/09 9:14:28 AM
CONTENTS
|
XV
Appendix B • Blender-Python API Module and Class Hierarchies . . . . . . . . . .379
Module Hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379
Class Hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381
Appendix C • The Evolution of Blender’s User Interface. . . . . . . . . . . . . . . . . .385
The Evolution of Blender’s Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386
The Good . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387
The Bad. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390

Design Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393
Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394
Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
Context Sensitivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402
Multiple Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403
Feedback. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
Drag-and-Drop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
Graphic Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
Wrap-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
Appendix D • About the Companion CD. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .409
What You’ll Find on the CD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
Chapter Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
Blender 2.48 Software. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
GIMP Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
System Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410
Using the CD. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410
Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411
Customer Care. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
07417ftoc.indd xv07417ftoc.indd xv 2/20/09 9:14:28 AM2/20/09 9:14:28 AM
07417flast.indd xvi07417flast.indd xvi 2/19/09 10:38:21 AM2/19/09 10:38:21 AM
Introduction
Things have changed rapidly in the last few years for Blender and Blender users. The number of
books and training DVDs available have gone from zero in-print English Blender books in 2006
and no DVDs to a growing plethora of books and training DVDs by major and minor publish-
ers covering animation, architectural visualization, physics simulation, and general use. The
Blender code itself has changed dramatically also. Although Blender has been under develop-
ment since the early 1990s, the size of the code base has nearly doubled since 2005 thanks to
increasing interest on the part of CG developers around the world who seek to contribute to a
major graphics phenomenon. When the planned event system recode is complete, it will be pos-

sible for Blender development to progress even more rapidly.
All of this progress is driven by the ongoing explosion of the Blender user base. Blender is
widely used by students, hobbyists, artists, scientists, and CG professionals, and its use by these
groups and others is growing every day. As the world of 3D software applications has become
increasingly consolidated, Blender has emerged as the major alternative for people who want a
free, open, and independent 3D solution. The Blender community is active in its support for the
software, and as it grows and gains momentum, so does every aspect of Blender—from the avail-
ability of professional support and training to the stability and functionality of the software itself.
This book is also a product of that expanding user base. Up until a few years ago, there were
not enough intermediate or advanced Blender users to warrant a book like this. Those intrepid
users who did gain a high degree of expertise did so by studying the code and release notes,
participating in extensive forum and chat discussions, and putting in endless hours of experi-
menting with the software itself. My intention in writing this book is to provide today’s interme-
diate and advanced users with the book those early pioneers might have wished for. This is not
a book for beginners. This is a book for Blender users.
Who Should Read This Book
To get the most out of this book, you should already know how to get things done in Blender.
You should know your way around a polygon mesh, and you should be able to set a keyframe
and tweak an Ipo curve. In some areas, you may be pretty confi dent of your skills. Perhaps you
are an expert modeler, or a master at texturing and materials. You might be able to create beau-
tiful, photorealistic scenes and render them in eye-popping quality. Maybe you’re a top-notch
character animator.
If you’re like the vast majority of Blender users, however, there’s a lot you’ve been quietly ignor-
ing about your application of choice. You may have long since stopped wondering about that
obscure buttons panel that you never touch. You may have disregarded some new development
07417flast.indd xvii07417flast.indd xvii 2/19/09 10:38:21 AM2/19/09 10:38:21 AM
XVIII
|
INTRODUCTION
and now feel left too far behind to bother trying to catch up on it. You may have been under the

impression that some areas of functionality, such as scripting, were too dry and diffi cult to get
into, or maybe you’ve simply never been clear on how they might be useful to you and what you
want to accomplish. Hopefully, this book will be a step in the direction of changing that.
In short, this book is for Blender users who wish to deepen and expand their knowledge of
the software. As the title suggests, this book is for people who want to master Blender. If there
are areas of Blender that you’ve wondered about but never looked into deeply, if there is func-
tionality you’ve toyed with but never truly mastered, then this book is for you.
What You Will Learn from This Book
This book is an attempt to cover functionality in Blender that has not been suffi ciently dealt with
in other books and to cover specifi c workfl ow topics that will help intermediate Blender users
boost their productivity and improve the quality of their work. The functionality of Blender is so
extensive that even with the available books and training materials, there remains a great deal
that has not received the attention it deserves.
As such, the subject matter covered here is broad. The fi rst part of the book is the most var-
ied, with chapters on a wide variety of Blender 3D features. The second part of the book focuses
on Python and scripting for Blender, and the third part of the book deals with the Blender Game
Engine. The only background that is assumed is an intermediate or advanced level of standard
Blender usage. No knowledge of Python or the game engine is required. By the end of the book,
you will have an advanced skill set in both of these areas, as well as numerous new insights in
other areas of Blender.
How to Use This Book
The chapters in Part I of this book are organized in a loosely logical order, but do not depend on
each other in any signifi cant way. As an intermediate or advanced Blender user, you should have
no trouble reading them in whatever order you choose. Parts II and III are more strictly ordered.
Both of these parts of the book are organized in such a way as to give complete introductions
to the topics they cover. Part II fi rst presents an introduction to Python itself, and then works
through Blender Python scripting topics starting with the most generally applicable and fi nish-
ing with the most specialized. The information follows in order, so you should skip only what
you feel confi dent that you already know. Correspondingly, Part III begins simply by describing
how to create assets for use in the game engine and ends with the relatively advanced topic of

using Python in the game engine environment.
A Word about Software Versions
The version release scheduling of open source software is not constrained by co-marketing con-
siderations, and it is inevitable (and wonderful) that development will continue at a brisk pace
regardless of the publication schedules of books. Experienced Blender users know this, and they
know that mastery of one version sows the seeds for mastery of the next version.
This book was written to be accurate to Blender version 2.48. The usual caveats apply: For the
most predictable results, you should use the appropriate version of Blender to follow the tutori-
als in the book. I heartily encourage you to forge ahead into newer versions, armed with this
book and the online release notes, in order to keep your knowledge as up-to-date as possible,
and to cultivate the mindset of regarding Blender as a constantly developing thing. Even as you
07417flast.indd xviii07417flast.indd xviii 2/19/09 10:38:21 AM2/19/09 10:38:21 AM
INTRODUCTION
|
XIX
read this, new and exciting functionality is being added to Blender and released in offi cial or
unoffi cial versions that you will be eager to learn about.
My advice on keeping up with all the latest developments: Read fast!
The Mastering Series
The Mastering series from Sybex provides outstanding instruction for readers with intermediate
and advanced skills, in the form of top-notch training and development for those already work-
ing in their fi eld and clear, serious education for those aspiring to become pros. Every Mastering
book features the following:
The Sybex “by professionals for professionals” commitment.
◆ Mastering authors are them-
selves practitioners, with plenty of credentials in their areas of specialty.
A practical perspective for a reader who already knows the basics—someone who needs

solutions, not a primer.
Real-World Scenarios, ranging from case studies to interviews, that show how the tool,


technique, or knowledge presented is applied in actual practice.
Skill-based instruction, with chapters organized around real tasks rather than abstract

concepts or subjects.
Self-review test “Master It” problems and questions, so you can be certain you’re equipped

to do the job right.
How This Book Is Organized
As mentioned previously, the book is organized into three parts. Part I includes Chapters 1
through 5. This part deals with general Blender topics, and each chapter within it covers a spe-
cifi c aspect of Blender functionality. Part II gives a complete overview of Python scripting in
Blender, beginning with a basic introduction to Python itself, suitable for nonprogrammers. Part
III gives a thorough introduction to the Blender Game Engine (BGE), including using Python in
context of the BGE. In more detail, the chapters’ contents are as follows:
Part I: Mastering Blender 3D
Chapter 1: Controlling Your Environment shows you a variety of ways you can customize
your Blender environment and streamline your workfl ow. This chapter also gives you some
early warning about changes to expect from upcoming Blender releases.
Chapter 2: Sculpting and Retopo Workfl ow takes an in-depth look at Blender’s powerful
sculpting tools and shows you how to use them in conjunction with the retopo and normal
mapping functionality to obtain highly detailed sculpt effects while maintaining good model
geometry and manageable polygon counts.
Chapter 3: Creating Realistic Images with UV Textures and Node-Based Materials shows
you how to take your texturing skills to the next level, with tutorials on using GIMP in con-
junction with Blender’s multiple UV texturing functionality to create totally seamless pho-
tographic textures, and on using the material node system to combine materials for highly
realistic effects.
07417flast.indd xix07417flast.indd xix 2/19/09 10:38:21 AM2/19/09 10:38:21 AM
XX

|
INTRODUCTION
Chapter 4: Video Compositing with Nodes shows you how Blender’s powerful node-based
compositing system can be used to pull a green screen matte and do color correction with
live-action video, and how to use animated curves and hooks to create a simple rotoscoped
garbage matte.
Chapter 5: Working with the Video Sequence Editor brings Part I to its logical conclusion,
showing you how to put everything together in Blender’s versatile Video Sequence Editor.
You’ll learn to edit sound and video, do sophisticated transitions and overlays, and bring the
full power of the compositing system to bear in a fully integrated, nonlinear video-editing
environment.
Part II: Mastering Blender Python
Chapter 6: Python for the Impatient provides a quick and painless introduction to the
Python programming language itself. Assuming no programming experience at all, this
chapter takes it from the top, giving you all the Python basics that you need to know to sink
your teeth into the next few chapters.
Chapter 7: Python Scripting for Blender gets down to business with Blender-Python. You’ll
learn how to use Python to access 3D information, automate tasks, and build your own user
interface for scripts. You’ll gain familiarity with the Blender Python API and learn how to
fi nd the information you need to do what you need to do.
Chapter 8: The Many-Headed Snake: Other Uses of Python in Blender explores all the
ways besides vanilla scripting that the power of Python can be brought to bear in Blender.
You’ll learn to write your own PyDrivers, design your own PyNodes, and defi ne your own
PyConstraints. You’ll learn how to use script links to execute scripts on the fl y, and how to
use space handlers to create script interfaces that overlay the 3D viewport itself.
Part III: Mastering the Blender Game Engine
Chapter 9: Creating Assets for the Blender Game Engine walks you through the creation
of a simple game world and a fully rigged character for a game. Among other things, you’ll
learn about texture baking and 3D texture painting, and how to set up armature actions for
use in the game engine.

Chapter 10: Making Things Happen in the Game Engine gives an in-depth overview of a
plethora of things you can do in the BGE: controlling characters and scenes with logic blocks,
using properties and states to create complex interactions, creating dynamic text and in-game
animated textures, and creating 3D sound effects.
Chapter 11: Python Power in the Blender Game Engine brings several threads together and
takes it all a step further, showing you how to use Python to create more streamlined, orga-
nized, and powerful game logic than can be created with logic blocks alone. You’ll learn how
Python can enable you to create effects and logic that wouldn’t be possible otherwise, with
examples such as a simple teleportation machine and a login screen. You’ll see how to handle
multiple cameras and split-screen effects and to gain even more control over in-game sound.
To help ensure maximum clarity for the illustrations, there is a 24-page color insert full of
images from the discussions and tutorials throughout the book. Also, an appendix is included
that details the module and class hierarchies for the Blender-Python 2.48 API.
07417flast.indd xx07417flast.indd xx 2/19/09 10:38:21 AM2/19/09 10:38:21 AM
INTRODUCTION
|
XXI
What’s on the CD
This book comes with a CD that includes Blender 2.48 installers for Windows and Macintosh and
a source tarball for users of Linux and other fl avors of Unix. You will also fi nd a variety of .blend
fi les intended to support the text.
How to Contact the Author
If you run into trouble at any point in reading this book, or if you have any insights or tips you
would like to share, the fi rst place I recommend to turn for quick responses and knowledgeable
feedback is to the community itself at www.blenderartists.org/forum, where I post regularly
under the handle bugman_2000 . You can also contact me directly at blender .characters @ gmail.com.
07417flast.indd xxi07417flast.indd xxi 2/19/09 10:38:21 AM2/19/09 10:38:21 AM
07417flast.indd xxii07417flast.indd xxii 2/19/09 10:38:21 AM2/19/09 10:38:21 AM
Part I
Mastering

Blender 3D
◆ Chapter 1: Controlling Your Environment
◆ Chapter 2: Sculpting and Retopo Workfl ow
◆ Chapter 3: Creating Realistic Images with UV Textures
and Node-Based Materials
◆ Chapter 4: Video Compositing with Nodes
◆ Chapter 5: Working with the Video Sequence Editor
07417c01.indd 107417c01.indd 1 2/20/09 9:21:51 AM2/20/09 9:21:51 AM

Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Tải bản đầy đủ ngay
×