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:
authorNicholas Bishop <nicholasbishop@gmail.com>2007-01-08 11:02:26 +0300
committerNicholas Bishop <nicholasbishop@gmail.com>2007-01-08 11:02:26 +0300
commitafe7ea072dfa13a84d8403936c3424a259ef5920 (patch)
tree525411152fbc823858f718465cba3e7fdf97f996 /source/blender/src/multires.c
parent53ba22e90c2a4fbd7fe5b954a8e6e5abad7816d2 (diff)
Fixed a couple bugs with multires+weightgroups: 1) weightgroups are now being properly applied to the mesh on Level 1. 2) Corrected the algorithm that interpolates weightgroups for all the other levels so that it more or less matches the subsurf output.
Diffstat (limited to 'source/blender/src/multires.c')
-rw-r--r--source/blender/src/multires.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/src/multires.c b/source/blender/src/multires.c
index d3f1d12f58e..46118a4f13b 100644
--- a/source/blender/src/multires.c
+++ b/source/blender/src/multires.c
@@ -432,7 +432,7 @@ void multires_add_dvert(MDeformVert *out, const MDeformVert *in, const float w)
found= 0;
for(j=0; j<out->totweight; ++j) {
if(out->dw[j].def_nr==in->dw[i].def_nr) {
- out->dw[j].weight += w;
+ out->dw[j].weight += in->dw[i].weight * w;
found= 1;
}
}
@@ -445,7 +445,7 @@ void multires_add_dvert(MDeformVert *out, const MDeformVert *in, const float w)
}
out->dw= newdw;
- out->dw[out->totweight].weight= w;
+ out->dw[out->totweight].weight= in->dw[i].weight * w;
out->dw[out->totweight].def_nr= in->dw[i].def_nr;
++out->totweight;
@@ -1204,9 +1204,10 @@ void multires_level_to_mesh(Object *ob, Mesh *me)
for(i=0, eve= em->verts.first; eve; ++i, eve= eve->next)
CustomData_em_set(&em->vdata, eve->data, CD_MDEFORMVERT,
CustomData_get(&me->mr->vdata, i, CD_MDEFORMVERT));
- } else
- CustomData_merge(&me->mr->vdata, (em ? &em->vdata : &me->vdata),
- vdata_mask, CD_DUPLICATE, lvl->totvert);
+ } else {
+ CustomData_merge(&me->mr->vdata, &me->vdata, vdata_mask, CD_DUPLICATE, lvl->totvert);
+ me->dvert= CustomData_get(&me->mr->vdata, 0, CD_MDEFORMVERT);
+ }
}
else if(CustomData_has_layer(&me->mr->vdata, CD_MDEFORMVERT)) {
MultiresLevel *dlvl, *lvl1= me->mr->levels.first;