Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenkernel/intern/crazyspace.cc')
-rw-r--r--source/blender/blenkernel/intern/crazyspace.cc25
1 files changed, 14 insertions, 11 deletions
diff --git a/source/blender/blenkernel/intern/crazyspace.cc b/source/blender/blenkernel/intern/crazyspace.cc
index fdd269bd9c8..17fb9fdb03e 100644
--- a/source/blender/blenkernel/intern/crazyspace.cc
+++ b/source/blender/blenkernel/intern/crazyspace.cc
@@ -182,19 +182,22 @@ void BKE_crazyspace_set_quats_mesh(Mesh *me,
float (*mappedcos)[3],
float (*quats)[4])
{
+ using namespace blender;
+ using namespace blender::bke;
BLI_bitmap *vert_tag = BLI_BITMAP_NEW(me->totvert, __func__);
/* first store two sets of tangent vectors in vertices, we derive it just from the face-edges */
- MVert *mvert = me->mvert;
- MPoly *mp = me->mpoly;
- MLoop *mloop = me->mloop;
+ const Span<MVert> verts = me->vertices();
+ const Span<MPoly> polys = me->polygons();
+ const Span<MLoop> loops = me->loops();
- for (int i = 0; i < me->totpoly; i++, mp++) {
- MLoop *ml_next = &mloop[mp->loopstart];
- MLoop *ml_curr = &ml_next[mp->totloop - 1];
- MLoop *ml_prev = &ml_next[mp->totloop - 2];
+ for (int i = 0; i < me->totpoly; i++) {
+ const MPoly *poly = &polys[i];
+ const MLoop *ml_next = &loops[poly->loopstart];
+ const MLoop *ml_curr = &ml_next[poly->totloop - 1];
+ const MLoop *ml_prev = &ml_next[poly->totloop - 2];
- for (int j = 0; j < mp->totloop; j++) {
+ for (int j = 0; j < poly->totloop; j++) {
if (!BLI_BITMAP_TEST(vert_tag, ml_curr->v)) {
const float *co_prev, *co_curr, *co_next; /* orig */
const float *vd_prev, *vd_curr, *vd_next; /* deform */
@@ -210,9 +213,9 @@ void BKE_crazyspace_set_quats_mesh(Mesh *me,
co_next = origcos[ml_next->v];
}
else {
- co_prev = mvert[ml_prev->v].co;
- co_curr = mvert[ml_curr->v].co;
- co_next = mvert[ml_next->v].co;
+ co_prev = verts[ml_prev->v].co;
+ co_curr = verts[ml_curr->v].co;
+ co_next = verts[ml_next->v].co;
}
set_crazy_vertex_quat(