Python book of magic/00.Introduction

From Wikibooks, open books for an open world
Jump to navigation Jump to search

Contents | Next

0 Introduction[edit | edit source]

Welcome to the Python Book of Magic. In this book you will find all the knowledge you need to gain a basic understanding of Python, and how it can be used inside Blender. You will discover how fun, flexible, and powerful Python is. Learning Python will also open a door of new possibilities. I am not a Python expert nor a Python authority. I am just a young, ambitious Python wizard like you. I started with just a few lines of code, and my addon has grown bigger and bigger from there.

If you find errors, mistakes, or you have suggestions about the book, don't hesitate even for a second to contact me or even edit the pages yourself. That's the purpose of the wiki format. It's open, so anyone can contribute.

0.1 Goal[edit | edit source]

The goal of this project is to offer Python knowledge to you, the reader, avoiding (as much as possible) anything that isn't absolutely necessary. My aim is to keep this book extremely simple, even for those who have no knowledge of coding or Python. Even though this book is about Python, it concentrates solely on how Python can be used inside Blender. For detailed documentation, links are provided for those of you that want to dive deeper into Blender and Python concepts.


Template:NiceTip

0.2 Why learn Python?[edit | edit source]

The advantage of coding is obvious. It can not only help you to implement new features to Blender, but also to automate tasks. How much time you spend on it is totally up to you. A Python script can range from a single line that should not take you more than a minute to code, to thousands of lines that take years to develop.

Python scripts/addons/programs - call them as you like, they all mean the same thing - have added tremendous functionality in Blender. For example, you can create cities with Blended Cities, you can use loop tools as a new way to create meshes, you can change themes with Theme Manager, or you can, again, create cities with Suicidator City Engine. The amazing Bsurfaces revolutionize the way you create meshes. Maybe you want to sync your animation to midi files with MIDI Driver. There are many, many more out there; that was only six of the thousands of add-ons out there.

You observed something? Yep, all these addons could be separate applications as well, as they offer a tremendous amount of new functionality. That's how powerful Python is. But I can guess your second argument, "Those people know how to code, and all I am is a noob. My brain isn't that smart, either." But that's the beauty of coding. There is no requirement for being a Python coder. Anyone can do it.

The secret of coding is that it may be a slow process, but it is a process that is well worth the time. Coding leaves you with a result you can use for years, if not decades. There is no doubt that users should learn Python so they can automate tasks and also be able customize Blender. Even if you only spend half an hour a day coding, in a few months you will gain very useful skills and improve your knowledge of programming tremendously. It's easy, it's simple, it can be done by EVERYONE, and if you don't stress yourself with unreasonable demands, it can be lots of fun.

Summary: Learn Python, and it will pay you back many times over for the time spent.

Contents | Next