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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2007-11-05 01:00:24 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2007-11-05 01:00:24 +0300
commit1b9d661ecaed5c51bc702e209b0a1dae7365754f (patch)
tree3108583d45ddf9b6bb293e37966344e2881cd3b4 /source/blender/blenloader
parent044ae7f82fcb8a5af774cd2a4bea392f54abf8c2 (diff)
Mesh Deform Modifier
==================== The MeshDeform modifier can deform a mesh with another 'cage' mesh. It is similar to a lattice modifier, but instead of being restricted to the regular grid layout of a lattice, the cage mesh can be modeled to fit the mesh better. http://www.blender.org/development/current-projects/changes-since-244/modifiers/ Implementation Notes: - OpenNL has been refactored a bit to allow least squares matrices to be built without passing the matrix row by row, but instead with random access. MDef doesn't need this actually, but it's using this version of OpenNL so I'm just committing it now. - Mean value weights for polygons have been added to arithb.c, a type of barycentric coordinates for polygons with >= 3 vertices. This might be useful for other parts of blender too.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.c15
-rw-r--r--source/blender/blenloader/intern/writefile.c8
2 files changed, 23 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 82923ca1aa5..384a6d93480 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -2889,6 +2889,21 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb)
}
}
}
+ else if (md->type==eModifierType_MeshDeform) {
+ MeshDeformModifierData *mmd = (MeshDeformModifierData*) md;
+
+ mmd->bindweights= newdataadr(fd, mmd->bindweights);
+ mmd->bindcos= newdataadr(fd, mmd->bindcos);
+
+ if(fd->flags & FD_FLAGS_SWITCH_ENDIAN) {
+ int a;
+
+ for(a=0; a<mmd->totcagevert*mmd->totvert; a++)
+ SWITCH_INT(mmd->bindweights[a])
+ for(a=0; a<mmd->totcagevert*3; a++)
+ SWITCH_INT(mmd->bindcos[a])
+ }
+ }
}
}
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 45621c5fcd0..43907a30ac2 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -785,6 +785,14 @@ static void write_modifiers(WriteData *wd, ListBase *modbase)
writedata(wd, DATA, sizeof(int)*hmd->totindex, hmd->indexar);
}
+ else if (md->type==eModifierType_MeshDeform) {
+ MeshDeformModifierData *mmd = (MeshDeformModifierData*) md;
+
+ writedata(wd, DATA, sizeof(float)*mmd->totvert*mmd->totcagevert,
+ mmd->bindweights);
+ writedata(wd, DATA, sizeof(float)*3*mmd->totcagevert,
+ mmd->bindcos);
+ }
}
}