Graphics Reference
In-Depth Information
The Bottom Line
Edit and run interactive scripts in Blender. Blender has its own internal text editor that you can use to
write scripts or commentary. The text editor features line numbering and color-coded syntax highlighting.
Master It Get accustomed to working with the Blender text editor. Open operator_simple.py
from the Templates menu in the text editor header. Run the script with the System Console visible. The
names of all the 3D objects in the scene will be output to the console. Edit one line of the script so that
the script outputs the names of only selected objects to the console.
Become familiar with the Blender-Python API. If you code in Blender Python, the API will become your
faithful companion. A large part of learning to script for Blender is becoming comfortable navigating the
API.
Master It An important step in using the API is to read the API itself and figure out what its various
modulesandclassesdo.LookovertheAPInow.Whichclasswouldyouuseifyouwantedtoworkwith
a Text object in the 3D space? What method would you use to set the text string for this object?
Design your own GUI with an interactive script. Blender'sPythonAPIincludestoolsfordesigninggraph-
ical user interfaces for your scripts that enable you to set parameters and execute commands interactively.
Master It Add a new property to the bouncing cone add-on that enables you to interactively adjust the
number of vertices in the base of the cone. At present, there are 10 vertices. Make sure there is a reason-
able minimum number of vertices, and remember that the value should be an integer.
Search WWH ::




Custom Search