Skip to main content
Version: 4.55.1

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.

image alt text

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.

image alt text

Adding To Scene

Add the Morphings component to the Scene Object in the Perspective Camera.

  1. In the Objects Panel, Click + to add a new object and select Scene Object.

    image alt text

  2. Place the Scene Object in the Perspective Camera.

  3. Rename your Scene Object to Morphings.

    image alt text

  4. With the Morphings object selected, left click on the Add Component button in the Inspector panel and select Morphings

    image alt text

  5. With the Morphings object selected in the Objects panel,

    image alt text

  6. Choose your Perspective Camera in the Target Camera input of the component

    image alt text

  7. All the elements of the component can be changed both ways: enlarge or reduce the size, change the position higher or lower, etc.

    image alt text

  8. 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

    image alt text

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
Was this page helpful?
Yes
No