Skip to content

Unity API

Namespaces: Vidrip.Mimic.Unity (components) and Vidrip.Mimic (engine, events, profiles).

Member
Source The MimicFaceSource to read. Setting it rebuilds the engine.
SpecProfile Phone, Web or WebLaptop; see threshold sets
Bindings Inspector rows: gesture → onStart(float strength) / onEnd()
On(Gesture, Action<GestureEvent>) / On(string pattern, …) Subscribe in code; returns an unsubscribe Action
IsActive(Gesture) Whether a gesture is held now
StartCalibration(callback), CancelCalibration(), Calibrating, Calibration Calibration (MimicCalibration wraps these)
Profile, SetProfile(profile) The installed CalibrationProfile (ToJson() / CalibrationProfile.FromJson())
Latest The last frame’s measurements, for HUDs
Unsupported Gestures the source can’t feed
SetExpressionTarget(float[]), ResetGestures() Expression target; forget held gestures

Events are delivered on the main thread during Update. Binding a gesture the source can’t feed logs a warning naming the missing capability.

Member
Begin(), Forget() Start calibrating; delete the stored profile
CalibrateOnStart, RememberProfile Inspector options; the profile is kept in PlayerPrefs
onProgress(float), onPrompt(string), onCalibrated(), onFailed(string) UnityEvents for your UI; prompts and failures are player-ready text
PromptFor(quality), FailureText(status) The same texts, if you build your own
Component
MimicMediaPipeSource The camera. deviceName, requestedWidth / Height / Fps, inference (CPU/GPU), optional model. RecommendedProfile picks the threshold set for the platform. Compiles only with the MediaPipe Unity Plugin installed.
MimicSimulatedSource Inspector-driven face: eyes, gaze, smile, mouth, brows, head pose; Blink(), WinkLeft(), WinkRight().
MimicFaceSource (abstract) Base for your own: Caps, Publish(FaceSample), IsReady, Status, PreviewTexture, PreviewUv.

Begin(note), End(), Label, FilePath, Frames. Writes the source’s samples as JSONL, one frame per line, tagged with the current Label.

Gesture.Blink, BlinkLeft, BlinkRight, EyesAway, EyesLeft, EyesRight, EyesUp, Smile, Laugh, MouthOpen, HeadLeft, HeadRight, HeadUp, HeadDown, HeadNeutral, FaceFound, FaceLost, ExpressionMatch, BrowsRaise, HeadTiltLeft, HeadTiltRight. gesture.Id() gives the dotted id; GestureExtensions.TryParse(id, out gesture) goes the other way.