The forum on this site is closed for new comments and posts. Continue the conversation in our Snap AR Discord server.

Adjust face stretch with open mouth

  • Heres a script by Ben that might help you out.

    //This script allows you to stretch the face dynamically with mouth triggers. 
    //When the user opens their mouth, the stretch increases at the speed you specify until it reaches the max amount that you specify (less than 2).
    //When the user closes their mouth, the intensity decreases to 0

    // -----JS CODE-----
    // @input Component.FaceStretchVisual stretch
    // @input float intensityMax
    // @input float upSpeed
    // @input float downSpeed
    var feature = "Feature0";
    var intensity = 0;
    var stretching = false;
    var openEvent = script.createEvent("MouthOpenedEvent");
    openEvent.faceIndex = 0;
    openEvent.bind(function (eventData)
    {
    stretching = true;
    stretch();
    });
    var closeEvent = script.createEvent("MouthClosedEvent");
    closeEvent.faceIndex = 0;
    closeEvent.bind(function (eventData)
    {
    stretching = false;
    stretch();
    });
    function stretch()
    {
    var event1 = script.createEvent("UpdateEvent");
    event1.bind(function (eventData)
    {
    if (stretching)
    {
    if (intensity < script.intensityMax)
    {
    intensity += script.upSpeed;
    script.stretch.setFeatureWeight(feature, intensity);
    }
    else
    {
    intensity = script.intensityMax;
    script.stretch.setFeatureWeight(feature, intensity);
    event1.enabled = false;
    return;
    }
    }
    else
    {
    if (intensity > 0)
    {
    intensity -= script.downSpeed;
    script.stretch.setFeatureWeight(feature, intensity);
    }
    else
    {
    intensity = 0;
    script.stretch.setFeatureWeight(feature, intensity);
    event1.enabled = false;
    return;
    }
    }
    });

    }
    Comment actions Permalink
  • Hi Takinours, 

    The script Mikael posted works great for modifying the Face Stretch effect. Take a look at the Face Stretch guide for more pointers. Also, take a look at the Distort guide for tips on how to apply advanced effects to Face Stretch. 

    Cheers,

    Neha 

    Comment actions Permalink
  • Thanks! I'm going to test

    Comment actions Permalink
  • Hey Takinours!

    Like n-mikael mentioned above, that script should help you adjust the face stretch intensity. I also made a Youtube tutorial and template that you can download that implements the effect! Go ahead and check it out here - https://www.youtube.com/watch?v=iRjHo7i3ghc&list=PLW0Y_2Vl8nJ7JgVywfoOReQf5GbAKweVq&index=5

    The link to the template is in the description!

    Ben

    Comment actions Permalink
  • Thank for your help Ben and tanks for your tuto! I missed this episode.

    Comment actions Permalink

We're here to help! We just need a little bit of information...

What system are you using?

Have you downloaded the latest version of Lens Studio?

Please download the latest version of Lens Studio. If you still run into this issue, please come back and report it!

Is this issue causing Lens Studio to crash?

What system do you run Lens Studio on?

Version

Graphics

Follow the next steps to help us solve your issue:

  • Copy and paste this text into your TerminalCommand Window
    open ~/Library/Preferences/Snap/Lens\ Studio/ %LOCALAPPDATA%\Snap\Lens Studio Copy Text
  • Press ReturnEnter to run the command. The Lens Studio folder will automatically open
  • Prepare to upload your files: zip the "Log" Folder by right-clicking and choosing "compress."
    Locate the Log.txt file right above it.

    Attach a screenshot of the issue:

Name:

Email:

What is this most relevant to?

Please enter a brief description of your issue:

Thanks for submitting this issue.

Unfortunately, it's likely due to the operating system or hardware you're using – since they don't meet the system requirements for Lens Studio.

Still, we hear you loud and clear, and are logging the issue in case there's ever a workaround we can provide!

Minimum Requirements

Operating System: Windows 10 (64 bit); MacOS 10.11+

Hardware: Minimum of Intel Core i3 2.5Ghz or AMD Phenom II 2.6Ghz with 4 GB RAM; Intel HD Graphics 4000 / Nvidia GeForce 710 / AMD Radeon HD 6450 or better; screen resolution of 1280x768 or higher

We'll try to resolve this issue as soon as possible. Thanks for letting us know about it!

Keep an eye out for a followup email from us. We may have a couple more questions for you, or we might already have a solution to offer.

Happy creating!