February 2012
M T W T F S S
« Jul «-»  
 12345
6789101112
13141516171819
20212223242526
272829  

Leaving Chris World?

Why not bring back a souvenir?

Archives

Blender 2.5 Hack Demo

welcome

It was but a day ago when I managed to compile blender 2.5 code (now trunk)
into a working app that does in fact run on my macbook. I'm delighted that blender has finally returned to my workflow.

codechange

To celebreate I hopped back onto the blender irc #blendercoders and
was chatting while browsing source code. I was also watching GREEK. And wondering if it was
that guy from Freaks and Geeks. (the same show I was watching while writing
code to modify sound files in python)

Anyway, my little hack change was to demonstrate that I could mess with blender
once again. And I'm excited about all the changes that have taken place in
blender 2.5 code. The code is actually organized into nice folders! And the
keymap and operator code make it easier to tell

Blender now has a nice straightforward run cycle.

 
void WM_main(bContext *C)
{
	while(1) {
 
		/* get events from ghost, handle window events, add to window queues */
		wm_window_process_events(C); 
 
		/* per window, all events to the window, screen, area and region handlers */
		wm_event_do_handlers(C);
 
		/* events have left notes about changes, we handle and cache it */
		wm_event_do_notifiers(C);
 
		/* execute cached changes draw */
		wm_draw_update(C);
	}
}
 

There's all this talk about how it will have customized keymaps.
I've found this code that occurs here and there and shows how
operators are described and then point to proper api functions in
which to run.

 
void script_operatortypes(void)
{
	WM_operatortype_append(SCRIPT_OT_python_file_run);
	WM_operatortype_append(SCRIPT_OT_python_run_ui_scripts);
}
 
void script_keymap(wmWindowManager *wm)
{
	wmKeyMap *keymap= WM_keymap_find(wm, "Script", SPACE_SCRIPT, 0);
 
	/* TODO - this is just while we have no way to load a text datablock */
	RNA_string_set(WM_keymap_add_item(keymap, "SCRIPT_OT_python_file_run", PKEY, KM_PRESS, KM_CTRL|KM_SHIFT|KM_ALT, 0)->ptr, "path", "test.py");
	WM_keymap_add_item(keymap, "SCRIPT_OT_python_run_ui_scripts", PKEY, KM_PRESS, KM_SHIFT, 0);
}
 

It's all fantastic. And well worth a video.

1 comment to Blender 2.5 Hack Demo

  • Thank you for reminding me about the new version. I had completely forgot about it… I love the changes in the gui although I don’t know much about how the code is written.

You must be logged in to post a comment.