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-08-15 04:51:44 +0400
committerAndre Susano Pinto <andresusanopinto@gmail.com>2008-08-15 04:51:44 +0400
commita88eb64f70750de50fe153c147382261867ae1be (patch)
treea5a707b7ca179eca7e06833c1d40001d10619a62 /source/blender/blenkernel/intern/simple_deform.c
parentc37923c7a386f8cdb8ad61e475821253e793da95 (diff)
Simpledeform origin is no longer attache to parent by default
That was due to a current limitation on dag system.. that leads to cyclic dependencies. So now you can attach the origin of a simpledeform to an empty and mark whether its affected by the relative position of empty or the global one. brecht found a workarround to solve the cyclic dependency by using a parent of both the mesh and the control empty: empty_parent | |-> empty controlling simpledeform |-> mesh with simpledeform modifier
Diffstat (limited to 'source/blender/blenkernel/intern/simple_deform.c')
-rw-r--r--source/blender/blenkernel/intern/simple_deform.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/simple_deform.c b/source/blender/blenkernel/intern/simple_deform.c
index 20cba28ab5a..2984b8fe9d8 100644
--- a/source/blender/blenkernel/intern/simple_deform.c
+++ b/source/blender/blenkernel/intern/simple_deform.c
@@ -153,13 +153,24 @@ void SimpleDeformModifier_do(SimpleDeformModifierData *smd, struct Object *ob, s
if(smd->origin)
{
//inverse is outdated
- Mat4Invert(smd->origin->imat, smd->origin->obmat);
- Mat4Invert(ob->imat, ob->obmat);
- ob2mod = tmp_matrix[0];
- mod2ob = tmp_matrix[1];
- Mat4MulSerie(ob2mod, smd->origin->imat, ob->obmat, 0, 0, 0, 0, 0, 0);
- Mat4Invert(mod2ob, ob2mod);
+ if(smd->originOpts & MOD_SIMPLEDEFORM_ORIGIN_LOCAL)
+ {
+ Mat4Invert(smd->origin->imat, smd->origin->obmat);
+ Mat4Invert(ob->imat, ob->obmat);
+
+ ob2mod = tmp_matrix[0];
+ mod2ob = tmp_matrix[1];
+ Mat4MulSerie(ob2mod, smd->origin->imat, ob->obmat, 0, 0, 0, 0, 0, 0);
+ Mat4Invert(mod2ob, ob2mod);
+ }
+ else
+ {
+ Mat4Invert(smd->origin->imat, smd->origin->obmat);
+ ob2mod = smd->origin->obmat;
+ mod2ob = smd->origin->imat;
+ }
+
}