[Bf-python] Bug with Object.getMatrix?
Willian Padovani Germano
wgermano at ig.com.br
Tue Apr 26 18:38:32 CEST 2005
Hi Alex,
alex mole wrote:
> Hi
>
> I've been using Object.getMatrix('localspace') to get an object's
> matrix in it's parent's space (world space if it has no parent).
> However, this sometimes gives results that disagree with what I think
> they should be. In addition, they give different results to the
> following:
>
> invpmatrix = parent.getMatrix('worldspace')
> invpmatrix.invert()
> cmatrix = child.getMatrix('worldspace')
> local_cmatrix = cmatrix * invpmatrix
>
> This, incidentally, gives me the answers I was looking for.
>
> Is this a bug, or just a badly documented routine?
Just a guess (the first thing that occurred to me after reading your
post), but past problems related to this method were mostly caused by
early or late updates of the matrix. The old method required a redraw
to get it updated (when the script changed loc, rot or size values and
did not call a redraw before calling ob.getMatrix), then Joseph fixed a
bug report changing that. Now all options are available: local, global
and old_global (old behavior, not updated).
Since you say the problem occurs "sometimes", would it be when there is
no parent (in this case we gotta see which global is being returned,
updated for the current frame or not)? If so, a test is adding a redraw
before getting the matrix, to make sure it is updated.
It'd be great to have an example that always, if possible, shows the
problem.
--
Willian
More information about the Bf-python
mailing list