Graphics Reference
In-Depth Information
Figure 13-1 What Blender would be without Python
The Blender-Python API is made up of three sets of modules. These are application modules, stand-alone
modules, and game engine modules. Application modules are the core of the Blender-Python API. They en-
able you to access data related to the 3D scene content, the Blender interface, animation and driver data, and
Blender-specificoperationsandproperties.Thestand-alonemodulescontainmoregeneral-purposeclassessuch
asmathutilitiesandotherusefultoolsandinterfacesthatarenotpartofBlender'scorefunctionality.Finally,the
game engine modules contain the API for real-time scripting within the Blender Game Engine (BGE), which
you will read more about in Chapter 16, “Python Power in the Blender Game Engine.” In the past, the Blender-
Python API and the Game Engine API have been completely distinct, and that remains true. When in the BGE
play mode, scripts do not have access to all the data that the standard Blender-Python API has access to. This is
because the game engine modules are designed for the purpose of writing game logic, whereas the application
modules are designed for writing custom tools for working with 3D content.
Thischapterdealsprimarilywiththeapplicationmodules.Theapplicationmodulessharethecommonprefix
bpy . These modules include the following:
bpy.context Provides access to data specific to the current state of Blender. For example, the currently
selected object can be accessed through this module. Information about posed bones is accessed through
bpy.context .
 
Search WWH ::




Custom Search