diff options
author | Sergey Sharybin <sergey@blender.org> | 2022-10-24 15:16:37 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey@blender.org> | 2022-11-01 12:48:18 +0300 |
commit | f17fbf80653dc0e1561b30fe03f46e354deb12bf (patch) | |
tree | 46003d781a1b9ca0272112a9a9c2cdf45482d640 /source/blender/editors/curves | |
parent | 8b2b5b0b8384c95d92da41297b1a950e729cd782 (diff) |
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
Diffstat (limited to 'source/blender/editors/curves')
-rw-r--r-- | source/blender/editors/curves/intern/curves_ops.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/editors/curves/intern/curves_ops.cc b/source/blender/editors/curves/intern/curves_ops.cc index 38b2b2071b8..1d2b1264477 100644 --- a/source/blender/editors/curves/intern/curves_ops.cc +++ b/source/blender/editors/curves/intern/curves_ops.cc @@ -435,7 +435,7 @@ static bke::CurvesGeometry particles_to_curves(Object &object, ParticleSystem &p bke::CurvesGeometry curves(points_num, curves_num); curves.offsets_for_write().copy_from(curve_offsets); - const float4x4 object_to_world_mat = object.obmat; + const float4x4 object_to_world_mat = object.object_to_world; const float4x4 world_to_object_mat = object_to_world_mat.inverted(); MutableSpan<float3> positions = curves.positions_for_write(); @@ -497,7 +497,7 @@ static int curves_convert_from_particle_system_exec(bContext *C, wmOperator * /* Object *ob_new = BKE_object_add(&bmain, &scene, &view_layer, OB_CURVES, psys_eval->name); Curves *curves_id = static_cast<Curves *>(ob_new->data); - BKE_object_apply_mat4(ob_new, ob_from_orig->obmat, true, false); + BKE_object_apply_mat4(ob_new, ob_from_orig->object_to_world, true, false); bke::CurvesGeometry::wrap(curves_id->geometry) = particles_to_curves(*ob_from_eval, *psys_eval); DEG_relations_tag_update(&bmain); |