forked from dfgHiatus/VRCFT-Babble
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BabbleVRC.cs
41 lines (35 loc) · 1.4 KB
/
BabbleVRC.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System.Reflection;
using VRCFaceTracking.Core.Params.Expressions;
namespace VRCFaceTracking.Babble;
public class BabbleVRC : ExtTrackingModule
{
private BabbleOSC babbleOSC;
public override (bool SupportsEye, bool SupportsExpression) Supported => (false, true);
public override (bool eyeSuccess, bool expressionSuccess) Initialize(bool eyeAvailable, bool expressionAvailable)
{
Config babbleConfig = BabbleConfig.GetBabbleConfig();
babbleOSC = new BabbleOSC(Logger, babbleConfig.Host, babbleConfig.Port);
List<Stream> list = new List<Stream>();
Assembly executingAssembly = Assembly.GetExecutingAssembly();
Stream manifestResourceStream = executingAssembly.GetManifestResourceStream("VRCFaceTracking.Babble.BabbleLogo.png")!;
list.Add(manifestResourceStream);
ModuleInformation = new ModuleMetadata
{
Name = "Project Babble Face Tracking\nInference Model v2.1.1",
StaticImages = list
};
return (false, true);
}
public override void Teardown()
{
babbleOSC.Teardown();
}
public override void Update()
{
foreach (UnifiedExpressions expression in BabbleExpressions.BabbleExpressionMap)
{
UnifiedTracking.Data.Shapes[(int)expression].Weight = BabbleExpressions.BabbleExpressionMap.GetByKey1(expression);
}
Thread.Sleep(10);
}
}