I’m currently working on a custom export script for blender 2.5 projects. But I have troubles with parent child relations. As far as I understood, every object has it’s local space. this space remains intact when adding to a parent. So when setting the child’s coordinates to (0,0,0) doesn’t necessarily mean it’s at the parents origin, but at the childs space origin, that is relative to the parent. That makes sense.
But how do I retrieve the local offset with python? there is object.matrix.location_part() but that returns the absolute coordinates. (parent local space + child local space)
I hope you understand what I mean. Hard to explain…
Right after posting I got a little closer to the solution. By substracting the parent matrix from the child matrix, I get the local offset. (parent.matrix-child.matrix) I’ll try that.
[EDIT]
This works for offset, but not for the scale, a scale of 1 is 0 afterwards, which is mathematically correct but not as easy to use.
Although nobody seems to be really interested in this topic, I post my solution here. I had to extend the above script, now it works for animation as well. You can download it at http://www.underdoeg.com