develop and improve the source code of blender?

From time to time I see people asking about becoming a blender developer,
Here is my (general) advice.
Just a note that I assume if you read this you are not a guru programmer already :),

Firstly blender is a big application with many different areas so the skills you need depend a lot on what area you want to work on so don’t assume specific skills are needed before doing any blender development.

  • Education in computer science/programming not necessary, many blender developers are self taught (including myself).
  • Strong math background isn’t essential, though you will probably end up learning some math along the way.

So, where to start? - many people start with some idea of what they would like to change with blender, but be prepared that it may take a while to learn enough to make these changes, so you may need to think of some easier projects and work up to this.

Firstly pick a general area you’d like to investigate and try making small changes, reading the source and generally learn how it works, this way you don’t get bogged down by the fact blender has 1000‘s of files all this code you don’t understand!.

Examples:

  • Take a python script template and modify it to do something useful.
  • Write a simple exporter to a mesh format.
  • Take an existing tool and improve it in some way.
  • Take an existing node/modifier/script/addon and use it as the basis for your own work.
  • Look at the bug tracker and try fix a bug (be really careful here, mostly the old bugs are very tricky, try looking at the newer bugs).

There are a few things that you need to be careful of when starting up.

  • If you work on projects that are not enough of a challenge it can be hard to stay motivated.
  • If you work on projects that are too complicated they may be too difficult to complete.
  • What your capable of and what you want to do probably are not on the same level, try have realistic expectations.
  • If your unsure of something, join in the #blendercoders IRC chat room or ask on the http://lists.blender.org/mailman/listinfo/bf-committers mailing list.
  • Don’t be too disappointed if other developers are not so excited about your contribution as you’d have hoped, many developers are busy with their own projects and reviewing other peoples code is not always that simple. So you can submit a patch but depending on the scale of your work you may also try get a build on graphicall and have users test to get feedback.

I’d recommend you start on the easier tasks so at least you learn the process of making a change, submitting a patch and don’t feel like you wasted a lot of time if your patch is rejected for some reason.

In most cases I’d suggest starting with Python, even if you intend to use C/C++ eventually,

  • The barrier of entry is a lot lower, you can run a script immediately without having to get blender compiling.
  • You get errors a lot faster and can test your script a lot quicker.
  • You may find out python is all you need to solve your problem, in this case its normally easier to write a script as an Addon or give it to others.
  • Even if you end up using C/C++, Python is great for prototyping and learning how blender works.

There are some exceptions to this - if you want to write new compositor/shader nodes for example, python isn’t much use.
also, if you have experience with C/C++ but not with Python, then you may want to skip scripting.

Some developers only use Python, others move to C/C++ or keep using both, this depends a lot on which areas of blender you work on.

If you stick to an area of blender - eg: Modifiers, GameLogic, Shading, Compositor, Import/Export, Physics… in time you can become quite expert in this field and can make bigger changes or even become the maintainer where you get to make decisions and choose the direction for this area of blender to go.

– <edited> –
This document would be a lot longer if I attempted to write about how to develop but there are a few tips I think are important.

  • Firstly get used to searching blenders code, whatever IDE/editor your use, you should be able to search for a string or function name immediately.
    Before I knew anything about development I would just search the C files for tooltips and find the function calls from there & I still find this useful.

  • Secondly, get used to ‘reading the source’
    I’ve read that ***“its harder to read code then write it”, which is spot on!
    But unavoidable if you work with an existing project. Just get used to the fact that if you work on blender at first you may spend a fair bit of time reading functions to understand how it works. Fortunately you can learn a lot from this and once you follow how the functions work its not so hard to go back and be up to speed.

  • Third, When you code C in blender you have to appreciate you are often not working with a well defined, documented API. There is internal functionality which isn’t easy to follow, For closed source applications you would most likely never see this.
    This isn’t an excuse for bad code, just keep in mind a large application with millions of lines of code is just very different from writing your own program.
    At least we converted most of the Dutch variable names & comments now :D.

*** good read http://www.joelonsoftware.com/articles/fog0000000069.html
– </edit> –

ok, so you become an experienced developer but ‘what now?’ :smiley:
If you make all this effort to develop blender you may wonder whats the point of all this volunteer work when you don’t get paid.

A number of blender developers have jobs where they use blender for their company, others are developers on other software but still enjoy doing some blender work in their spare time.
there are cases where being able to script/code a 3D tool gives a great benefit when working on projects even if they are not blender-focused.

I’m speaking in general terms but just to say that if you become experienced in this area it can lead to work!

Hope this is of some help, if theres something I should cover let me know.

  • (ideasman42)
4 Likes