diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-12-27 14:14:06 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-12-27 14:14:06 +0300 |
commit | 0767cdd4a00e217320a2b9e090373efb0d41209e (patch) | |
tree | d6b30c775a025ced12c3ee930f82536d74c73aaa /source/blender/blenlib | |
parent | eb766f1d3ff7f8ebb1ff257e2bdd154c20ed3c1d (diff) |
Transfer Shape Key
Useful if you have 2 different characters with the same base mesh (matching indicies), and want to copy a facial expression for eg, from one to another.
Durian request to re-use shapes between characters.
* Copies the active shape to other selected objects
* Different methods to apply the shape
* * OFFSET, simple translation offset
* * RELATIVE (EDGE/FACE), Use Barycentric transformation to copy the shape. This means the target mesh can be a different orientation and scale and the shape should still apply since the surrounding geometry is used as a basis for the offset.
bug: barycentric transform's depth was inverted.
Note:
* This isnt added into a menu yet,
* This cant be redone since adding a shape key messes up the redo stack. needs fixing for other scripts too.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/intern/math_geom.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c index dd773cb00c1..470e5d71a45 100644 --- a/source/blender/blenlib/intern/math_geom.c +++ b/source/blender/blenlib/intern/math_geom.c @@ -1404,7 +1404,7 @@ void barycentric_transform(float pt_tar[3], float const pt_src[3], area_tar= sqrtf(area_tri_v3(tri_tar_p1, tri_tar_p2, tri_tar_p3)); area_src= sqrtf(area_tri_v2(tri_xy_src[0], tri_xy_src[1], tri_xy_src[2])); - z_ofs_src= tri_xy_src[0][2] - pt_src_xy[2]; + z_ofs_src= pt_src_xy[2] - tri_xy_src[0][2]; madd_v3_v3v3fl(pt_tar, pt_tar, no_tar, (z_ofs_src / area_src) * area_tar); } |