[Bf-python] Final Ipo/IpoCurve API revisit

Ken Hughes khughes at pacific.edu
Thu Apr 13 18:25:35 CEST 2006


OK, this is the last step prior to my Ipo update:  it's actually a 
two-part question.

antont, stivs and I discussed on IRC two weeks ago whether Ipo curves 
should be accessed by a string ("ipo['LocX']") or a constant 
("ipo[LOCX]").  The disadvantage of strings is... well, they're strings, 
while the disadvantage of constants here is where to get them from.  As 
I see it, we would have to declare constants in the Ipo module for every 
possible Ipocurve type (which as I count them is at least 160 constants) 
or have a per-Ipo attribute which provides a dict or list of just the 
constants for that Ipo type.  I already have something like this for the 
string implementation.

The real sticking point of using constants are Key/Shapo Ipos:  they do 
not have a specific name or number, and can be renamed by the user, so a 
constant would not work naturally for them.  Shape Ipos can be accessed 
through the Key API, however, and are currently broken in the Ipo API of 
2.41, so one solution would be to remove access for them thru the Ipo 
API completely.  However, using strings to access the Key Ipocurves 
would be simple to implement.

My plan, unless people think otherwise, will be to stick with the 
current string implementation.  At worst, people will not like it and 
I'll reimplement portions of the code using constants instead before the 
next release.  But if you have an opinion, please speak up soon.  I plan 
to commit to CVS sometime next week.

Ken




More information about the Bf-python mailing list