Problem : Blender updates some matrices when I change one of them (always these side effects of the API…)
and the four matrices of the object end up being matrices different from w,p,l,b.
So my question: how to assign exactly the matrices, without blender coming into the play ?
There is something unclear here. There are four matrices. When two matrices are chosen, the two remaining ones are determined by the chosen matrices (except when the chosen matrices are world and local, let me skip the math details here).
When I change just one matrix, blender stars to compute things. This is unnatural, because we don’t know which pair has to be kept at this point. It seems that it keeps the changed matrix (this is OK) and I was not able to figure out the algorithm for the three remaining ones.
This arbitrary undocumented choices of Blender makes the situation difficult to control. Suppose I have two changes, let’s call them change1 and change2. Suppose that each change assigns one matrix among the four. After change1, blender does some work, And after change2, blender does again some work. Sometimes after change2, Blender changes the matrix that I have carefully chosen with change1.
Even when I try to assign only one matrix, nameley the matrix matrix_world i have problems : the childs are not updated after the execution of sce.update(). And If I start with a non updated situation, the situation is worse. The matrices are changed by Blender following an ordre which appears completly random to me. I cannot even guarantee that Blender keeps the matrix that I assigned if I do just one change.
Maybe a better solution would be to convert these matrices to a euler or quaternion representation, and thus save yourself from all that trouble about the matrices?
Yes, Bayesian, I am more or less convinced that there is no solution with matrices. What do you suggest if I know the quaternions/translation for the operation. Using bpy.ops ? Is it the best solution ?