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/editors/space_view3d/drawobject.c | |
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/editors/space_view3d/drawobject.c')
-rw-r--r-- | source/blender/editors/space_view3d/drawobject.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 660ae9da506..6b9da431510 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -117,10 +117,10 @@ void ED_draw_object_facemap(Depsgraph *depsgraph, return; } - Mesh *me = ob->data; + const Mesh *me = ob->data; { Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob); - Mesh *me_eval = BKE_object_get_evaluated_mesh(ob_eval); + const Mesh *me_eval = BKE_object_get_evaluated_mesh(ob_eval); if (me_eval != NULL) { me = me_eval; } @@ -160,7 +160,7 @@ void ED_draw_object_facemap(Depsgraph *depsgraph, const MPoly *mp; int i; if (me->runtime.looptris.array) { - MLoopTri *mlt = me->runtime.looptris.array; + const MLoopTri *mlt = me->runtime.looptris.array; for (mp = mpoly, i = 0; i < mpoly_len; i++, mp++) { if (facemap_data[i] == facemap) { for (int j = 2; j < mp->totloop; j++) { |