Mouth tracking script

I discover that is possible to use upper lips as a point to track the face. I found this script but its not updated to the promise stuff.


Someone could help me make it work with the new scripting stuff ?

I need to use the upper lips center point as a tracking point.

It’s really simple to convert, just use an async/await in the findfindFirst method. If you share a gist I can do it for you

// How to load in modules
const Scene = require(‘Scene’);
const FaceTracking = require(‘FaceTracking’);




const plane = results[0]


// locate the object in the Scene
const wheat = Scene.root.find(‘object00’);

// Store a refece to detected face
const face = FaceTracking.face(0);

const whatTransform = wheat.transform;

const upperLipCenter = face.mouth.upperLipCenter;

wheatTransform.x = upperLipCenter.x;
wheatTransform.y = upperLipCenter.y;
wheatTransform.z = upperLipCenter.z;

wheatTransform.rotationX = upperLipCenter.x;
wheatTransform.rotationY = upperLipCenter.y;
wheatTransform.rotationZ = upperLipCenter.z;

This should work

1 Like

I got the message “Possible Unhandled Promise Rejection: TypeError: undefined is not a function”

Updated, I had made a typo on line 5

1 Like

It worked now thank you very much! :smiley:

1 Like