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

Ken Hughes khughes at pacific.edu
Mon Mar 26 16:18:30 CEST 2007


The purpose for dup_id is to determine if there *is* a name collision 
that will cause the datablock to be renamed.  However, it isn't actually 
supposed to be called from Python with the new ID in the libblock;  if 
that's being done, then yes it's a bug.

I'll check this later; but again, the point is Python side needs a way 
to know what the datablock will be called after it's inserted into the 
libblock.

Ken

Campbell Barton wrote:
> 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
>>
> 
> 



More information about the Bf-committers mailing list