Book Image

Blender 2.49 Scripting

By : Michel J. Anders
Book Image

Blender 2.49 Scripting

By: Michel J. Anders

Overview of this book

<p>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.<br /><br />This book takes a practical step-by-step approach to implementing Python scripts that cover almost all areas of Blender. It clearly outlines each problem and focuses on straightforward, easy-to-understand code, highlighting the common pitfalls and Blender idiosyncrasies. It guides you from the installation process and the creation of a simple object to elaborate, fully rigged models with vertex groups and materials all the way to extending Blender's built-in editor. It also teaches how to implement a simple web server inside Blender to serve rendered images. This book will take you from a clear problem description to a fully functional program. The focus is on finding your way in Blender's vast array of possibilities and getting things done without losing too much time on programming details. Each script is carefully explained to provide insight that can be reused in other projects.</p>
Table of Contents (18 chapters)
Blender 2.49 Scripting
Credits
About the Author
About the Reviewer
Preface
Future Developments
Index

Setting the time—one to rule them all


What use is a clock if you cannot set the time in a convenient way? Instead of positioning each hand, we would like to turn a single knob to move both the big hand and the little hand where the little hand would have to move twelve times as slow as the big hand.

Therefore, we would have to define a knob object (that we probably would not render) and drive the rotation of the bones in the clock by the rotation of this knob.

To set up the driven channels we follow these steps:

  1. In the 3D View, select the bighand object.

  2. In the IPO window, make sure that you have the object IPO types selected. On the right-hand side, there will be a list of channels. Select the one labeled RotZ by left-clicking on it. It will be highlighted.

  3. Select Curve | Transform Properties. A pop-up window will appear. Click on the Add Driver button.

  4. With the Transform Properties pop up still present, select Curve | Insert 1:1 mapping and next click on the Default one-to-one mapping pop up...