[Bf-python] object.getMatrix(): changing default behavior

Willian Padovani Germano wgermano at ig.com.br
Wed Oct 20 07:08:24 CEST 2004


Hi,

Quick bg info (confusing, I know):

object.getMatrix() was changed to fix a reported bug, but the fix 
introduced instead a 'localspace' matrix.  The bug was that changes made 
during the script were not reflected in the matrix until a redraw 
happened, forced or when the script exited.

Then Campbell saw that the matrix returned local values and added a 
parameter to retrieve the one with parenting, etc. info included, the 
'worldspace' matrix.  And a script that used to work but failed for 2.34 
made me re-add the old behavior, but wrongly called 'old_local'.  
Reading a thread on blender.org's Python forum, I saw a post by eeshlo 
stating that the pre-2.34 actually returned 'worldspace' data, so I took 
a better look at the code and confirmed it.  Talking to Theeth this 
Sunday, it was decided that:

obj.getMatrix() will default to 'worldspace' as it was meant to and also 
accepts 'localspace' and 'old_worldspace' (pre 2.34 behavior) as 
alternative parameter values.  I already committed the changes, changing 
default and changing the string 'old_local' to 'old_worldspace'.

On another note, as Stephen pointed, there's no need to use both 
set/getCurrent and get/make/setActive, so I changed Sound and World to 
use set/getCurrent, the older naming convention.  In World I left the 
**Active ones as aliases, we can remove with other leftovers later, as 
part of the clean up.

-- 
Willian




More information about the Bf-python mailing list