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:
authorCampbell Barton <ideasman42@gmail.com>2011-12-15 02:54:38 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-12-15 02:54:38 +0400
commit40a2c1a2921b50edd8b798e79b6bd2a6d94d7bba (patch)
treef28bc2e08718bbf7e8fee729330c5c1e675c180e /source/blender/blenkernel/intern/deform.c
parent3d5330f789c287666b875706c84228520473add5 (diff)
more vertex weight edits,
* replace inline loops with api calls. * change constraints so verts with 0.0 weight are ignored like they are everywhere else.
Diffstat (limited to 'source/blender/blenkernel/intern/deform.c')
-rw-r--r--source/blender/blenkernel/intern/deform.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/deform.c b/source/blender/blenkernel/intern/deform.c
index 4d3af172b22..e14fd6827af 100644
--- a/source/blender/blenkernel/intern/deform.c
+++ b/source/blender/blenkernel/intern/deform.c
@@ -539,6 +539,12 @@ float defvert_find_weight(const struct MDeformVert *dvert, const int defgroup)
return dw ? dw->weight : 0.0f;
}
+/* take care with this the rationale is:
+ * - if the object has no vertex group. act like vertex group isnt set and return 1.0,
+ * - if the vertex group exists but the 'defgroup' isnt found on this vertex, _still_ return 0.0
+ *
+ * This is a bit confusing, just saves some checks from the caller.
+ */
float defvert_array_find_weight_safe(const struct MDeformVert *dvert, const int index, const int defgroup)
{
if (defgroup == -1 || dvert == NULL)