Book Image

Python Scripting in Blender

By : Paolo Acampora
5 (1)
Book Image

Python Scripting in Blender

5 (1)
By: Paolo Acampora

Overview of this book

Blender, a powerful open source 3D software, can be extended and powered up using the Python programming language. This book teaches you how to automate laborious operations using scripts, and expand the set of available commands, graphic interfaces, tools, and event responses, which will enable you to add custom features to meet your needs and bring your creative ideas to life. The book begins by covering essential Python concepts and showing you how to create a basic add-on. You’ll then gain a solid understanding of the entities that affect the look of Blender’s objects such as modifiers, constraints, and materials. As you advance, you’ll get to grips with the animation system in Blender and learn how to set up its behavior using Python. The examples, tools, patterns, and best practices present throughout the book will familiarize you with the Python API and build your knowledge base, along with enabling you to produce valuable code that empowers the users and is ready for publishing or production. By the end of this book, you’ll be able to successfully design add-ons that integrate seamlessly with the software and its ecosystem.
Table of Contents (19 chapters)
1
Part 1: Introduction to Python
7
Part 2: Interactive Tools and Animation
13
Part 3: Delivering Output

Python’s Integration with Blender

Blender accepts code instructions in the same way as it interacts: via a graphical user interface.. That allows artists and studios to implement their own features and automation.

Python, a highly extensible programming language with low barriers to entry, is widely used in computer graphics.

Though Blender’s core is written in C and C++, menus and graphic elements use Python. That allows custom and factory functionalities to share the same look and feel.

In this chapter, we’ll learn how to run Python commands in Blender and where to look for their outcome. We will also see where a history of past instructions is found and how to use that to our advantage. Lastly, we will introduce a code editor and a version control system and see how they help make our work easier.

By the end of this chapter, you will understand how a programmer works and why it is not so different from using software in the first place.

In this chapter, we will cover the following main topics:

  • The scripting workspace
  • Python execution
  • Version control