Localspace object matrix

Hello everyone,

I have a short question on localspace matrices:

Assuming I have two objects, one located at (4,4,0) and the other at (0,4,0). Now I parent make the second the first’s parent.

Reading the API documentation, I thought that getMatrix(‘localspace’) returned the object’s matrix relative to it’s parent. So the position part of this matrix should be (4,0,0) (which is the position of the child object relative to its parent). But it is not, the whole matrix seems as if it is not relative to the parent but relative to (0,0,0) in the moment of parenting. The same problem occurs when using rotation or scaling.

Does anyone know how to get the true relative transformation matrix of a parented object? (or has anyone any tipps how to compute it?)

Thank you,
Jonas

I would have expected the localspace matrix to return (4,0,0) too. Maybe you have to clear the origin (alt-o) first or something. I guess you could always subtract the worldspace matrix of the child from that of the parent to get the relative matrix.