UmaController Configuration Data
The following information details the helper data used for UmaController
configuration. Accessing the UmaController
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
Salsa.visemes[index].expData.components[componentIndex]
Salsa.visemes[index].expData.controllerVars[componentIndex]
Helper Data:
<UmaUepProxy> controllerVars[componentIndex].umaUepProxy
: Minnow class that controls the UMA ExpressionPlayer.<int> controllerVars[componentIndex].blendIndex
: UMA ExpressionPlayer expression index.<float> controllerVars[componentIndex].uepAmount
: ON/maximum/ending UMA expression weight [-1f .. 1f].
Example: To configure an UMA 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...
UmaUepProxy uupToAnimate; // you will need to set this...
int umaExpressionIndexToAnimate; // you will need to set this...
// Since the previous example set this to a 'shape' controller, change the controller type to 'uma'...
expressionComponent.controlType = ExpressionComponent.ControlType.Uma;
// cache the controllerVar data -- assuming the first component in the expression.
InspectorControllerHelperData controllerVar = expressionData.controllerVars[0];
controllerVar.umaUepProxy = uupToAnimate;
controllerVar.blendIndex = umaExpressionIndexToAnimate;
controllerVar.uepAmount = 1.0f; // your preferred value.
Custom UMA ExpressionPlayer Pose Definitions
It is possible to modify the pose definitions at runtime. This will not be reflected in the Inspector at design-time. But will reflect in the Inspector at run-time. This requires creating a custom pose definition set and then initializing that set with the appropriate UmaUepProxy
. NOTE: The pose names must match up with your custom UMA pose names.
using UnityEngine;
using CrazyMinnow.SALSA;
namespace DemoCode
{
public class TEST_CustomUmaPoseDefs : MonoBehaviour
{
public UmaUepProxy uup;
public static UmaUepProxy.UepPoseDef[] CustomInUepPoseDefs = new UmaUepProxy.UepPoseDef[]
{
// hypothetical pose name definitions...the boolean indicates a bi-directional
// pose weight value...i.e. frown (-1) .. (1) smile
new UmaUepProxy.UepPoseDef("custom-pose-1", true),
new UmaUepProxy.UepPoseDef("custom-pose-2", false),
new UmaUepProxy.UepPoseDef("custom-pose-3", false;),
new UmaUepProxy.UepPoseDef("custom-pose-4", true),
};
private void Start()
{
uup.InitializeUmaUepPoses(CustomInUepPoseDefs);
}
}
}
UMA has some special requirements and considerations for run-time configuration and re-linking. See the UMA Considerations for Runtime Setup for more information.
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.