[Bf-python] Bug and Fix in tracker for Armature.NLA

Ken Hughes khughes at pacific.edu
Thu May 4 17:59:15 CEST 2006


Stephen Swaney wrote:
> On Thu, May 04, 2006 at 09:21:37AM -0400, Roland Hess wrote:
> 
>>Armature.NLA.setName("foo") didn't check if "foo" already existed.  
>>You could end up with eight actions all named "foo".
>>
>>Patch just reuses the name-check/increment code found elsewhere in  
>>the API.
>>
>>http://projects.blender.org/tracker/? 
>>func=detail&aid=4171&group_id=9&atid=125
> 
> I have a problem with this in that if there is a name collision, it
> changes the name from what was asked for but does not inform the
> caller in any way.  The script now has no idea what the new name is or
> that there is one.

But it's not hard to find out the resulting name:

   arm.name = 'this'
   name = arm.name

We proabably just need to document this "behavior".

Same thing (name collision and renaming) happens elsewhere now.  Calling 
Object.New() with a duplicate name returns a unique name, but doesn't 
inform the user either.

> Note: I am guessing here, but I think the original design rationale
> was that the scripter knew what they were doing and at the end of
> the name updates everything would be lovely.  This assumption may
> be debatable!

Note: the sets "design rationale" and "rational scripters" may nave a 
small or even empty intersection :-)

Ken



More information about the Bf-python mailing list