I spent a lot of time trying to understand this code.
It would be nice if it could be simplified.
When a constraint is not set, the orientation is saved as "global",
but the spacemtx remains the same as the previous orientation.
Because of this, t->con.mtx is calculated based on a matrix that is
not even used!
It would be nice if t->con.mtx was not always used during Redo,
but only when a constraint really exists.
(To simplify this area I would start by removing the orient_matrix as
it is practically the same as the spacemtx
Related: rB1bfbfa28