Morphings
The Morphings is a Custom Component introduced in Lens Studio 4.49 that allows to change the shape of each part of the faces and provides more control over the edited area. The Component can be used to create barely noticeable natural-looking morphings as well as stylized characters.
Installing
Before getting started, You will need to make sure you have Lens Studio 4.49 or later installed.
The Morphings custom component can be found in Lens Studio Asset Library.
In the Asset Library, type in Morphings in the Search field of Asset Library, navigate to the Morphings asset and click Install.
Adding To Scene
Add the Morphings component to the Scene Object in the Perspective Camera.
-
In the Objects Panel, Click + to add a new object and select Scene Object.
-
Place the Scene Object in the Perspective Camera.
-
Rename your Scene Object to Morphings.
-
With the Morphings object selected, left click on the Add Component button in the Inspector panel and select Morphings
-
With the Morphings object selected in the Objects panel,
-
Choose your Perspective Camera in the Target Camera input of the component
-
All the elements of the component can be changed both ways: enlarge or reduce the size, change the position higher or lower, etc.
-
Apply the Occlusion when you want the effect to work only within the face. Add Portrait Face Segmentation Texture or Render Target with Face Occlusion in the Occlusion Input Texture of the component
Scripting Api
The Morphings custom component can also be configured from script. You can use API methods for this.
- setValue(morphingType, value): void
- getValue(morphingType): number
"value" must be a number from -1.0 to 1.0
"morphingType" must be one of them:
- MorphingType.UpperLip
- MorphingType.OverallLipsSize
- MorphingType.LowerLip
- MorphingType.Smile
- MorphingType.MShape
- MorphingType.EyesSize
- MorphingType.EyeTilt
- MorphingType.EyesDistance
- MorphingType.EyeOuterCorner
- MorphingType.EyebrowThickness
- MorphingType.EyebrowShape
- MorphingType.EyebrowPosition
- MorphingType.EyebrowTilt
- MorphingType.NoseSize
- MorphingType.ChinSize
- MorphingType.CheekSize
- MorphingType.JawSize
- MorphingType.ForeheadSize
- MorphingType.HeadSize
For example:
//@input Component.ScriptComponent morphings
script.morphings.setValue(MorphingType.HeadSize, 0.55)
print(script.morphings.getValue(MorphingType.HeadSize) // 0.55