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:
authorBastien Montagne <montagne29@wanadoo.fr>2015-07-20 17:55:46 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2015-07-20 17:55:46 +0300
commit66dd9fbf229f78207f2f7a8701bcb2da46328875 (patch)
treeceb8339a105812568994721fb53b51d0b45cd31c /source/blender/modifiers/intern/MOD_weightvg_util.c
parent9ee1f96a0fa603e223fb34a480d2fdcb254bf514 (diff)
Fix (unreported) broken MixWeight modifier in debug builds.
defvert_find_index() & co now assert when '-1' invalid vgroup index is passed. We used to rely on NULL value returned in this case, but with the assert... The assert completely stalls blender actually (repeated for every vertex!). So much better to not call that func when vgroup index is invalid.
Diffstat (limited to 'source/blender/modifiers/intern/MOD_weightvg_util.c')
-rw-r--r--source/blender/modifiers/intern/MOD_weightvg_util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/modifiers/intern/MOD_weightvg_util.c b/source/blender/modifiers/intern/MOD_weightvg_util.c
index c9de1dc083d..da7230ed5af 100644
--- a/source/blender/modifiers/intern/MOD_weightvg_util.c
+++ b/source/blender/modifiers/intern/MOD_weightvg_util.c
@@ -247,7 +247,7 @@ void weightvg_update_vg(MDeformVert *dvert, int defgrp_idx, MDeformWeight **dws,
for (i = 0; i < num; i++) {
float w = weights[i];
MDeformVert *dv = &dvert[indices ? indices[i] : i];
- MDeformWeight *dw = dws ? dws[i] : defvert_find_index(dv, defgrp_idx);
+ MDeformWeight *dw = dws ? dws[i] : ((defgrp_idx >= 0) ? defvert_find_index(dv, defgrp_idx) : NULL);
/* Never allow weights out of [0.0, 1.0] range. */
CLAMP(w, 0.0f, 1.0f);