Downloaded contents, face beautification, and face fun bulge effects can be rendered on video frames. Types of Contents are defined in ARGEnum.cs as ContentsType.
By calling the setItem method in ARGearManager script, an item can be set for rendering.
The sample code below shows an example of how to set an ARGItem.
set an ARG Item
/* type ARGContent Type filePath Contents downloaded path uuid uuid of an item callback callback result */publicvoidSetItem(ARGEnum.ContentsType type,string filePath,string uuid,ARGearContentsCallback callback =null){#if UNITY_ANDROIDargearNative.SetItem(type, filePath, uuid,null,newARGearAndroidContentsCallback( success => {if (callback !=null) callback.OnSuccess(); }, error => {if (callback !=null) callback.OnError(error); } ));#elif UNITY_IOSargearNative.SetItem(type, filePath, uuid, callback);#endif}
8.2. Apply Face Beautification Effect
There are 16 face beautification effects in ARGContents such as V-line, face slim, jaw, chin, eye, eye gap, nose line, nose side, nose length, mouth size, eye back, eye corner, lip size, face skin, dark circle, and lip wrinkle. By applying these effects, your customers can transform their faces easily.
Face beautification types are defined in the BeautyType type in ARGEnum.cs. For the details of each parameter type, please refer to the table below.
<Table. Types of BeautyType Description>
8.2.1. Set Beauty Values
By using SetBeauty method, the effect of face beautification can be manipulated.
The sample code below shows how to set face beautification values at once.
Set Beauty Values
// Set all Beauty values at oncefloat[] BeautyDataDefault = {10f,//VLINE90f,//ACE_SLIM55f,//JAW-50f,//CHIN5f,//EYE-10f,//EYE_GAP0f,//NOSE_LINE35f,//NOSE_SIDE30f,//NOSE_LENGTH-35f,//MOUTH_SIZE0f,//EYE_BACK0f,//EYE_CORNER0f,//LIP_SIZE50f,//SKIN0f,//DARK_CIRCLE0f//MOUTH_WRINKLE};ARGearManager.Instance.SetBeauty(BeautyDataDefalut);
8.3 Face Fun Bulge
The setBulge function in ARGearManager script allows you to set 6 types of face fun bulge effects. Face Fun Bulge types are defined in ARGEmun.cs as BulgeType.