[Bf-committers] Changing mul_m4_m4m4 argument order

Sergey Sharybin sergey.vfx at gmail.com
Thu Dec 15 22:39:31 CET 2011


Hi,

Argument order is indeed confusing. I've spend two hours debugging deep
tracking stuff and then learned in which order i shall pass matrices in
constraint which i used to check it tracking is correct.

I can think about such quite safe for branches solution:
- Create script which swaps arguments in mul_m*_m*m* functions and renames
them to, say the save with suffix '_r' (from "reversed") or prefix "x"
(like 64bit prefix for registers :)
- Make changes in trunk and publish script
- Give two weeks to everybody to merge changes and run that script for
their own code
- after this two weeks remove old mul functions are rename new function to
old name

Not very straight, but should be safe for everybody.

Can think about ways which doesn't require temporary function, but think
way with temporary functions is more safe.

On Thu, Dec 15, 2011 at 8:51 PM, Brecht Van Lommel <
brechtvanlommel at pandora.be> wrote:

> Hi,
>
> The argument order of the mul_m4_m4m4 C math function is inconsistent
> with the others. This has always been the case, but I only recently
> found this out, it explains quite a bit of confusion I've had in the
> past working with matrices. Python is not affected by this.
>
> For the details, see here:
>
> http://wiki.blender.org/index.php/Dev:Source/Mathematics/Math_Library#Matrix-Matrix_Multiplication
>
> It's easy to fix this in trunk, the main issue is for branches, just
> changing the order of arguments to mul_m4_m4m4 will not show up as
> conflicts in merges. A solution would be to change the function to a
> different name. Do you think this is needed, and does anyone have a
> good suggestion for a different name? I guess that would also cause
> some confusion, but hopefully much less.
>
> Thanks,
> Brecht.
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers
>



-- 
With best regards, Sergey Sharybin


More information about the Bf-committers mailing list