[Bf-python] Final Ipo/IpoCurve API revisit

Ken Hughes khughes at pacific.edu
Tue Apr 18 16:52:14 CEST 2006


Toni Alatalo wrote:
> On Sunday 16 April 2006 21:25, Ken Hughes wrote:
> 
>>I'll update the wiki with this info also, but thought I'd poke
>>interested parties here (link follows):
> 
> thanks for making the page, felt helpful in getting back to this, even tho i 
> read the emails first .. commented a bit there in what seemed like a 
> problematic (well, only as in 'not-so-nice') part to me: (copy-paste follows)
> 
> ipo[Ipo.MA_R] = BezTriple((0,0,0))
> 
> especially the fact that Ipo[MA_R] won't be a BezTriple instance, even though 
> it seemed that one was assigned there (i understand the logic .. adding a 
> control point i.e. a beztriple creates a curve and puts they key there, but 
> it does not change the fact that such an api is weird). Are there 
> alternatives? Perhaps being able to just assign values, to not have to know 
> that awkward class name? ipo[channel] = (timeframe, value) ?

Actually, that is a remnant of earlier code, when the icu [] index 
operator accessed BezTriple data.  Changing it to (time,value) would 
make more sense.

>>I've run into some issues of practicality and efficiency implementing a
>>per-Ipo list/dict of curve constants.  It could be that I don't
>>understand a better way to do efficiently.  Hints and tips welcome.
> 
> sorry, i have no clue off-hand about that.

As indicated on the wiki, I've gone with using PyConstants for the 
per-Ipo attribute.  In the process, I've extended PyConstants to 
implement some previously implemented methods which were inaccessable -- 
items, keys, and values -- so it's possible to easily get the complete 
set of curve names during program execution.

Ken



More information about the Bf-python mailing list