Refactor: Rename Object->obmat to Object->object_to_world

Motivation is to disambiguate on the naming level what the matrix
actually means. It is very easy to understand the meaning backwards,
especially since in Python the name goes the opposite way (it is
called `world_matrix` in the Python API).

It is important to disambiguate the naming without making developers
to look into the comment in the header file (which is also not super
clear either). Additionally, more clear naming facilitates the unit
verification (or, in this case, space validation) when reading an
expression.

This patch calls the matrix `object_to_world` which makes it clear
from the local code what is it exactly going on. This is only done
on DNA level, and a lot of local variables still follow the old
naming.

A DNA rename is setup in a way that there is no change on the file
level, so there should be no regressions at all.

The possibility is to add `_matrix` or `_mat` suffix to the name
to make it explicit that it is a matrix. Although, not sure if it
really helps the readability, or is it something redundant.

Differential Revision: https://developer.blender.org/D16328
This commit is contained in:
2022-10-24 14:16:37 +02:00
parent 8b2b5b0b83
commit f17fbf8065
246 changed files with 1175 additions and 1133 deletions

View File

@@ -338,13 +338,13 @@ static void deformVerts_do(HookModifierData *hmd,
/* get world-space matrix of target, corrected for the space the verts are in */
if (hmd->subtarget[0] && pchan) {
/* bone target if there's a matching pose-channel */
mul_m4_m4m4(dmat, ob_target->obmat, pchan->pose_mat);
mul_m4_m4m4(dmat, ob_target->object_to_world, pchan->pose_mat);
}
else {
/* just object target */
copy_m4_m4(dmat, ob_target->obmat);
copy_m4_m4(dmat, ob_target->object_to_world);
}
invert_m4_m4(ob->imat, ob->obmat);
invert_m4_m4(ob->imat, ob->object_to_world);
mul_m4_series(hd.mat, ob->imat, dmat, hmd->parentinv);
/* --- done with 'hd' init --- */