diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-02-10 22:00:44 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-02-10 22:00:44 +0300 |
commit | 3c5d5fb1cad25d75df3a3a032e86a58957311fd2 (patch) | |
tree | 7065899ee9e1a75d79b9558607827009874f212d /mocap/mocap_constraints.py | |
parent | 039f3646b5a2a3a76fd43df1a2cf68bc0242f1c7 (diff) | |
parent | 6266b4139503bb614576f15ea4e90870ac5e597d (diff) |
Merge branch 'master' into fbx_io_export_ignore_parentsfbx_io_export_ignore_parents
Conflicts:
io_scene_fbx/import_fbx.py
Diffstat (limited to 'mocap/mocap_constraints.py')
-rw-r--r-- | mocap/mocap_constraints.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/mocap/mocap_constraints.py b/mocap/mocap_constraints.py index d9f41ea1..4509193c 100644 --- a/mocap/mocap_constraints.py +++ b/mocap/mocap_constraints.py @@ -300,15 +300,16 @@ def setConstraint(m_constraint, context): print("please wait a moment, calculating fix") for t in range(s, e): context.scene.frame_set(t) - axis = obj.matrix_world.to_3x3() * Vector((0, 0, 100)) + axis = obj.matrix_world.to_3x3() * Vector((0, 0, 1)) offset = obj.matrix_world.to_3x3() * Vector((0, 0, m_constraint.targetDist)) ray_origin = (cons_obj.matrix * obj.matrix_world).to_translation() - offset # world position of constrained bone ray_target = ray_origin + axis #convert ray points to floor's object space ray_origin = floor.matrix_world.inverted() * ray_origin ray_target = floor.matrix_world.inverted() * ray_target - hit, nor, ind = floor.ray_cast(ray_origin, ray_target) - if hit != Vector((0, 0, 0)): + ray_direction = ray_target - ray_origin + ok, hit, nor, ind = floor.ray_cast(ray_origin, ray_direction) + if ok: bakedPos[t] = (floor.matrix_world * hit) bakedPos[t] += Vector((0, 0, m_constraint.targetDist)) else: |