Skip to main content

Makeup

To see all the Makeup features and it's examples see our Virtual Makeup API page.

How to add Makeup to your Effect

  1. Find Makeup.prefab in Project window, drag it and attach to your effect in Hierarchy window.

image

  1. Then you need to assign a reference of your effect's PlaneController component to each segmentation mask (SmoothCamera is not segmentation) under Canvas object by dragging a CameraPlane object from Hierarchy to a Plane field of a Segmentation Feature component. You can do it one by one, or just by selecting all of them in Hierarchy and assigning reference to all of them at once as shown below.

image

  1. Add required references for FacesController. If you haven't got FacesController in your current effect, you could find here Assets/BanubaFaceAR/BaseAssets/Prefabs/FacesController.prefab and drag it into the effect root.

image

  1. Assign effect's ResultCamera to RenderCamera field on Canvas object.

image

  1. Change the FaceMesh Material on Assets/BanubaFaceAR/Makeup/Materials/EyeFaceMakeup.mat:

image

  1. Makeup is ready!

How to use

After Makeup is added to your object it's time to tweak some options. Each separate makeup feature is represented as component on Makeup object that provides you with different options to adjust. You can do it both from code and Inspector.

image Tweak options from Inspector to see makeup in Editor Playmode

note

Lips makeup component has 3 option presets for particular lips look. To apply them find and click the button in a upper-right corner of Lips Makeup component window and choose the preset you want from the end of the list. image

To access these options from code at runtime you can get reference to MakeAPI component which stores references to all other makeup components.

MakeupAPI makeupAPI = makeupGameObject.GetComponent<MakeupAPI>();
makeupAPI.Lips.color = new Color(0.8f, 0.1f, 0, 0.6f);
makeupAPI.Lips.brightness = 0.9f;
makeupAPI.Skin.softeningStrength = 1;

Adjusting Makeup from code

If you want to completely disable or enable particular makeup feature just change state of MonoBehaviour's enabled property.

makeupAPI.Skin.enabled = false; // now Skin makeup is completely disabled

Makeup example scene

Banuba Unity plugin provides example scene with Makeup effect. Everything is already setup. Find and open MakeupExample.unity scene under Assets => BanubaFaceAR => Makeup. Click Play button and see how it works!