[Bf-committers] python mathutils api update proposal

Campbell Barton ideasman42 at gmail.com
Sat Feb 5 11:06:42 CET 2011


On Fri, Feb 4, 2011 at 2:25 AM, Martin Poirier <theeth at yahoo.com> wrote:
>
>
> --- On Thu, 2/3/11, Campbell Barton <ideasman42 at gmail.com> wrote:
>
>> As Alex suggests, keywords only args could be used in this
>> case:
>> Euler(x, y, x, order='XZY')
>> I don't see this as especially better or worse, just
>> different, but I'm also not interested to change.
>
> order is an optional argument with default value 'XYZ'. Optional arguments are often specified by name, so it would fit. Not a strong preference, but a small one from me. (I'm not too fussed with either however).
>
> Martin

Today I finished off the changes for the proposal, for script writers,
I did a search replace on scripts in svn:
here are the replacements you may find handy when updating scripts.
        l = l.replace("rotation_part()", "to_3x3()")
        l = l.replace("scale_part()", "to_scale()")
        l = l.replace("translation_part()", "to_translation()")
        l = l.replace("to_quat()", "to_quaternion()")
        l = l.replace("copy().resize4x4()", "to_4x4()")
        l = l.replace("resize4x4()", "resize_4x4()")
        l = l.replace(".copy().resize2D()", ".to_2d()")
        l = l.replace(".copy().resize3D()", ".to_3d()")
        l = l.replace(".copy().resize4D()", ".to_4d()")
        l = l.replace("resize2D()", "resize_2d()")
        l = l.replace("resize3D()", "resize_3d()")
        l = l.replace("resize4D()", "resize_4d()")
        l = l.replace(".copy().invert()", ".inverted()")
        l = l.replace(".copy().transpose()", ".transposed()")

@Tom Edwards.
Just committed rotate() methods for Euler/Quaternion/Vector/Matrix types.
These take a single argument which can be any mathutils type that
contains rotation: Euler/Quaternion/Matrix

-- 
- Campbell


More information about the Bf-committers mailing list