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

No scripts working

  • Hi, TheSpikenstein

    To make this work you need to create a New- > Head Binding in your project

    Then drag and drop this script from the Resources panel into Inspector panel with Head Binding selected

    To see something happening please change script like this : 

    var obj = script.getSceneObject()
    var o = obj.getTransform().getWorldRotation()
    var event = script.createEvent("UpdateEvent");

    event.bind(function(eventData) {
    print(obj.getTransform().getWorldPosition())
    });

    You should see output in the Logger Panel

    Let me know if that works!

    If you want to add references to other sceneObject to your script please check out Custom Script UI section in Scripting Guide

    Let me know if that helps!

    Best

    Olha

    Comment actions Permalink
  • hey Olha,

     

    Thanks for the quick reply.   I  Did as you said

    1. added head binder

    2. added script

    3. applied script

    4. pasted script 

     

    Logger does not display any coodinates.  see pic. 

     

    ALSO, how would i get this information onto a mesh once its obtained?

     

    Comment actions Permalink
  • Hi! Do you have a face on a preview video?. Script is attached to the head and head is not detected. 

    Select Window-> Panels -> Default layout and pick any picture or video with a face on a preview panel.

    Now you should see script working.

    But let's put it onto another object to prevent this behavior:  

     

    I removed script from the head binding, and attached it to the empty object 

    Modified script like this : 

    //@input SceneObject follower
    //@input Component.Head head

    var obj = script.head.getSceneObject()
    var o = script.head.getSceneObject().getTransform().getWorldRotation();
    var event = script.createEvent("UpdateEvent");

    event.bind(function(eventData) {
    var pos = obj.getTransform().getWorldPosition();
    script.follower.getTransform().setWorldPosition(pos);
    print(pos)
    });

    You can see that script has two inputs now. So go on and assign objects to the fields (by dragging and dropping) 

    My project is here

    Hope this helps!

    Comment actions Permalink
  • hey Olha,

     

    Thanks for the example scene and Yes it works in your file...

     

    But i cannot build it from scratch.... The camera is on, and i can attach meshes to the face tracker. 

    The ONLY difference i can see bewteen our scenes is your Script appears in the the  OBJECTS panel.  I dont see how to add it there.  Tried dropping in on the HeadBinding, on the Sphere in both objects panel AND in Inspector Panel... I Just dont see how to "activate" the script. 

    your example

     

    Mine not working

    Comment actions Permalink
  • Hi!

    In the Objects Panel press "+" and select Empty Object

    With newly created object selected drag the script onto Inspector panel

    Comment actions Permalink
  • That makes sense, thanks...  

     

    BUT, the problem is after adding Empty Object and then dropping the script on it... The Empty Object DOES NOT have the inputs.   

    I CAN do this in your scene. But not from one i build from scratch.  

    PS. this is the case of all scripts  even  print("hello")

     

    Is there an "activate scipt" button somewhere im missing???

    Comment actions Permalink
  • Looks like changes in a Script are not saved.

    Click on the script editor window and press Ctrl (Cmd) + S to save. 

    The circle near the script tab should disappear

    Hope this is it!

     

     

     

    Comment actions Permalink
  • Olho....  You ARE THE MAN.  

     

    Where the hell is that in the bloody documentation???  :(

     

    I Promise to give you personal shout out on my first lens.

    Thanks again for all your help, you deserve a raise.

    Comment actions Permalink
  • Glad it worked! Thank you!

    Actually this guide has step by step instructions on creating a first script https://lensstudio.snapchat.com/guides/scripting/scripting-example/ . I'll make sure to add note about saving

    Also you can try looking into our template video guides to get the general idea of how Lens Studio works:) 

    https://lensstudio.snapchat.com/templates/ 

    Best

    Olha

    Comment actions Permalink
    • Hii buddy

      1. added head binder

      2. added script

      3. applied script

      4. pasted script 

       

      Logger does not display any coodinates.  see pic. 

       

      ALSO, how would i get this information onto a mesh once its obtained?

       

    Comment actions Permalink
  • hi, Mamoona khalid

    Unfortunately the is no picture added. Do you mind sending your code or explain what are you trying to print out? 

    If you are assigning some script to the scene object with Head Binding component  - make sure you are testing the lens on a preview that has a head in a frame. 

    Best 

    Olha

    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!