1. SDK Help Center
  2. Effect Construction

How to enable/disable beauty effect in Demo app?

For Beauty and Beauty_base effects:

To enable beautification add testBeauty(1.0); to config.js inside init function. This will enable all beautification parameters on max value (1.0).

this.init = function() {
var retouchMeshId = effectData.reservedMeshID.retouch;
Api.meshfxMsg("spawn", retouchMeshId, 0, effectData.meshesFileNames.retouch);
Api.meshfxMsg("tex", 0, 3, effectData.makeupsData.makeups["null"]);
Api.meshfxMsg("shaderVec4", 0, 6, "0.0 0.0 0.0 0.0");

For effects with beautification:
To enable/disable Beautification in the effect (cfg.toml), you need to check retouch material available, and all files included in the configuration as well.
If retouch/files, retouch.vert/frag, texture from samplers are absent, you can copy them from another effect's materials OR to build new effect in Constructor according to the instruction here. If there are all the materials in the effect, you should call 2 methods for enabling/disabling beautification: 
- Api.meshfxMsg("spawn", id_mesh*, 0, "!glfx_FACE"); - for drawing (if beautification was set by default in effect, this method will be already called)
- Api.del(id_mesh*) - for deleting the model, drawn before
*id_mesh - unique id, set automatically while building the effect OR any of available id_mesh.