Face Image Picker
This is currently not available in Lens Studio 5.0. Take a look at Lens Studio 4 to use this feature.
The Face Image Picker Texture is now deprecated. You should instead use Media Picker Texture which will allow you to get both images, images with faces, as well as videos from the device's camera roll.
The Face Image Picker Template allows you to put faces from your phone’s camera roll on any object as a texture. The Face Image Picker automatically detects any faces in the phone’s camera roll, crops them and then applies the selected face to an object. The template includes a 3D face model that can be easily attached to and positioned on a character.
Tutorial
Guide
Add Your Custom Object
To import your custom 3D object select the + -> Import Files
from the Asset Browser
panel.
After importing your content, it will appear in the Scene Hierarchy
panel. Drag and drop your content so that it is a child of the FaceImagePickerController [EDIT_ME]
object. Once your custom content is added, you can delete the template’s placeholder content labeled with [REPLACE_ME]
.
Included Face Mesh
This template comes with a ready to use face mesh with the Face Image Picker functionality. Face mesh is included in the project as a prefab which can be found under the FaceMeshPrefab
folder in the Asset Browser
panel. The prefab is named FaceMesh [POSITION_ME]
.
A prefab is a copy of a scene object (and its children) as a Resource. For more information about Prefabs, reference the Prefabs guide.
To use the Face Mesh prefab in Lens Studio, drag the prefab from the FaceMeshPrefab
folder in the Asset Browser
panel to be a child of the FaceImagePickerController [EDIT_ME]
object in the Scene Hierarchy
panel.
Align the Included Face Mesh
You can now position, scale and rotate the Face Mesh [POSITION_ME]
object to be aligned with where the face should go in your custom content. If your custom content is animated, simply drag the included face mesh to be a child of one of the animation’s bones. The custom mesh will then animate with the parent bone.
Custom Face Mesh
You can use the provided Face Mesh in Lens Studio which is already UV mapped to the Face Image Picker texture. Alternatively, you can also create your own custom 3D face and UV map it to the Face Image Picker texture. If you are creating your own custom mesh, reference the below images for creating your UV map.
Linking the Custom Face Mesh
When using a custom mesh with the Face Image Picker, you need to assign the face_image_picker
material to the mesh. Select your custom 3D mesh in the Scene Hierarchy
panel. Select Choose Material
in the Inspector
panel. In the material selection window, find the face_image_picker
material in the Material
folder.
Previewing Your Lens
You’re now ready to preview your Lens experience. To preview your Lens in Snapchat, follow the Pairing to Snapchat guide.