Skip to main content

How to change feature parameters using scripting api

Since v1.6.1, Banuba SDK provides an oportunity to change some feature parameters using scripting engine:

bnb.scene.addFeatureParam(bnb.FeatureID.ID, [])

The first parameter is the feature id with a type bnb.FeatureID. The second parameter is the Array of bnb.FeatureParameter. bnb.FeatureParameter is similiar to vector4 type and contains x,y,z,w fields.

List of all features with changing parameters

featuretype name
ringbnb.FeatureID.RING
nailsbnb.FeatureID.NAILS

Ring

As an input, the Ring feature takes only the first element of the array where x is the id of selected finger. At the the moment, this feature supports 4 fingers:

  • Index - 0
  • Middle - 1
  • Ring - 2
  • Small - 3

Here is example of how to set the middle finger:

let middle_finger_id = 1;
let param = new bnb.FeatureParameter(middle_finger_id,0,0,0);
bnb.scene.addFeatureParam(bnb.FeatureID.RING, [param])