Before the question a bit of a background...
I have a mesh, and vertex groups as well for it's bones. Before placing the bones, I moved the vertices of the mesh, so every
vertex.co += m.translation, where m was a matrix containing a starting position for each bone. Because Blender is handling bones different then the system I was working on before, I had to do a conversion: while I have points in old system, Blender has "sticks" (what are described with two points: with a head and a tail). I was able to create an armature good enough just by telling Blender that a bone's head is the parent's tail, etc. There was no rotation applied on starting position. The stuff seemed to be fine: I even verified the result in Ultimate Unwrap 3D Pro, and seemed to be all right. So far it was too easy. Then it came for animations...
I had to do a bit research: made a primitive mesh and armature with a script and started to learn how Blender handles the bones and animations. I learned, that I can use a
.matrix to rotate, and scale the bone relative to the parent. Using translation led to no good, since the bones are connected and so the parent's tail is the inherited's head, so if I would want translation I had to set length of the bone. In my old system everything was different, not just handling the bones. No head or tail, just matrices, so when I say a bone is in
m then all the vertices are to be multiplied with it.
m is not relative to parent, but the object.
So my question is the conversion... let's see only one bone in pose mode.
I have two matrices in my old system
m1 is parent. I can make a bone in Blender system called
b with a
m2 contain translation, rotation and scaling. In Blender I think it is like
b.head = m1.translation and I am to point the bone to
m2.translation, but with
m1. rotation and scaling data, but ignoring
m2. translation and scaling, because that is the inherited bone's property. My guess is that I am to modify the rotation value with
m2.translation value somehow, but I do not know how.
I am not good enough in BPY yet and Math ever, that is why I would like to ask for help with this.