diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-11-28 16:33:17 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-11-28 16:33:17 +0300 |
commit | c4933cccfa74836ff88a6904abfaf52c8e0cde87 (patch) | |
tree | 87004e9a5c1004c7c67c9c6b80d19a670ddd4d08 /source/blender/makesdna/DNA_modifier_types.h | |
parent | b83751d8c2a3fd85e6e8e301ee1f986d684b03d5 (diff) |
Mesh Deform Modifier
* Now support a Surface mode next to the existing Volume mode. This binds
the mesh to the cage mesh surface rather than it's volume.
* Implemented reusing the bone heat weighting code.
* Advantage is that it works for cage meshes that are not volumes and that
binding is much faster.
* Weak point is that disconnected components of a mesh are not guaranteed
to stick together (same problem exists with bone heat weighting).
* Bind weights could still be compressed better to use less memory.
Example file:
http://download.blender.org/ftp/incoming/cloth_mdef_surface.blend
Diffstat (limited to 'source/blender/makesdna/DNA_modifier_types.h')
-rw-r--r-- | source/blender/makesdna/DNA_modifier_types.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index fe6a5b050e3..040dc4dbd78 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -492,6 +492,9 @@ typedef struct BooleanModifierData { #define MOD_MDEF_INVERT_VGROUP (1<<0) #define MOD_MDEF_DYNAMIC_BIND (1<<1) +#define MOD_MDEF_VOLUME 0 +#define MOD_MDEF_SURFACE 1 + typedef struct MDefInfluence { int vertex; float weight; @@ -508,7 +511,7 @@ typedef struct MeshDeformModifierData { struct Object *object; /* mesh object */ char defgrp_name[32]; /* optional vertexgroup name */ - short gridsize, flag, pad[2]; + short gridsize, flag, mode, pad; /* variables filled in when bound */ float *bindweights, *bindcos; /* computed binding weights */ @@ -523,7 +526,8 @@ typedef struct MeshDeformModifierData { float bindmat[4][4]; /* matrix of cage at binding time */ /* runtime */ - void (*bindfunc)(struct Scene *scene, struct MeshDeformModifierData *mmd, + void (*bindfunc)(struct Scene *scene, struct DerivedMesh *dm, + struct MeshDeformModifierData *mmd, float *vertexcos, int totvert, float cagemat[][4]); } MeshDeformModifierData; |