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:
authorAndre Susano Pinto <andresusanopinto@gmail.com>2008-07-04 23:56:31 +0400
committerAndre Susano Pinto <andresusanopinto@gmail.com>2008-07-04 23:56:31 +0400
commit37a017b18ab2bbc8c0d59a9cccd8c4f1265a59bb (patch)
tree88a507e9c603ca5ca7dbb2eba5067936a249e7ac /source/blender/blenkernel/intern/deform.c
parentad310b5087ea1605ba235f9ed4cf8292fa4294f7 (diff)
*Added vertex groups on simple deform
*Fixed a few UI things *Make SimpleDeform and Shrinkwrap to use vertexgroup_get_vertex_weight, a similar function "static float vert_weight(MDeformVert *dvert, int group)" existed on modifier.c, changed it a bit and moved into BKE_deform.h
Diffstat (limited to 'source/blender/blenkernel/intern/deform.c')
-rw-r--r--source/blender/blenkernel/intern/deform.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/deform.c b/source/blender/blenkernel/intern/deform.c
index ab53571b62d..888432005d0 100644
--- a/source/blender/blenkernel/intern/deform.c
+++ b/source/blender/blenkernel/intern/deform.c
@@ -220,3 +220,31 @@ void unique_vertexgroup_name (bDeformGroup *dg, Object *ob)
}
}
}
+
+float deformvert_get_weight(struct MDeformVert *dvert, int group_num)
+{
+ if(dvert)
+ {
+ MDeformWeight *dw = dvert->dw;
+ int i;
+
+ for(i=dvert->totweight; i>0; i--, dw++)
+ if(dw->def_nr == group_num)
+ return dw->weight;
+ }
+
+ /* Not found */
+ return 0.0;
+}
+
+float vertexgroup_get_vertex_weight(struct MDeformVert *dvert, int index, int group_num)
+{
+ if(group_num == -1)
+ return 1.0;
+
+ if(dvert == 0)
+ return 0.0;
+
+ return deformvert_get_weight(dvert+index, group_num);
+}
+