Newbie Questions

Hey guys,

I am a computer science student and was advised by some of my professors to spend my summer coding for a non-profit organization. I only have about 1.5 years of coding experience and I’ve never worked on a program as large and complex as this one, but I really like Blender so I figured that it’d be great if I spend my time coding for it. :yes:

My OS:
Windows 7 x64

I finally figured out how Git and Github work (sorta) and managed to download the Blender source to my computer.

Question #1: Is it okay to use Github for accessing and updating to the blender repository or should I stick to the git application? I’m asking because the Blender wiki states that the repository has trouble with SVN and I don’t know what the settings of this Github thing are set to.

Question #2: I’m confused about how MingW and CMake are supposed to be used. I understand that MingW is a compiler alternative to Visual Studio and CMake is some kind of cross-platform … thing, but I don’t understand how they come together.

I read the instructions several times and from what I gather, CMake gets called first and does something to the source before passing it to the compiler to be assembled to an .EXE. What is CMake doing and why is it necessary as a precursor to compiling?
EDIT: Okay, I’ve been reading about this a lot and from what I understand, CMake is some sort of build automation software. Evidently it is independent of the compiler, which is … odd. Does this mean CMake will automatically use my compiler or are these separate processes?

Question #3: MingW is still experimental, right? Should I even be messing with this compiler or is it better to just go with an express version of Visual Studio? I’m primarily interested in just working on improving the shape keys and driver interface for Blender, so … would the express version of VS be sufficient?

Question #4: I noticed that there is an IRC chat for blender coders, but I also noticed that they want chit-chat kept to a minimum. So … what kind of level of programming conversation is tolerated there? I don’t want to make an A$$ of myself and go in there asking questions that are beneath their time, but I really wish I had the ear of a couple of Blender veterans that are willing to put up with all of my questions.

Question #5: Does anyone have any links for code or information regarding how the shape key data structure is organized. I’m interested in how the classes for shape keys are organized and how the GUI is accessing them.
EDIT: I found the documentation for the API, but the structure is still confusing.

Just in case any of you forgot, I’ve only been programming for a year and a half. That basically means that I’ve never worked with something as complex as Blender. Just looking at the code is pretty intimidating, ya’ know?

A great place to start learning a code base is to start with some smaller, low-priority bugs. That helps you learn how all the code works and fixes some things that probably would not have gotten fixed otherwise. Smaller patches are more likely to be accepted from a new contributor because the lead developers don’t have to do as much work to tell if the patch is correct or not.

Question #1: Is it okay to use Github for accessing and updating to the blender repository or should I stick to the git application? I’m asking because the Blender wiki states that the repository has trouble with SVN and I don’t know what the settings of this Github thing are set to.

You might still have a bit of work to figure out how Blender’s source control works. Git is a source control system. Its job is to track all the changes made to the source code and remember who did which changes. It does other things, but that is one of the most important aspects.

Github is a specific website that lets people host their projects on the website. If you want to have a bunch of different people contributing to the same source code, then you need to put that project somewhere on the Internet where everybody can access it. Github provides a place to keep git repositories that are accessible anywhere on the Internet.

Most of your work will be done on your local git repository and then you will send “pull requests” to the main Blender project as a way to tell them that you have some code that fixes some problems.

Don’t worry about SVN. That is another source control program like git that Blender used to use. They have moved to git and you probably won’t have to mess with SVN.

Question #2: I’m confused about how MingW and CMake are supposed to be used. I understand that MingW is a compiler alternative to Visual Studio and CMake is some kind of cross-platform … thing, but I don’t understand how they come together.

Not quite. MingW is a set of libraries and tools that make Windows computers look like Linux/Unix computers. For example, on Windows the way that you open and read a file is different than it is on Linux/Unix. MingW lets you access the files on Windows the same way you do on Linux. It provides much more than that.

CMake is a tool that configures your build environment. When you checkout the Blender source code on Windows or Linux, the code is the same. The problem is that each platform has a different compiler installed in a different directory and all the standard libraries are also in different places. Essentially, CMake scans your computer and finds all your tools and creates a build system that works on your platform.

So basically, on Windows:

  • MingW makes your computer more like a Linux machine
  • CMake finds where your compiler and standard libraries are
  • Visual Studio can then build your Blender.

I read the instructions several times and from what I gather, CMake gets called first and does something to the source before passing it to the compiler to be assembled to an .EXE. What is CMake doing and why is it necessary as a precursor to compiling?
EDIT: Okay, I’ve been reading about this a lot and from what I understand, CMake is some sort of build automation software. Evidently it is independent of the compiler, which is … odd. Does this mean CMake will automatically use my compiler or are these separate processes?

Correct. CMake scans your computer to see which compiler is available and creates a build system (makefile, Visual Studio project, XCode project, etc) that works with your system.

Just in case any of you forgot, I’ve only been programming for a year and a half. That basically means that I’ve never worked with something as complex as Blender. Just looking at the code is pretty intimidating, ya’ know?

It can be. The drivers and shape keys strike me as a fairly complex sub-systems. You would probably be best served by starting off with a few simple bug fixes.

Sorry for all of my annoying questions, but I’ve got more. My first question is why does the Blender Wiki show MingW as a compiler option ( http://wiki.blender.org/index.php/Dev:Doc/Building_Blender/Windows/Environment ), but you’re saying that it’s a tool that makes Windows look like a NIX system. Furthermore, when you follow the MingW instruction wiki, it talks about MingW as if it were a compiler separate from Visual Studio. When I look at your instructions, you use MingW at the start, but then conclude with Visual Studio, but the Wiki shows the two programs as if they were part of separate build processes.( http://wiki.blender.org/index.php/Dev:Doc/Building_Blender/Windows )

If MingW just organizes windows so that it can be used like a Nix file system, then is it only used for building with GNU compilers? I’m asking this because MingW appears to use GCC 4.6 and you listed makefile which is also for GNU. Are GCC and Makefile interchangeable? Also, XCode appears to be an apple/unix thing, would it also work?

I’m not that familiar with the Windows build process but I suspect that “using MingW” to build is actually using GCC to compile the code instead of Visual Studio.

When I look at your instructions, you use MingW at the start, but then conclude with Visual Studio, but the Wiki shows the two programs as if they were part of separate build processes.( http://wiki.blender.org/index.php/Dev:Doc/Building_Blender/Windows )

MingW provides a lot of functionality. One aspect is to provide the API access. It also supplies a complete development tool-chain (compiler, linker, debugger, etc).

Are GCC and Makefile interchangeable? Also, XCode appears to be an apple/unix thing, would it also work?

In general, GCC will be driven by makefiles and the ‘make’ command. If CMake or SCons has created a set of makefiles that support GCC then that is what they use.

XCode is the OSX compiler. You have to have a Mac product to have/run XCode.

The compilers and platforms are:

  • XCode runs on Apple products
  • GCC runs on *nix platforms
  • GCC + Visual Studio run on Windows

Thank you! I finally understand what’s going on during the build process. My understanding is this:

  • MingW allows Windows to act like a NIX system.
  • CMake is a build manager that is used to control the build process.
  • GCC is used by CMake during the build process to compile the source to an exe.

If the user chooses to use Visual Studio, they just skip the MingW translation and use CMake to build the source using Visual Studio which is already native to the windows OS.