To reduce the SDK package size, you can dynamically download the necessary module resources and animated effect resources (MotionRes, not available in some basic editions of the SDK) from a URL and, after download, pass the path of the resources to the SDK.
1. Upload a ZIP file of the effect resources to the cloud and generate a URL such as https://server address/LightCore.bundle.zip.
2. In your project, download the file from the URL and decompress it to the sandbox (for example: Documents/Xmagic).
3. When initializing the SDK, pass in the path of the sandbox to root_path.
/// @param propertyType: The effect type, which is a string. Valid values: beauty, lut, motion.
/// @param propertyName: The effect name.
/// @param propertyValue: The effect value.
/// @param extraInfo: A reserved parameter, which can be used for dictionary configuration.
/// @return: If 0 is returned, the configuration is successful. If other values are returned, the configuration has failed.
/// @note: Notes
/**
| Effect Type | Effect Name | Effect Value| Description | Remarks |
| :---- | :---- |:---- | :---- | :---- |
| beauty | Name of beautification effect | Effect strength |Beautification effect API | - |
| lut | Filter path + Filter name | Filter strength | Filter API | - |
| motion | Name of animated effect | Path of animated effect | Animated effect API| Make sure the path you pass in is writable. For ZIP files, you must manually unzip them first if you want to build the resources into your app. |
No extra configuration is needed for beautification or body retouch effects. The SDK will automatically use the resource files downloaded. Below is a request sample for the skin brightening effect.
For animated, makeup, and keying effects, you need to configure propertyValue first. You can use the SDK’s built-in effect resources or resources downloaded from the internet.