By Michel J. All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented.

Author:Dasida Kazrajar
Country:South Africa
Language:English (Spanish)
Genre:Health and Food
Published (Last):24 March 2005
PDF File Size:16.45 Mb
ePub File Size:1.4 Mb
Price:Free* [*Free Regsitration Required]

By Michel J. All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied.

Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals.

However, Packt Publishing cannot guarantee the accuracy of this information. Michel Anders, after completing his chemistry and physics studies, where he spent more time on computer simulations than on real world experiments, he realized that his real interests lay with IT and Internet technology.

He has worked as an IT manager for several different companies, including an Internet provider and a hospital. He lives happily on a small, converted farm with his partner, 3 cats, and 12 goats. He has been using Blender since version 2. He loves to help people with Blender and Python-related questions and may be contacted as varkenvarken on blenderartists. First, I would like to thank all the wonderful people at Packt Publishing. Without their help this book would not have been written.

Also, I would like to thank my partner and my colleagues at work for putting up with my endless talks about Blender. Finally, I'd like to thank all those people in the Blender community who have together made Blender such a wonderful application. Pang Lih-Hern is a computer game engine programmer with five years of industry experience. He started programming when he was 12, learning the quick Basic language.

After graduating with a degree in Software Engineering and Games Design from Multimedia University Malaysia he started his freelancing endeavor that eventually lead him to be part of the core technical team of John Galt Games Malaysia.

He was part of the decision making group in designing and implementing the company's proprietary game engine. Lih-Hern is also actively involved in the open source front, often submitting fixes and features for the popular open source Ogre3D engine.

One notable contribution is the Parallel Split Shadow Map feature that enhances the shadow rendering of a 3D scene. He is also a strong advocate of Blender and is currently holding the position of maintaining the Blender exporter to Ogre3D's mesh format.

The goal was to create innovative AAA quality games without the need for huge budget cost by the means of using open source technology and tools such as Blender, Gimp, and Ogre3D. As of now, Liquid Rock Games is in the process of developing its first racing title named Aftershock—an online multiplayer post-apocalyptic racing game. The game's artwork is modeled and textured using Blender and Gimp, showing the capability of such tools in the commercial market.

First of all, I would like to thank the publisher, Packt publishing, for giving me the opportunity to review this book. I would also like to thank my family and the co-partner of my company for allowing me the spare time and support to review this book. I hope that the readers will benefit from this book and be inspired to produce more amazing useful tools for Blender. Blender is no doubt the most powerful, and versatile, open source 3D package available.

Its power comes close to, or even surpasses, many professional packages. Blender's built-in Python interpreter plays an important role in tapping this power and allows artists to extend the functionality even further.

Yet, mastering a scripting language and getting familiar with the many possibilities that Blender offers through its Python API can be a daunting venture. This book will show how to get the most out of Blender by showing practical solutions to many realistic problems. Each example is a complete working script, which is explained step-by-step in a very detailed manner.

Chapter 1, Extending Blender with Python , gives you an overview of what can and cannot be accomplished with Python in Blender. It teaches you how to install a full Python distribution and how to use the built-in editor. You also learn how to write and run a simple Python script and how to integrate it in Blender's menu system.

Chapter 2, Creating and Editing Objects , introduces objects and meshes and you will see how to manipulate them programmatically. Specifically, you learn how to create configurable mesh objects, design a graphical user interface, and how to make your script store user choices for later reuse.

You also learn how to select vertices and faces in a mesh, parent an object to another, and how to create groups. Finally, this chapter shows how to run Blender from the command line, render in the background, and how to process command-line parameters. Chapter 3, Vertex Groups and Materials , tells you about the many uses of vertex groups and how versatile they can be. You get to know how to define vertex groups and how to assign vertices to a vertex group.

You will also learn how you can use those vertex groups for modifiers and armatures. You also look into the application of different materials to different faces and how to assign vertex colors to vertices.

Chapter 4, Pydrivers and Constraints , shows how you can associate built-in constraints with Blender objects and how to define complex relationships between animated properties by using the so-called pydrivers. You also define new complex constraints that may be used just like the built-in constraints. Specifically, you see how to drive one IPO from another by a Python expression, how to work around some limitations inherent in pydrivers, and how to restrict the motion of objects and bones by adding constraints.

This chapter teaches you how to write a constraint in Python that will snap an object to the closest vertex on another object. Chapter 5, Acting on Frame Changes , focuses on writing scripts that may be used to act on certain events. You can learn what script links and space handlers are and how they can be used to perform activities on each frame change in an animation. You also see how to associate additional information with an object, how to use script links to make an object appear or disappear by changing its layout or changing its transparency, and how to implement a scheme to associate a different mesh with an object on each frame.

Finally, you can look into ways to augment the functionality of the 3D view. You also look into posing armatures and combining poses into actions. Chapter 7, Creating Custom Shaders and Textures with Pynodes , introduces Pynodes and you get to know how they enable you to define completely new textures and materials.

You learn how to write Pynodes that create simple color patterns, Pynodes that produce patterns with normals, and you also learn how to animate Pynodes.

This chapter also explains about Pynodes that produce height and slope-dependent materials and even create shaders that react to the angle of incident light. Chapter 8, Rendering and Image Manipulation , turns to the rendering process as a whole.

You can automate this rendering process, combine the resulting images in various ways, and even turn Blender into a specialized web server. Specifically, you learn how to automate the rendering process, create multiple views for product presentations, and create billboards from complex objects. You get to know about ways to enhance Blender with some external libraries to manipulate images, including render results. Chapter 9, Expanding your Toolset , is less about rendering and more about making life easier for the day-to-day use of Blender by extending its functionality.

In this chapter, you learn how to list and archive assets such as image maps, publish a rendered image automatically with FTP, extend the functionality of the built-in editor with regular expression searches, speed up computations by using Psyco—a just-in-time compiler, and add version control to your scripts with Subversion. Appendix A, Links and Resources , gives you a list of most resources used in this book along with some generally useful information. Appendix B, Common Pitfalls , highlights some of the common questions that pop up more often than others as do some mistakes.

Appendix C, Future Developments , is the final appendix that tries to show what the future holds in store and how this may affect you as both Blender and Python are constantly developed further. All examples in the book use Blender 2. Many examples assume that you have a full Python www. In Chapter 1, Extending Blender with Python , you are shown how to install a full distribution—if you don't have one already.

Blender and Python are platform independent and all examples should run equally well on Windows, Linux, and Mac. Some additional modules are used as well and suitable download instructions are provided where appropriate. This book is for users comfortable with Blender as a modeling and rendering tool and who want to expand their skills to include Blender scripting to automate laborious tasks and achieve results otherwise impossible.

Blender experience is essential as is some experience in Python programming. In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning. Code words in text are shown as follows: The Python file with the mesh building blocks is called mymesh. When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:.

New terms and important words are shown in bold. Words that you see on the screen in menus or dialog boxes, for example, appear in the text like this: Then we can apply this vertex group to the density parameter in the extra panel of the particles context to control the emission.

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of. If there is a topic that you have expertise in and you are interested in either writing or contributing to a book on, see our author guide on www. Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title.

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

We appreciate your help in protecting our authors, and our ability to bring you valuable content. Before we start crafting scripts in Blender we must check whether or not we have all the necessary tools available. After that we will have to familiarize ourselves with these tools so that we can use them with confidence. In this chapter, we will look at:. With so many things possible there is an awful lot to learn, but fortunately the learning curve is not as steep as it might seem.

Let's just type in a quick few lines of Python to put a simple object into our Blender scene, just to prove we can, before we head into deeper waters.


Blender 2.49 Scripting

Dorr Game Development with Three. Getting Started with Arduino and Python. This book came to fill this huge gap in the Blender documentation. In Detail Blender 3D is a popular, open source modeling package that can produce photo-realistic 3D images and animations. He is an extremely talented Blender Python scripter and has written many very useful scripts for Blender.



JavaScript seems to be disabled in your browser. For the best experience on our site, be sure to turn on Javascript in your browser. Blender 3D is a popular, open source modeling package that can produce photo-realistic 3D images and animations. Automating tasks and extending the functionality of an extensive application like Blender will streamline your workflow and make the impossible possible. However, implementing scripts may be daunting. This book takes a practical step-by-step approach to implementing Python scripts that cover almost all areas of Blender.





Related Articles