Idea: Brain dead tutorials for code creation

General discussion about the development of the open source Blender

Moderators: jesterKing, stiv

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

Idea: Brain dead tutorials for code creation

Post by Money_YaY! » Wed May 12, 2004 9:53 pm

Among my prusuit to get more features made.

I am a wash in the code when I stare at it. Can a nice developer create some tutorials on how Blender internal works, and how one could go about make changes somewhat.

If you want more coders I guess it would be good if there were some very nice detailed tutorials here to crack open blender.

What I know of is that to make one simple feature like creating a lamp spans across not just one but several files. Like the core in SRC then some math file, then the GUI file, then others... It makes testing out a bit of code a super pain and far to much time to fiddle with building test builds.

So please I beg of you, please explain how it works in Blender, not C and C++ in general, just Blender, as Blenders method seems to be a bit different than others, which leads to some problems for others I have found.....

Theeth, if you would like to respond with a nice stab, please explain your stab a bit, instead of just stabbing :D I know you like to stab :o .

theeth
Posts: 500
Joined: Wed Oct 16, 2002 5:47 am
Location: Montreal
Contact:

Post by theeth » Wed May 12, 2004 10:03 pm

You're right, more code docs are needed. In the mean time, dropping in #blendercoders and asking code related questions works most of the time. Assuming you know at least a bit about programming of course

Martin
PS: I wouldn't say brain dead docs: it's useless to make general docs on all the program aimed at people that don't know shit about programming.
PPS: I don't stab people already on the ground. ;):P
Life is what happens to you when you're busy making other plans.
- John Lennon

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

Post by Money_YaY! » Wed May 12, 2004 10:12 pm

theeth wrote:You're right, more code docs are needed. In the mean time, dropping in #blendercoders and asking code related questions works most of the time. Assuming you know at least a bit about programming of course
I know a little... like um... well I know how to write hello world print!

No, I do know a little, mostly just tweeking numbers. and what not to delete.

theeth wrote: PS: I wouldn't say brain dead docs: it's useless to make general docs on all the program aimed at people that don't know shit about programming.
Keeping stuff just on IRC is bad, as there is nothing for someone to search in. and it tends to lead to a alot of chitchat ( which is healthy )
theeth wrote:PPS: I don't stab people already on the ground. ;):P
You like to kick and squsih them :D ^v^

theeth
Posts: 500
Joined: Wed Oct 16, 2002 5:47 am
Location: Montreal
Contact:

Post by theeth » Wed May 12, 2004 10:26 pm

Money_YaY! wrote:No, I do know a little, mostly just tweeking numbers. and what not to delete.
I bet you know copy/pasting too, which is a good part of programming (I'm only half joking here).
Money_YaY! wrote:Keeping stuff just on IRC is bad, as there is nothing for someone to search in. and it tends to lead to a alot of chitchat
Wholeheartly agreed, and the reason why I said "In the mean time". As in "As a temporary solution".

Martin
Life is what happens to you when you're busy making other plans.
- John Lennon

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

Post by Money_YaY! » Wed May 12, 2004 10:42 pm

theeth wrote: I bet you know copy/pasting too, which is a good part of programming (I'm only half joking here).
If all it took was copy and pasteing I would hav ecreated a wolrd of stuff already. But takes some much structure and multiple files to edit for just the smallest things I have learned. :( Wish it was in a clear method.

Like if the GUI was just a shell XML file with visual power to see it better.

And then each feature set was all grouped into one file like armatures, instead of being strung all abouts. Then i might have a some time and success at getting some things tested.

Well... I'm done.. any other thoughts about the idea, developers ?

SirDude
Posts: 233
Joined: Sun Oct 13, 2002 7:37 pm
Location: University of Minnesota (USA)
Contact:

Post by SirDude » Wed May 12, 2004 10:52 pm

I'm assuming you have read the stuff at:
http://www.blender3d.org/cms/Guides___S ... .87.0.html

Including the coding example?

I'm not saying we don't need more, its just that a lot of
people don't know about all of the docs we do have, so I thought I'd mention it.

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

Post by Money_YaY! » Wed May 12, 2004 10:59 pm

SirDude wrote:I'm assuming you have read the stuff at:
http://www.blender3d.org/cms/Guides___S ... .87.0.html

Including the coding example?

I'm not saying we don't need more, its just that a lot of
people don't know about all of the docs we do have, so I thought I'd mention it.
Aw I thought I had read them all. Some are old. Some are new, that is good. This split between 3d.org and .org is getting confusing.

I will read them , but are any tutorials that a developer can create in a format? Like when they are working on a feature they could post areas that could use some tweeking and stuff....

jesterKing
Site Admin
Posts: 207
Joined: Fri Oct 18, 2002 12:48 pm
Location: Finland

Post by jesterKing » Thu May 13, 2004 7:05 am

I'm currently working on a remote repository feature, of which I have a thread in the Inteface & Tools forum. Every now and then I make a movie of what I have at that point, which will hopefully give a meaningful chronicles of what I have been thinking and how I have been visualising it. Moreover, concerning the topic of this thread, I intend to document the process itself, ie. an explanation of what parts of the code I have touched and why (I found it necessary).

Hopefully this will give more insight in how to create new code within Blender.

/jesterKing

leinad13
Posts: 192
Joined: Wed Oct 16, 2002 5:35 pm

Post by leinad13 » Thu May 13, 2004 12:19 pm

I whole heartedly agree that more code documentation is needed. Have you looked at the source code, some of the files have comments about what they do, but of them just dont. I think that from now on if a feature is added the coder should be forced to comment his code fully.
-------------
Over to you boffins

L!13

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

Post by Money_YaY! » Fri May 14, 2004 1:00 am

leinad13 wrote:I whole heartedly agree that more code documentation is needed. Have you looked at the source code, some of the files have comments about what they do, but of them just dont. I think that from now on if a feature is added the coder should be forced to comment his code fully.
Heh, it all needs some sort of commenting. Like at the very least a title comment bit, that tells what the files does.

theeth
Posts: 500
Joined: Wed Oct 16, 2002 5:47 am
Location: Montreal
Contact:

Post by theeth » Fri May 14, 2004 1:19 am

Rule of thumb on file names: If you cannot guess what the file does/contains by looking at its name and location, then there's a problem either in your understanding or in the naming scheme.

Filenames like: armature.c in the /blenkernel folder or editobject.c or drawipo.c or header_view3d.c or readfile.c and so on should be pretty obvious.

Same goes for function names, though I very much agree that a good header comment with parameter descriptions is sorely needed for a majority of functions.

Martin
Life is what happens to you when you're busy making other plans.
- John Lennon

gabio
Posts: 0
Joined: Thu Jan 15, 2004 6:41 am
Location: Canada - Québec - Sherbrooke
Contact:

Post by gabio » Fri May 14, 2004 4:19 am

Though i may add a comment, I'm also trying to understand the code:
I finaly find the fonction i think i should edit and start to read... Sadly there is alwas a global fontion that i don't understand the use or a var I don't know the provenance.
Here for exemple, how does blender handle input(mouse, keyboard)? I see there is some global var like MOUSEX, QKEY or something like that to return input but is it taken from the kernel? How does operate this kernel anyway? Is it looping to refresh all feature or is the code is local executed in each window(feature). In short how does it work?

I'm still enthusiast to study such a prog....

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

Post by Money_YaY! » Fri May 14, 2004 5:23 am

theeth wrote:Rule of thumb on file names: If you cannot guess what the file does/contains by looking at its name and location, then there's a problem either in your understanding or in the naming scheme.

Filenames like: armature.c in the /blenkernel folder or editobject.c or drawipo.c or header_view3d.c or readfile.c and so on should be pretty obvious.

Same goes for function names, though I very much agree that a good header comment with parameter descriptions is sorely needed for a majority of functions.

Martin
True, and that is what I use when looking, but how do you explain ' toets.c ' what a weird name for a most commonly asked for file to be edited to create new hotkeys.

And then all of the Button files in there.

I am at least glad to hear that you see a benifit if there were better headers comments.

alien-xmp
Posts: 0
Joined: Sun Apr 06, 2003 2:22 pm
Location: Wellington, New Zealand
Contact:

Post by alien-xmp » Fri May 14, 2004 5:43 am

toets is Dutch for something. If you think it's hard now, all the comments used to be in Dutch!

The best way I've found for navigating the source is to use a decent IDE. kdevelop has this neato feature call ctags: you right click on some function, and you can jump to the source where it is defined or the header it is declared in.

Also, grep is highly useful - in kdevelop, you click on the output of grep and it jumps to the file. (grep = Find in Files for Unix.)

Lastly, the game engine has Doxygen comments. If you generate this, you get (mostly incomplete) valuable documentation. Doxygen also generates 'collaboration diagrams' - hyperlinked diagrams that show the other classes this class accesses.

jesterKing
Site Admin
Posts: 207
Joined: Fri Oct 18, 2002 12:48 pm
Location: Finland

Post by jesterKing » Fri May 14, 2004 8:06 am

toets (nl)

* key (eng)
* näppäin (fi)
* Taste (de)

/jesterKing

ps. I got tired after three translations - sorry ;)

Post Reply