[Bf-committers] [Bf-blender-cvs] SVN commit: /data/svn/bf-blender [26239] trunk/blender: Mathutils refactor & include in sphinx generated docs, (TODO, include getset'ers in docs)

Campbell Barton ideasman42 at gmail.com
Fri Feb 5 01:29:17 CET 2010


Hey Bjornmose, dont think this is likely to happen again in the near
future but some parts of the api didnt get enough time to be
refactored until recently.

eg.
- some Mathutils funcs needed to be moved to Geometry because Geometry
module was added after so existing funcs like tri-normal didnt get
moved there.
- Blender2.5 will attempt pep8 compliant names, rna also follows, so
renaming some Mathutils funcs makes sens in the long term also
(scale_part over scalePart)
- Python is supposed to be using all radians but a number of places
still need this change made.

The only change I can see in the short term for Mathutils is Euler
needs to support orders other then XYZ, but adding this wont break
existing scripts.

So while Im not going out of my way to break things, I think its worth
trying to `get it right` now at the expense of breaking some existing
scripts.

I also dont use tricky text editors, but I have attempted to have the
console in blender 2.5 have an auto-complete our API's, thanks to
Stani for his auto-complete module.
Its useful for quickly looking into modules and blender data api's.

On Fri, Feb 5, 2010 at 1:07 AM, bjornmose <bjornmose at gmx.net> wrote:
> Hi Campbell,
> would have not been voicing up,
> if  this was happening on porting old (2.4x) scripts.
> But I stumbled over that issue while running a brand new
> (still in development) to be released  2.5 script,
> which stopped working  from one day to the other.
> So,  while I did expect things broken porting 2.4x to 2.5,
> I did not on  running  2.5  scripts with a fresh SVN version.
> BM
>
> p.s.  consider  some of us old farts like to use the editor of their
> choice -> not having auto magic avail :)
>
>
>
> Campbell Barton schrieb:
>> Hi Bjornmose,
>> Mathutils is one of the few modules which remains mostly the same in
>> 2.5x, since most of the other apis around it are now accessed as rna
>> most scripts from 2.4x need a fair bit of porting anyway.
>>
>> In the console did you try auto-complete yet.
>>
>>
>>>>> mat = Mathutils.Matrix()
>>>>>
>> col_size  copy(  determinant(  identity(  invert(  is_negative
>> is_wrapped  median_scale  resize4x4(  rotation_part(  row_size
>> scale_part(  to_euler(  to_quat(  translation_part(  transpose(  zero(
>> mat.
>>
>> If we are to have some error, I'd add an exception on scalePart that
>> points to scale_part, but I think when porting scripts from 2.4x this
>> is only one of many issues.
>> Not to say its unimportant but if you port a script I think youll need
>> to keep the api reference handy.
>>
>> The new Mathutils docs can be found from blender in 3 steps.
>> Help (Menu) -> Python API Reference -> Math Types & Utilities (Mathutils)
>>
>> Id prefer to have a wiki page with info about porting 2.4x scripts
>> then deprecating functions and keeping them around.
>>
>> On Thu, Feb 4, 2010 at 2:05 AM, bjornmose <bjornmose at gmx.net> wrote:
>>
>>> bjornmose schrieb:
>>>
>>>> Hi, all ..
>>>> was trapped by this .. - Matrix.scalePart --> Matrix.scale_part ..
>>>> getting a
>>>> ' matrix' object has no attribute  'scalepart' ..
>>>>
>>>> It was pretty obvious there must have been some changes in the python
>>>> interface ..
>>>> so, I did find my way, using some popular search engines ..
>>>> How ever,
>>>> I'd rather  see those deprecated python function calls to respond
>>>> something like:
>>>> ' - Matrix.scalePart  has been replaced
>>>>   by Matrix.scale_part
>>>> '
>>>> on the console
>>>> rather than 'dunno what u want'
>>>> me 2 cents
>>>> BM
>>>>
>>>>
>>>>
>>> and as it looks like :
>>> there is no backward/forward compatibility  to old  .blend  files ..
>>> (containing python scripts )  which was a ++ for blender for quite a
>>> while :)
>>> (admit some flakes from going 2.4x to 2.5 ) but in 2.5, i think we
>>> should stick to it.
>>> BM
>>> _______________________________________________
>>> Bf-committers mailing list
>>> Bf-committers at blender.org
>>> http://lists.blender.org/mailman/listinfo/bf-committers
>>>
>>>
>>
>>
>>
>>
>
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers
>



-- 
- Campbell


More information about the Bf-committers mailing list