Ok, so where do I start coding in source?

Compiling, libraries, modules, coding guidelines and porting

Moderators: jesterKing, stiv

Post Reply
Money_YaY!
Posts: 442
Joined: Wed Oct 23, 2002 2:47 pm

Ok, so where do I start coding in source?

Post by Money_YaY! » Mon Jun 05, 2006 5:00 am

So, here we are I read books, I typed up tutorials from the net and my books. I studied ALOT... like errggg... to much.. I now need a starting area I can futz with in Blender..

All of the tutorials I see on the net for C are calculators and text editing tools NOthing that is like the beast that is Blender.. I can read Blenders code and know kinda where things are starting and follow functions around.. But it's to much for me mind just yet ..

With your patience can you send me to a kid gloves area I can try and claim some dazzling start ??

Maybe some tools that can come in handy when digging in the code.. I know doxy is out, so are there any tools to make graphs of classes of the code flows visually ??

stiv
Posts: 0
Joined: Tue Aug 05, 2003 7:58 am
Location: 45N 86W

Post by stiv » Mon Jun 05, 2006 9:08 am

Go fix some bugs. It may not be as glamorous as totally rewriting blender, but it is the way most people start out.

And make sure you understand pointers.

Money_YaY!
Posts: 442
Joined: Wed Oct 23, 2002 2:47 pm

Post by Money_YaY! » Tue Jun 06, 2006 1:31 pm

,, Ok, but do you have one to suggest ? they all kind of get confusing with out a starting point

stiv
Posts: 0
Joined: Tue Aug 05, 2003 7:58 am
Location: 45N 86W

Post by stiv » Tue Jun 06, 2006 6:20 pm

Money_YaY! wrote:,, Ok, but do you have one to suggest ? they all kind of get confusing with out a starting point
Pointers to integers ( int* ) are both common and quite useful. Once you get those, the others all fall into place.

Oh, did you mean bugs? Pick an area you are interested in. Pick a bug that 'looks' easy. You *will* have to do some research at first to understand both the code and the problem.

Use cscope or similar to find things in the code. People will help you if you ask specific, meaningful questions. Questions like "where is BLAH defined?" will only earn you well deserved scorn.

LetterRip
Posts: 0
Joined: Thu Mar 25, 2004 7:03 am

Post by LetterRip » Wed Jun 07, 2006 2:52 am

stivs,

few of the bugs are of the type an amature can fix category. Personally I'd find a small wishlist item. There are a few places to find wishlist items people have

1) the blender.org forum especially the tools section
2) blenderartists.org
3) The wishlist of the plumiferos project, the opengl printing and the adding of additional nodes look like easy projects - there is a tutorial on adding nodes at the wiki http://www.plumiferos.com/wiki/index.ph ... reTimeline
4) the wishlist at the wiki, and the wishlist at blender.org (not sure where those pages are located)

Here is a post I did at blender.org that might be useful, there is additional advice at the developer section of the wiki

http://blenderartists.org/forum/showthr ... 543&page=2

here is the meat of the post



General method is

1) Think of something you want to code
2) look is space.c for the keybinding of the command to a similar function or function area
3) grep or CScope or other source browsing method fro the code for that function (usually it will be in a file in /source/blender/src )
4) get an overview of existing code in that file
5) If you see variables you don't know/understand use CScope or other source browsing tool to find its original declaration (the main headers of interest are in

source\blender\makesdna

and

source\blender\blenkernel

if you find something you don't understand pop into IRC (irc.freenode.net) on #blendercoders

6) code your new idea
7) create a patch and ask someone to test it/and or make testing builds and post them in the testing builds forum and blender.org
8) submit patch to tracker and email bf-committers mentioning the patch and what it does
9) stop by Sunday meeting on irc and bug people to look at it if it hasn't been applied yet or ask for feedback.

LetterRip

stiv
Posts: 0
Joined: Tue Aug 05, 2003 7:58 am
Location: 45N 86W

Post by stiv » Wed Jun 07, 2006 4:55 am

few of the bugs are of the type an amature can fix category. Personally I'd find a small wishlist item.
True, the bug list is at low tide right at the moment due to the pending release which means the amateur-level ones have been fixed. However, you need to consider who the target audience is here. I have little confidence trip can design and code up a new feature on his own. Maintenance and bug-fixing is a better way to get started.

Money_YaY!
Posts: 442
Joined: Wed Oct 23, 2002 2:47 pm

Post by Money_YaY! » Wed Jun 07, 2006 7:48 pm

I've been reading Ruby ! But thats beside the point

As I read Blender source... I know there are some basic patterens going on.. So I don't follow crazy loops on thought.. Can you tell me of any design patterens that might be common place in Blender I should know of ?

stiv
Posts: 0
Joined: Tue Aug 05, 2003 7:58 am
Location: 45N 86W

Post by stiv » Thu Jun 08, 2006 1:33 am

pointers
for loops
linked lists
callbacks

If you are thinking Gang of Four design patterns, most of those are higher level abstractions more suited for Object Oriented programming styles.

Better to think about the data structures being manipulated. Like someone said, data structures + algorithms = programs.

epat
Posts: 0
Joined: Mon Feb 20, 2006 11:43 pm

Post by epat » Tue Jun 13, 2006 9:32 pm

Being a begginner at coding blender myself I would say that nodes are a great place to start - I personally have coded one or two (useless) nodes into my copy of blender and it wasn't too hard, the hard part's getting it to compile afterwards! :P - epat
'Regret for wasted time is more wasted time.'
- Mason Cooley

Post Reply