You can set downloaded contents (items, face beautifications, and bulges) through ARGear using the methods in the ARGContents class.
9.1 An Item (2D/3D Sticker, Filter, Background, ARContents, …)
The setItem function in the ARGContents class allows you to set an item on frames.
There are several types of items that can be set in ARGContents as shown below. Currently, the contents that exist in https://argear.io only can be used in ARGContents.
2D Animation Sticker / Effects (BGM Support)
2D Face Mask
Face Fun Bulge
Face Beautification
Camera Filter
3D Animation Sticker
Realtime Segmentation
3D Avatar (Blendshapes: 52)
The sample code below shows an example of how to set an item.
/** * @param type contents type : ARGContents.Type.ARGItem, ARGContents.Type.FilterItem * @param path downloaded contents path * @param uuid uuid of an item */argsession.contents().setItem(type, path, uuid,new ARGContents.Callback() { @OverridepublicvoidonSuccess() { } @OverridepublicvoidonError(Throwable e) {if (e instanceof InvalidContentsException) {Log.e(TAG,"InvalidContentsException"); } }});
/** * @param type contents type : ARGContents.Type.ARGItem, ARGContents.Type.FilterItem * @param path downloaded contents path * @param uuid uuid of an item */argsession.contents().setItem(type, path, itemModel.uuid, object : ARGContents.Callback {overridefunonSuccess() { }overridefunonError(e: Throwable) {if (e is InvalidContentsException) { Log.e(TAG, "InvalidContentsException") } }})
9.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 setting these effects, your customers can transform their faces easily.
By using the setBeauty function in ARGContents class, you can easily add such functionalities without relying on the CMS module. Each face beautification type requires a float array as its input to determine how much of a face beautification effect should be applied.
The tables below describe detailed information for each type of face beautification effect.
Below is sample code of applying face beautification effects: