diff options
author | Hans Goudey <h.goudey@me.com> | 2021-07-02 07:03:09 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-07-02 07:03:27 +0300 |
commit | 9f5c0ffb5ec293af2e4f003c2178d21e20805b47 (patch) | |
tree | eb5b5c98fae3402da6ad98472ad5f5ea1cfbacd0 /source/blender/blenkernel/intern/object_dupli.cc | |
parent | 016a2707f573efe113f89ced1870912de19a16a1 (diff) |
Cleanup: Use const variables for object's evaluated mesh
Generally the evaluated mesh should not be changed, since that is the
job of the modifier stack. Current code is far from const correct in
that regard. This commit uses a const variable for the reult of
`BKE_object_get_evaluated_mesh` in some cases. The most common
remaining case is retrieving a BVH tree from the mesh.
Diffstat (limited to 'source/blender/blenkernel/intern/object_dupli.cc')
-rw-r--r-- | source/blender/blenkernel/intern/object_dupli.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/object_dupli.cc b/source/blender/blenkernel/intern/object_dupli.cc index 768fa9373c1..77969328365 100644 --- a/source/blender/blenkernel/intern/object_dupli.cc +++ b/source/blender/blenkernel/intern/object_dupli.cc @@ -335,14 +335,14 @@ static void make_child_duplis(const DupliContext *ctx, /** \name Internal Data Access Utilities * \{ */ -static Mesh *mesh_data_from_duplicator_object(Object *ob, - BMEditMesh **r_em, - const float (**r_vert_coords)[3], - const float (**r_vert_normals)[3]) +static const Mesh *mesh_data_from_duplicator_object(Object *ob, + BMEditMesh **r_em, + const float (**r_vert_coords)[3], + const float (**r_vert_normals)[3]) { /* Gather mesh info. */ BMEditMesh *em = BKE_editmesh_from_object(ob); - Mesh *me_eval; + const Mesh *me_eval; *r_em = nullptr; *r_vert_coords = nullptr; @@ -603,7 +603,7 @@ static void make_duplis_verts(const DupliContext *ctx) BMEditMesh *em = nullptr; const float(*vert_coords)[3] = nullptr; const float(*vert_normals)[3] = nullptr; - Mesh *me_eval = mesh_data_from_duplicator_object( + const Mesh *me_eval = mesh_data_from_duplicator_object( parent, &em, &vert_coords, use_rotation ? &vert_normals : nullptr); if (em == nullptr && me_eval == nullptr) { return; @@ -1151,7 +1151,7 @@ static void make_duplis_faces(const DupliContext *ctx) /* Gather mesh info. */ BMEditMesh *em = nullptr; const float(*vert_coords)[3] = nullptr; - Mesh *me_eval = mesh_data_from_duplicator_object(parent, &em, &vert_coords, nullptr); + const Mesh *me_eval = mesh_data_from_duplicator_object(parent, &em, &vert_coords, nullptr); if (em == nullptr && me_eval == nullptr) { return; } |