[Bf-committers] IPO curve attribute array issues
Ton Roosendaal
ton at blender.org
Sat Jul 9 17:27:18 CEST 2005
Hi,
Yes that's weird... I also notice the code as added here (Nathan did a
while ago) uses the indices wrong. This whole naming code he added
needs to be redone... it's dangerous.
The defines AC_LOC_X etc were choosen for ipo channels to be sure new
added channels (or changed ones) don't have to use fixed sequential
numbers. But then you also can't use it like getname_ac_ei() does
now... it should use the actual index (0 - AC_TOTIPO).
Have to put this on my long long list...
BTW; your patch is wrong, it should not alter the order of the ac_ar[]
but of the naming array...
-Ton-
On 8 Jul, 2005, at 18:19, Ken Hughes wrote:
> While working on BPython IPO modules, I discovered that order of
> entries in the name arrays and value arrays used to represent IPO
> curve are not consistent. For example:
>
> from source/blender/src/editipo.c:
> char *ac_ic_names[AC_TOTNAM] = {
> "LocX", "LocY", "LocZ",
> "SizeX", "SizeY", "SizeZ",
> "QuatW", "QuatX", "QuatY", "QuatZ"};
>
> from source/blender/blenkernel/intern/ipo.c
> int ac_ar[AC_TOTIPO]= {
> AC_LOC_X, AC_LOC_Y, AC_LOC_Z,
> AC_QUAT_W, AC_QUAT_X, AC_QUAT_Y, AC_QUAT_Z,
> AC_SIZE_X, AC_SIZE_Y, AC_SIZE_Z};
>
> I've found two other instances of this as well.
>
> It would be nice (for my code) if ac_ar[index] and
> ac_ic_names[index] referred to the same item. Furthermore, I think
> this change would make it eathis could clean up some code elsewhere
> in editipo.c. For example
>
> name = getname_ob_ei(ob_ar[a], colipo);
> strcpy(ei->name, name);
>
> could be replaced with
> strcpy (ei->name, ob_ic_names[a] );
>
> Also seems like it would be a good idea to put both of these arrays
> in the same file.
>
> Should I code a patch for this? Or is there some underlying thing
> I'm not seeing?
>
> Ken
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at projects.blender.org
> http://projects.blender.org/mailman/listinfo/bf-committers
>
>
------------------------------------------------------------------------
--
Ton Roosendaal Blender Foundation ton at blender.org
http://www.blender.org
More information about the Bf-committers
mailing list