The forum on this site is closed for new comments and posts. Continue the conversation in the new forum, and learn more here.

Mouth Opened Animation Trigger

  • Hi Neel!

    Adding 2D Animation

    You can import both 2D images and gif into Studio. To bring it in, simply drag the file into the Resources panel. Then in your Objects panel, you can press Add New and select Billboard (display animation on the screen), Sprite (display animation in 3D space), Face Sprite (display animation attached to the face). 

    Take a look at https://lensstudio.snapchat.com/guides/2d/2d-animation/ for more information. Additionally, you can import directly from Giphy. Take a look at https://lensstudio.snapchat.com/guides/2d/giphy-import/ for details. 

    Starting Particle on Mouth Opened

    Yes, you can start a particle on mouth opened. First open the Particles template to make the particles you want to emit. Take a look at the Particles template guide for all the controls you can do. https://lensstudio.snapchat.com/templates/world/particles/

    Then, follow the "Exporting & Importing Particles" section in the guide to bring your particle into your lens project. 

    Finally, to get it to play on mouth opened, we need to use a script so that we can control the time in the particle system. To do this, first lets tell our particle to use an external time. 

    In the Resources panel, select your particle material and check the "External Time" box. 

    Then let's use a script to tell the particle system the time. In your Resources panel, click Add New > Script. Then select the new script in your Resources panel and paste this code in the Inspector Panel:

    var playingParticles = false;

    function onMouthOpened(time)
    {
    global.controlTime = getTime();
    playingParticles = true;
    }
    var mouthOpenedEvent = script.createEvent("MouthOpenedEvent");
    mouthOpenedEvent.bind(onMouthOpened);

    function onUpdate (time)
    {
    if (playingParticles) {

    global.animTime = global.controlTime - getTime();
    var positiveTime = -animTime * 0.5;

    script
    .getSceneObject()
    .getFirstComponent("Component.MeshVisual")
    .getMaterial(0)
    .mainPass
    .externalTimeInput = positiveTime;
    }
    }
    var updateEvent = script.createEvent("UpdateEvent");
    updateEvent.bind(onUpdate);

    What this code is doing is, when you open your mouth, it tells the script that we should play particles. Then every frame update when we are playing particles, we increment the time in our particle system. 

    Put this script where ever the Mesh Visual for your particle is. and set it to "Initialized" 

    Now, when you open your mouth, your particle should play!

    Don't forget to show us what you make!

    Cheers,

    Jon

     

     

    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!