[Bf-committers] Bug #152 -- suggestions?

Chris Want bf-committers@blender.org
Sat, 26 Apr 2003 13:51:11 -0600


Hello,

I was assigned Bug #152 which is about the lack of
databrowse in the nla window when you have more than
30 actions, as described here:

http://projects.blender.org/tracker/index.php?func=detail&aid=152&group_id=9&atid=125

The place where this bug should get fixed is in the
function add_nlablock in source/blender/src/editnla.c.
I don't really understand the databrowse code well,
but the fix that I thought would work is by replacing
this (starting at about line 367):
-------------------------------------------------------
	/* Popup action menu */
	IDnames_to_pupstring(&str, "Add action", NULL, &G.main->action, (ID 
*)G.scene, &nr);

	event = pupmenu(str);
	
	if (event!=-1){
		for (cur = 1, act=G.main->action.first; act; act=act->id.next, cur++){
			if (cur==event){
				break;
			}
		}
	}
	
	MEM_freeN(str);
-------------------------------------------------------

with this code:

-------------------------------------------------------
	/* Popup action menu */
	IDnames_to_pupstring(&str, "Add action", NULL, &G.main->action,
						 (ID *)G.scene, &nr);

	if(strncmp(str+13, "DataBrow", 8)==0) {
		MEM_freeN(str);
		
		activate_databrowse((ID *) act, ID_AC, 0, 0, NULL, NULL );
	}
	else {
		event = pupmenu(str);
	
		if (event!=-1){
			for (cur = 1, act=G.main->action.first; act;
				 act=act->id.next, cur++){
				if (cur==event){
					break;
				}
			}
		}
	
		MEM_freeN(str);
	}
--------------------------------------------------------

... but unfortunately it doesn't work.

Can anybody with a better understanding of the databrowse
code suggest a fix?

Regards,
Chris