0.2.2 • Published 4 years ago

sparkar-smoother v0.2.2

Weekly downloads
5
License
MIT
Repository
github
Last release
4 years ago

Smoother

index

Smoother is a Spark AR tool to let you make object follow facial feature with exponential smooth WITHOUT Any Additional Patch or Script.

Install

Import

  1. Download Smoother.js (Right click and Save as)

  2. Drag/Drop or import it to Spark AR

  3. (Optional) Load in the required modules

    const Smoother = require('./Smoother');
    // Your script...
  4. You can also Click Here to Download a Sample Project.

npm

  1. Add package with yarn or npm

    yarn add sparkar-smoother

    or

    npm i sparkar-smoother
  2. Load in the required modules. If you use webpack to transpile code, you must import this module.

    const Smoother = require('sparkar-smoother');
    // Your script...

Usage

This tool make object follow head by naming, so you don't need to add any Patch or write any code. All you need to do is naming your scene object.

The name should follow this pattern: face<index> -s<ms> [<feature>] [-noR]

  • index: 0-5. Spark AR supports detection of up to 5 faces.
  • ms: Smooth milliseconds, the minimum valid value is 0.
  • feature: Click here to look up supported feature and keyword.
  • noR: Follow position only, without rotation.

There are some naming example:

Name PatternDescription
face0 -s500Follow the face of index 0 with exponential smooth 500 millisecond.
face1 -s300Follow the face of index 1 with exponential smooth 300 millisecond.
face2 -s0Follow the face of index 1 without any smooth exponential smooth.
face3 -s0 -noRFollow the face of index 3 position only, excluding rotation.
face3 -s50 eyeLFollow the left eye of face 3 with exponential smooth 50 millisecond.
face4 -s50 eyeRFollow the right eye of face 4 with exponential smooth 50 millisecond.
face4 -s20 mouthFollow the mouth of face 4 with exponential smooth 50 millisecond.

Please Note that you may need to add the max number of Face Tracking manually for detect more than one face: Project > Edit Properties > Capabilities

Facial Feature Keywords

KeywordsDescription
eyeLLeft Eye
eyebowLLeft Eyebow
eyeLOCLeft Eye Outside Corner
eyelidLULeft Eyelid Upper
eyeRRight Eye
eyebowRRight Eyebow
eyeROCRight Eye Outside Corner
eyelidRURight Eyelid Upper
mouthMouth
mouthlipUMouth Upperlip
mouthlipDMouth Lowerlip
mouthLCMouth Left Corner
mouthRCMouth Right Corner
foreheadTForehead top

Additional

  • You can change all of these keywords in the CONFIG field of source code.
  • By default if the face of specific index in not detected, the corresponding scene object will be hidden. You can set it in the CONFIG field of source code.
  • You can set up Smoother.enable in your script to toggle smooth effect.

Donations

If this is useful for you, please consider a donation🙏🏼. One-time donations can be made with PayPal.

npm.io

0.2.2

4 years ago

0.2.1

4 years ago

0.1.0

4 years ago

0.1.2

4 years ago

0.2.0

4 years ago

0.1.1

4 years ago

0.1.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago