[Bf-committers] Re: [Bf-blender-cvs] CVS commit: blender/source/blender/blenkernel/intern library.c

Campbell Barton cbarton at metavr.com
Mon Mar 26 16:06:42 CEST 2007


I had a look at why images differed from others data - all libblocks are 
sorted except for images (probably sounds and fonts too)

Found the problem is here

int new_id(ListBase *lb, ID *id, const char *tname)
/* only for local blocks: external en indirect blocks already have a 
unique ID */
/* return 1: created a new name */
{
	int result;
	
	if(lb==NULL) lb= wich_libbase(G.main, GS(id->name));
	
	result = dup_id( lb, id, tname );
	if( result )
		sort_alpha_id(lb, id);	
	return result;
}

if result from dup_id( lb, id, tname ); is 0 then the new ID isnt 
sorted, which means loading a new image wont sort the image in most 
cases since the image wont collide with other names (providing its not 
already loaded).

we should probably do sort_alpha_id(lb, id) every time rather then only 
on naming collisions.



Ton Roosendaal wrote:
> ton (Ton Roosendaal) 2007/03/26 15:02:43 CEST
> 
>   Modified files:
>     blender/source/blender/blenkernel/intern library.c 
>   
>   Log:
>   Bugfix: function new_id() was allowed to be called with NULL.
>   Caused by Ken Hughes commit of 5 days ago
>   
>   Note; dup_id() will go away, is not according to Blender spec.
>   
>   Revision  Changes    Path
>   1.30      +7 -4      blender/source/blender/blenkernel/intern/library.c
>     <http://projects.blender.org/viewcvs/viewcvs.cgi/blender/source/blender/blenkernel/intern/library.c.diff?r1=1.29&r2=1.30&cvsroot=bf-blender>
> _______________________________________________
> Bf-blender-cvs mailing list
> Bf-blender-cvs at projects.blender.org
> http://projects.blender.org/mailman/listinfo/bf-blender-cvs
> 


-- 
See MetaVR Visuals Used at the Combat Studies Institute
http://www.metavr.com/casestudies/baghdadviews.html

Campbell J Barton

133 Hope Street
Geelong West, Victoria 3218 Australia

URL:    http://www.metavr.com
e-mail: cbarton at metavr.com
phone: AU (03) 5229 0241


More information about the Bf-committers mailing list