User:Brita/Drafts/Source/Introduction

Introduction

Dive in!


The very first working prototype of Blender dates from January 2nd, 1994 and was made by Ton Roosendaal.
In this first version you could already see the basics of the subdivision window system and some tools, including the "Grabber", Rotate and Scale with their current shortcuts G/R/S.

Related: Video and commemorative blogpost for Blender's 25th anniversary


Language

Blender is primarily written in C, with some modules written in C++ and the user interface in Python.
The Python layer used by the UI is an API that provides access to data and operators. This Python API is what supports add-ons. (There is a Render API.?)

[figure with the bits in C, in C++ and the APIs]


FAQ: Can't you just port Blender to C++?

We believe that this gets asked often, not just because some developers come from a C++ background, but mostly because Blender's code can be considered quite hard to read.
The code readability is admittedly a very important issue that we wish to improve, but it comes not from the choice of language, but mostly from problems such as variable naming and lack of encapsulation or of a more traditional Object Oriented paradigm.
While there are ideas to transition some small areas of Blender to C++ (where the language could provide benefits) that is not a magic solution. Good naming, architecture and documentation is.


Paradigm

The codebase mostly has an imperative style. While there are some Object Oriented concepts, it is closer to Data Oriented programming.


[[|Imperative]]

Data is organized in structures, usually at a global level.


[[|Object Oriented]]

Data is encapsulated in 'objects' along with the code to handle that data.


[[|Data Oriented]]

Data is aggregated together according to the pattern of how it is used.


Blender's file data (Scenes, Meshes, Materials) is accessible in a data base style.
The data layout and access patterns are very important.
You will find that data that is used together is grouped together, but that this division may not match the normal conceptual divisions of an OO programmer.


Concepts

Independently of the area that you wish to contribute to, there are some general systems and concepts to be aware of.