build your blender

BE AWARE THAT THE SCONS VERSION HAS CHANGED FOR BUILDING BLENDER!
THIS PAGE IS NOT QUITE CORRECT. I’LL UPDATE AS SOON AS I CAN FIND THE TIME!  

This page is here to help you build your own blender version!

This page is written to document the entire process I went through. The original content was written for windows XP, but I recently got a Vista laptop and I added the bits that are different. I hope it’s helpfull to you. The vista setup was a bit of a pain, so I hope I didn’t forget anything.

BTW: Mpan also wrote a very usefull page with his version of all this, which you can find here: http://mpan3.homeip.net/compileblender2


What we’ll be using

We will build blender with python/scons/tortoisesvn/mingw.
Sounds like a lot? Yes you need to install these four things, but I’ll take you through it.

I am writing this on September 17th 2007, so things may have changed by the time you read it.
I added the Vista bits on June 22nd 2008.


Step one. Installing python.

Go here to download python!

The version I downloaded is: Python 2.5.1 Windows installer
Install it in it’s default directory, I didn’t change any settings, just install.
After installing it asks if you want to restart. So restart… and remember where this page is!


Step two. Installing scons.

Go here to download scons!

The version I downloaded is: scons-0.96.91.win32.exe
There are newer versions but this one definitely works.
Install this. It should ask you what version of python you want to use.
In my case it immediately showed C:Python25 which is the directory where I just installed python.
So that’s great…. install there, no special settings, all automatic.
You may want to restart again to be sure all is well!


Step three Installing devC++/MinGw

Windows XP

Go here to download DevC++

The version I downloaded is: this one
Now the thing is that we don’t really need devC++ we want it because it has mingw in it!
So make sure you have a version with mingw and gcc!

I just did a full install in the default directory.
Also make sure that mingw is checked in the list of optional parts!
And you’d never guess… lets reboot! yay

Windows Vista

Go here to download MinGW

On Vista DevC++ didn’t work, I just installed MinGW 5.1.4 direct.
The version I downloaded is: this one
Make sure you have gcc when you install! It should be available in the options.
I installed in C:\MinGW


 Step four. Installing tortoisesvn

Go here to download tortoisesvn

The version I downloaded is: TortoiseSVN-1.4.5.10425-win32-svn-1.4.5.msi
I didn’t use any settings just installed.
I think it also asked for a reboot, so heck.. let’s reboot.


Step four. Setting your environment variables.

Right so now we have to make sure your system can find all this new stuff.

Go to your start menu/controll panel/system/advanced/environment variables

So in here you see the Path variable selected… edit it.
And add the following line to the end of the code in there:

Windows XP:

;C:\Python25;C:\Program Files\TortoiseSVN\bin;C:\Dev-Cpp\mingw32\bin;C:\Dev-Cpp\mingw32\lib;C:\Dev-Cpp\bin

Windows Vista:

;C:\Python25;C:\Program Files\TortoiseSVN\bin;C:\MinGW\bin;C:\MinGW\lib;C:\MinGW\libexec\gcc\mingw32\3.4.5;C:\MinGW\include 

Make sure that all the paths are correct and that there are ; symbols between them!.


Step five. Making folders to build blender in.

So lets set up some folders.
in C:\
make a blender folder

in C:\blender\
make a blender folder (in here we’ll put the blender source)
make a lib folder

in C:\blender\lib\
make a windows folder (in here we’ll put the windows library)


Step six. Downloading the blender source!

Go into the newly made blender folder: C:\blender\blender\

Right click your mouse and select SVN checkout!

 

Now you should get the following screen.

 

Enter the follwing line as your “URL of repository:

https://svn.blender.org/svnroot/bf-blender/trunk/blender 

Also make sure your “Checkout directory” is:

C:\blender\blender 

If all is well click ok and that will start you downloading the blender source!


Step seven. Downloading the windows library.

Because we are on windows we need to download the windows specific library.
Go to: C:\blender\lib\windows

And once again click with your right mouse button and select svn checkout.

 

This time we enter the data for the windows library

 

Enter the follwing line as your “URL of repository:

https://svn.blender.org/svnroot/bf-blender/trunk/lib/windows 

Also make sure your “Checkout directory” is:

C:\blender\lib\windows 

If all is well click ok and that will start you downloading the windows library.

Windows Vista:

I had to also copy libpython25.a from: C:\Python25\libs to C:\blender\lib\windows\python\lib to make building work, so you may have to as well


Step eight. Adding the settings file.

We may want to add some settings so that the programs all know what to do with the source.
But there is a default settings file hidden in blender’s source files as well. So you could do without this.

Here is my config file: user-config.py

Now put this file inside: C:\blender\blender

These settings basicly say that you want all the stuff inside blender except Quicktime.
You can play around with these some other time.
I have a file with the possible settings here if you’re interested: blendersettings.txt


Step nine. It’s time to do a build!

Open a command window.
You can open a command window in windows xp by going to your start menu/Run and typing in cmd in the window that pops up.
In windows vista you can just type cmd (I think) in that little search bar at the bottom of your start menu.

In the command window go to your C:\blender\blender folder
You can go there by typing: cd C:\blender\blender and then hitting enter.

Copy the following line of code:

scons BF_TOOLSET=mingw BF_BUILDDIR=c:\blender\build_dir 

Now right click the top bar of the command window and select edit/paste and click enter.

You are now building blender!!! Do a jig.. It’s mandatory!


Step ten. Finding and cleaning your blender version.

If all is well there are now a bunch more folders in C:\blender
There should be one called install and in there you will find your blender build.

But you will notice that the files are rather big. So go to the folder that has the Blender.exe and Blenderplayer.exe in it in the command window.

In my case that folder is: C:\blender\install\win32-mingw

Now type in: strip blender.exe and hit enter
And then: strip blenderplayer.exe and hit enter again.

Your blender files should have a normal size now.


Step eleven. Using your build.

You can if you want remove the stuff from your install folder and place it where you want to use it. I personally just copy the relevant code to my program files/blender folder (I do of course have multiple folders in there for sepparate builds).

That’s all there’s to it. No need to install or anything.


Step twelve. Updating your build.

Now that you have made your build you’ll surely want to update it at some point and rebuild.

You will have noticed that the C:\blender\blender folder now looks different!

folder.jpg

If you go into this folder now and right click there is an svn update option.

checkout4.jpg

Click on SVN Update and tortoise will automaticly update the blender source.
Don’t forget to do the same for the windows library!

Then just repeat step nine and step ten and you’ll have an up to date blender build!


Or the lazy way

If you’re really lazy like me… you can download this file: AutoBuildBlender.bat
It is a .bat file that automates the entire process of updating/building/cleaning.
I have it in my C:\blender folder.
It has a bunch of file paths in it that work in case you did exactly what I did on this page.
You’ll have to change those if you didn’t follow everything exactly.

Remember that the .bat file will only work after you did at least Step 8.
Tortoisesvn needs to know where the blender source is, so it can update it.

Just double-click it to run it.


That’s all there’s to it…

There are more options but now you can do a basic blender build.

Leave a Reply

Your email address will not be published. Required fields are marked *