Graphics Reference
In-Depth Information
Chapter 12
The Blender-Python Interpreter
One of the advanced features of Blender is a fully functional, built-in interpreter for the Python scripting lan-
guage. This enables you to directly access internal Blender data to automate tasks and create your own tools, as
well as greatly enhance the power of several other features, from nodes to the game engine to F-curve drivers.
However, in order to take advantage of the power that Python can give you over your Blender work, you must
first get a sense of the Python language itself. This chapter provides a brief and gentle introduction to the lan-
guage, suitable for people unfamiliar with Python and those who have done little or no programming at all.
In this chapter, you will learn to
• Become familiar with the basics of the Python language
• Work with the Blender Python scripting environment
• Understand fundamental features of Python syntax
Introducing Python
The next two chapters of this topic are intended to give you a thorough overview of using the Python scripting
language in Blender. Because this topic is aimed at Blender users and not necessarily at programmers, I am
assuming little ornoknowledge ofprogramming, butofcourse anylittle bit will behelpful. Ifyouhave aback-
ground in another object-oriented programming language, you should find everything in these chapters to be
smooth sailing. On the other hand, if your eyes completely glaze over at terms such as variable , you'll want to
take it slow, but I hope that with a little patience and persistence even those of you in this category will eventu-
ally find yourselves able to accomplish what you want to with Python in Blender.
What Is Python?
Python is a widely used, general-purpose, object-oriented scripting language. It is used for everything from re-
search to web programming and has a wide variety of third-party libraries and tools available for it. If you're
reading this, you probably know by now that Python is also the language used for scripting in Blender. I'm
going to assume that you don't know much more than that about Python. If you do, feel free to skip ahead to
what you need.
If you're completely new to Python or to programming, the first question you might ask is, “What does
scripting mean?” Indeed, understanding this is central to understanding how Python can be useful to you in the
context of Blender, so it's worth going into a little bit of detail.
Search WWH ::




Custom Search