Chapter 1. A First Encounter with Blender’s Source Code
Chapter goal: To outline the Blender source tree, and provide an execution trace of how Blender registers geometric manipulation operators, and the execution of a few of the associated callbacks.
• The Blender Project
o Discusses where Blender source code is hosted and how developers can find help online.
• The Blender Source Tree
o Listing of the modules included in Blender, and what each module does
• The Blender CMake Build System
o How Blender makes uses of the CMake build system, and how various modules can be included or excluded from a build
• Some High-Level Geometric Modelling Tools & Their Operators
o Discusses how operators are registered in the C code
o Describes where primitive creation and geometric editing operators are registered and how to determine their callbacks
• The Model-View-Controller Architecture of Blender
o Explains the rationale for the general architecture of Blender and its history
• Roadmap for the Remaining Book
o What is “core” Blender?
What this book covers and what it does not cover
Chapter 2. The Blend File Format
Chapter goal: Explains the persistent data model and related data structures of the .blend file
• What Does the .blend File Contain?
o High-level description & purpose of the .blend file
• Byte Layout of the .blend File
• Backwards Compatibility of the .blend File
• Blender DNA and the Data Model
o Shows how the contents of the .blend file map to DNA (data structures) and the data model and internal API
• The Dependency Graph
Chapter 3. GHOST and the Main Event Loop
Chapter goal: Dissects the global host module (GHOST) and points out the high-level main event loop in the window manager module
• Blender’s cross-platform support for multiple windowing and operating systems: gHOST
o Overview of the source files in the gHOST module
• Trace of the Initialization Routines
• GHOST and the Event Loop
• Differences Between Linux, MS Windows, and MacOS builds
Chapter 4. BlendLib & Utilities
Chapter goal: Discusses the suite of functions provided by the internal utilities libraries of Blender
• The Math Utilities
o Explanation of the math utilities used throughout core Blender
• The File Utilities
• The global context and blendlib
Chapter 5. Blender Embedded Python Engine
Chapter goal: Describes the connection between Python API and the internal compiled code of the embedded (extended) interpreter
• How Python is Embedded in a C Program
o Preliminaries on embedded Python
• How Blender Embeds Python
o UI dependencies
o Associated source files & important module (externally linked) functions
o Startup and initialization
• The Data API & RNA generated code
Chapter 6. Blender User Interface Components
Chapter goal: Describes the internal graphical user-interface of Blender and how Blender uses OpenGL to draw and manage its custom UI
• Internal UI API
o Describes Windows, Other UI Elements, and Events
• How to construct simple UI Elements in C.
• Hierarchy of UI Elements.
• Trace of Window Updates and Drawing in C code
Chapter 7. BMesh Data Structure and the bmesh Module
Chapter goal: Describes the bmesh data structure and how the associated geometric operators update its data.
• BMesh Design
o How BMesh stores geometry data?
vertices
edges
topology
etc.
o How BMesh updates data?
o How BMesh is linked to Python scripting modules via RNA (Data API)?
o Trace of a Hypothetical BMesh update with the following operators
Bevel
Extrude
Knife Cut
etc.
• Associated source code (modules and files) of bmesh
• How BMesh is serialized in the .blend file?
• Associated DNA structures and BMesh
Chapter 8. Adding a Custom Editor Module
Chapter goal: A details set of steps to add a new module to the Blender code base. Provides both an all C-code implementation of an editor, and then an implementation that uses Python to produce the same GUI components. The parallel views further reinforce the material from Chapters 5 & 6.
• A Basic Window in C
o Adding operators and buttons in C
• Adding Operators and Buttons in Python
o How these UI elements map to C functions in core Blender
• Adding Source Files for a New Editor
o CMake additions for proper system build with a new module (editor)
Chapter 9. Beyond Core Blender Development
Chapter goal: Suggests approaches to reverse engineering and developing non-Core Blender
• Modifiers and Other Editors
• Cycles Rendering
• Physics Simulation