Previewing Your Lens
There are two ways to preview and test your Lens: using the Preview
panel inside Lens Studio or Pairing to Snapchat to test on actual devices. For information on previewing your Lens in Snapchat, follow the Pairing to Snapchat guide.
You can also open multiple previews at once. You can open an additional Preview panel via left clicking on Window > Preview, in the top menu.
Preview control
The Preview
panel allows you to see what your Lens would look like within Snapchat without having to open your device. The Preview
panel updates in real time as you make changes to your scene. The Preview
panel has various modes for visualization which are detailed below.
Multimedia Preview
Photo Mode
Click the top bar in the Preview
panel to select a preview background. Then, select the Photo
tab. Here you can select from a number of static face and world photos to preview your content against. You can also add your own preview photos by selecting + From Files
.
Video Mode
Click the top bar in the Preview
panel to select a preview background. Then, select the Video
tab. Here you can select from a number of pre-recorded videos of faces and world videos with tracking data. You can also add your own custom videos by selecting + From Files
.
You can also add your own custom preview videos. Face Tracking, Marker Tracking and Object Tracking will work with custom preview videos. Custom preview videos will not have the proper tracking data for Rotation, Surface and World tracking to work.
Tip: It's best to provide a .mp4 formatted video. One way to do this is to use the following settings for FFMPEG: ffmpeg -i my_video.MOV -vcodec h264 -acodec mp2 my_video.mp4
Webcam Mode
This mode allows you to test your Lens using your webcam in realtime. This mode is extremely useful when workin on face Lenses, as you can test out various face triggers by moving your own face.
Interactive Preview Mode
The Interactive Preview Mode allows you to walk around the scene as if you were using the Lens on your device. You can use it to preview lenses with World Device Tracking
or World Mesh
right in Lens Studio without using the Lens on your device.
To walk around the scene, you can use Q
(down), W
(forward), E
(up), A
(left), S
(down), D
(right), or the Arrow Keys
on your keyboard.
Holding down Shift
switches to rotation mode: Q
(roll left), W
(pitch forward), E
(roll right), A
(yaw left), S
(pitch backward), D
(yaw right).
Scroll Wheel
will move the camera forward or backward. To change the orientation of the camera, hold down the Right Mouse Button
and drag your mouse around.
Holding down Shift
while using the Scroll Wheel
will speed-up or slow-down the movement of the camera when pressing the hot keys. Spacebar
will reset the camera speed.
Double Right-Click
on a mesh object to translate the camera to focus on that object.
Holding down Control
while using the Scroll Wheel
will zoom in/out on the preview window. Control
plus Left Mouse Drag
will translate the preview region if it doesn't already fit in the window. Right Click
will reset the window zoom. This feature works in Inspect, Webcam, and Interactive preview modes.
To go back to the camera's original position, press the Reset Button
.
Try this mode with LiDAR enabled template!
Stop Preview
Pressing this button will pause the state of the Lens at the given time.
Inspect Preview
Pressing this button will pause the state of the Lens at the given time, as well as show the state of the Lens in the Scene Hierarchy.
Pressing this is useful when you have scripts and components that can modify the Scene Hierarchy (e.g. instantiating prefab).
Preview Settings
Swap Cameras
Simulates swapping between the front and rear camera.
Lens Reset
Restarts the Lens as if it was freshly selected by the user. Anytime you make modifications to scripts, make sure to reset the Lens using the Lens Reset
button.
You can press cmd+r
on Mac or ctrl+r
on Windows, to trigger the Lens reset.
Settings
The cog menu allows you to access additional settings about how your Lens is previewed. For example, you can use it to clear or print the Persistent Storage.
Bottom Controls
Live Microphone Input
Toggle microphone. If your Lens can respond to microphone input, such as VoiceML, make sure to toggle this when you're testing.
Mute Sound
Mutes all sound coming from the Lens.
Device Simulation
Your Lens might look different on different devices due to the screen size and device's native UI. At the bottom of the Preview
panel, you can choose from a set of devices to simulate how your Lens looks like on that device.
You can drag the preview panel off the main panel to enable the floating device mode.
Toggle UI
Click on the button to toggle the mock of the Snapchat UI. Open the drop-down for more UI options.
- Capture Mode: When disabled, the UI will represent what Snapchat looks like in the live camera and while recording. When enabled, the UI will represent what Snapchat looks like after recording
- Show Sponsored UI: For Lens Creators creating Sponsored Lenses, this option when enabled, will show you the additional sponsored UI that's added to the Lens
Connected Lenses
If your Lens leverages Connected Lenses, this button allows your preview panel to connect to a session.
Screen Recording
Starts recording a video of the Lens from within the Preview panel. Then, prompts you to save the video to your machine.
Screenshot
Takes a screenshot of the Lens from within the Preview
panel. Then, prompts you to save the screenshot to your machine.