ShapeController Configuration Data

The following information details the helper data used for ShapeController configuration. Accessing the ShapeController variables in the helper data requires an index to the list. Keep in mind, for every data set in the components configuration there is a corresponding set of helper data in controllerVars, so the index will be the same. See the previous page discussing configuration data for supporting information.

i.e. For SALSA

Helper Data:

  • <SkinnedMeshRenderer> controllerVars[componentIndex].smr: SkinnedMeshRenderer with blendshapes.
  • <int> controllerVars[componentIndex].blendIndex: blendshape index.
  • <float> controllerVars[componentIndex].minShape: OFF/minimum/starting blendshape weight.
  • <float> controllerVars[componentIndex].maxShape: ON/maximum/ending blendshape weight.

Example: To configure a shape controller's data (continuing on from the SALSA example on the previous page):

NOTE: This is not a fully operational copy/paste example since some variables will need to be set from your specific project implementation.

// ...
// continuing from the SALSA example...

SkinnedMeshRenderer smrToAnimate; // you will need to set this...
int blendshapeIndexToAnimate; // you will need to set this...

// The previous example alread set this to a 'shape' no need to adjust it here.

// cache the controllerVar data -- assuming the first component in the expression.
InspectorControllerHelperData controllerVar = expressionData.controllerVars[0];
controllerVar.smr = smrToAnimate;
controllerVar.blendIndex = blendshapeIndexToAnimate;
controllerVar.minShape = 0.0f; // typical min value.
controllerVar.maxShape = 1.0f; // your preferred value.

Return to the Runtime Setup documentation to finalize by baking the controller helper data into the ExpressionController.

NOTE: We have tried to make the above information useful and complete. Please let us know if you discover errors, omissions, or need some clarity.