[Bf-extensions-cvs] [df2296e1] blender-v3.1-release master: Fix T95648: Rigify: use eye axis in computing the eyelid tracking weights.

Alexander Gavrilov noreply at git.blender.org
Fri Feb 11 09:44:37 CET 2022


Commit: df2296e154463969713cc7a82593d10fe71ab940
Author: Alexander Gavrilov
Date:   Fri Feb 11 11:40:07 2022 +0300
Branches: blender-v3.1-release master
https://developer.blender.org/rBAdf2296e154463969713cc7a82593d10fe71ab940

Fix T95648: Rigify: use eye axis in computing the eyelid tracking weights.

If the coordinate space of the eyelids is computed only from the
eye rotation center points and corners, it fails if the center is
close or in front of the line connecting the corners.

Instead, compute the space based on the main eye axis plus the line
between corners, which only slightly changes the result compared to
the previous method, but is more robust.

===================================================================

M	rigify/rigs/face/skin_eye.py

===================================================================

diff --git a/rigify/rigs/face/skin_eye.py b/rigify/rigs/face/skin_eye.py
index da4da1e5..16b05b4b 100644
--- a/rigify/rigs/face/skin_eye.py
+++ b/rigify/rigs/face/skin_eye.py
@@ -92,13 +92,10 @@ class Rig(BaseSkinRig):
         if len(self.eye_corner_nodes) != 2:
             self.raise_error('Expected 2 eye corners, but found {}', len(self.eye_corner_nodes))
 
-        # Build a coordinate space with XY plane based on center and two corners,
-        # and Y axis oriented as close to the eye axis as possible.
-        vecs = [(node.point - self.center).normalized() for node in self.eye_corner_nodes]
-        normal = vecs[0].cross(vecs[1])
-        space_axis = self.axis - self.axis.project(normal)
+        # Build a coordinate space with XY plane based on eye axis and two corners
+        corner_axis = self.eye_corner_nodes[1].point - self.eye_corner_nodes[0].point
 
-        matrix = matrix_from_axis_pair(space_axis, normal, 'z').to_4x4()
+        matrix = matrix_from_axis_pair(self.axis, corner_axis, 'x').to_4x4()
         matrix.translation = self.center
         self.eye_corner_matrix = matrix.inverted()



More information about the Bf-extensions-cvs mailing list