forked from dfgHiatus/VRCFT-Babble
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(fix) Fix an issue where mouth L/R expressions weren't being mapped
- Loading branch information
Showing
7 changed files
with
411 additions
and
231 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using Newtonsoft.Json; | ||
using System.Reflection; | ||
|
||
namespace VRCFaceTracking.Babble; | ||
|
||
public static class BabbleConfig | ||
{ | ||
private const string BabbleConfigFile = "BabbleConfig.json"; | ||
|
||
public static Config GetBabbleConfig() | ||
{ | ||
string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!; | ||
string path = Path.Combine(directoryName, "BabbleConfig.json"); | ||
string value = File.ReadAllText(path); | ||
return JsonConvert.DeserializeObject<Config>(value)!; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,86 +1,286 @@ | ||
using Newtonsoft.Json; | ||
using System.Reflection; | ||
using VRCFaceTracking.Babble.Collections; | ||
using VRCFaceTracking.Core.Params.Expressions; | ||
using VRCFaceTracking.Babble.Collections; | ||
|
||
namespace VRCFaceTracking.Babble; | ||
|
||
public static class BabbleExpressions | ||
{ | ||
// private const string BabbleExpressionsPath = "BabbleExpressions.json"; | ||
|
||
// public static readonly TwoKeyDictionary<UnifiedExpressions, string, float> BabbleExpressionMap; | ||
// static BabbleExpressions() | ||
// { | ||
// var expressions = Path.Combine( | ||
// Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, | ||
// BabbleExpressionsPath); | ||
// var converter = new TwoKeyDictionaryConverter<UnifiedExpressions, string, float>(); | ||
// if (!File.Exists(expressions)) | ||
// { | ||
// string json = JsonConvert.SerializeObject( | ||
// DefaultBabbleExpressionMap, converter); | ||
// File.WriteAllText(expressions, json); | ||
// } | ||
|
||
// BabbleExpressionMap = JsonConvert.DeserializeObject | ||
// <TwoKeyDictionary<UnifiedExpressions, string, float>> | ||
// (File.ReadAllText(expressions), converter)!; | ||
// } | ||
|
||
private static readonly TwoKeyDictionary<UnifiedExpressions, string, float> BabbleExpressionMap = new() | ||
public static readonly TwoKeyDictionary<UnifiedExpressions, string, float> BabbleExpressionMap = new TwoKeyDictionary<UnifiedExpressions, string, float> | ||
{ | ||
{ UnifiedExpressions.CheekPuffLeft, "/cheekPuffLeft", 0f }, | ||
{ UnifiedExpressions.CheekPuffRight, "/cheekPuffRight", 0f }, | ||
{ UnifiedExpressions.CheekSuckLeft, "/cheekSuckLeft", 0f }, | ||
{ UnifiedExpressions.CheekSuckRight, "/cheekSuckRight", 0f }, | ||
{ UnifiedExpressions.JawOpen, "/jawOpen", 0f }, | ||
{ UnifiedExpressions.JawForward, "/jawForward", 0f }, | ||
{ UnifiedExpressions.JawLeft, "/jawLeft", 0f }, | ||
{ UnifiedExpressions.JawRight, "/jawRight", 0f }, | ||
{ UnifiedExpressions.NoseSneerLeft, "/noseSneerLeft", 0f }, | ||
{ UnifiedExpressions.NoseSneerRight, "/noseSneerRight", 0f }, | ||
{ UnifiedExpressions.LipFunnelLowerLeft, "/mouthFunnel", 0f }, | ||
{ UnifiedExpressions.LipFunnelLowerRight, "/mouthFunnel", 0f }, | ||
{ UnifiedExpressions.LipFunnelUpperLeft, "/mouthFunnel", 0f }, | ||
{ UnifiedExpressions.LipFunnelUpperRight, "/mouthFunnel", 0f }, | ||
{ UnifiedExpressions.LipPuckerLowerLeft, "/mouthPucker", 0f }, | ||
{ UnifiedExpressions.LipPuckerLowerRight, "/mouthPucker", 0f }, | ||
{ UnifiedExpressions.LipPuckerUpperLeft, "/mouthPucker", 0f }, | ||
{ UnifiedExpressions.LipPuckerUpperRight, "/mouthPucker", 0f }, | ||
{ UnifiedExpressions.MouthPressLeft, "/mouthLeft", 0f }, | ||
{ UnifiedExpressions.MouthPressRight, "/mouthRight", 0f }, | ||
{ UnifiedExpressions.LipSuckUpperLeft, "/mouthRollUpper", 0f }, | ||
{ UnifiedExpressions.LipSuckUpperRight, "/mouthRollUpper", 0f }, | ||
{ UnifiedExpressions.LipSuckLowerLeft, "/mouthRollLower", 0f }, | ||
{ UnifiedExpressions.LipSuckLowerRight, "/mouthRollLower", 0f }, | ||
{ UnifiedExpressions.MouthRaiserUpper, "/mouthShrugUpper", 0f }, | ||
{ UnifiedExpressions.MouthRaiserLower, "/mouthShrugLower", 0f }, | ||
{ UnifiedExpressions.MouthClosed, "/mouthClose", 0f }, | ||
{ UnifiedExpressions.MouthCornerPullLeft, "/mouthSmileLeft", 0f }, | ||
{ UnifiedExpressions.MouthCornerPullRight, "/mouthSmileRight", 0f }, | ||
{ UnifiedExpressions.MouthFrownLeft, "/mouthFrownLeft", 0f }, | ||
{ UnifiedExpressions.MouthFrownRight, "/mouthFrownRight", 0f }, | ||
{ UnifiedExpressions.MouthDimpleLeft, "/mouthDimpleLeft", 0f }, | ||
{ UnifiedExpressions.MouthDimpleRight, "/mouthDimpleRight", 0f }, | ||
{ UnifiedExpressions.MouthUpperUpLeft, "/mouthUpperUpLeft", 0f }, | ||
{ UnifiedExpressions.MouthUpperUpRight, "/mouthUpperUpRight", 0f }, | ||
{ UnifiedExpressions.MouthLowerDownLeft, "/mouthLowerDownLeft", 0f }, | ||
{ UnifiedExpressions.MouthLowerDownRight, "/mouthLowerDownRight", 0f }, | ||
{ UnifiedExpressions.MouthPressLeft, "/mouthPressLeft", 0f }, | ||
{ UnifiedExpressions.MouthPressRight, "/mouthPressRight", 0f }, | ||
{ UnifiedExpressions.MouthStretchLeft, "/mouthStretchLeft", 0f }, | ||
{ UnifiedExpressions.MouthStretchRight, "/mouthStretchRight", 0f }, | ||
{ UnifiedExpressions.TongueOut, "/tongueOut", 0f }, | ||
{ UnifiedExpressions.TongueUp, "/tongueUp", 0f }, | ||
{ UnifiedExpressions.TongueDown, "/tongueDown", 0f }, | ||
{ UnifiedExpressions.TongueLeft, "/tongueLeft", 0f }, | ||
{ UnifiedExpressions.TongueRight, "/tongueRight", 0f }, | ||
{ UnifiedExpressions.TongueRoll, "/tongueRoll", 0f }, | ||
{ UnifiedExpressions.TongueBendDown, "/tongueBendDown", 0f }, | ||
{ UnifiedExpressions.TongueCurlUp, "/tongueCurlUp", 0f }, | ||
{ UnifiedExpressions.TongueSquish, "/tongueSquish", 0f }, | ||
{ UnifiedExpressions.TongueFlat, "/tongueFlat", 0f }, | ||
{ UnifiedExpressions.TongueTwistLeft, "/tongueTwistLeft", 0f }, | ||
{ UnifiedExpressions.TongueTwistRight, "/tongueTwistRight", 0 } | ||
{ | ||
UnifiedExpressions.CheekPuffLeft, | ||
"/cheekPuffLeft", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.CheekPuffRight, | ||
"/cheekPuffRight", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.CheekSuckLeft, | ||
"/cheekSuckLeft", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.CheekSuckRight, | ||
"/cheekSuckRight", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.JawOpen, | ||
"/jawOpen", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.JawForward, | ||
"/jawForward", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.JawLeft, | ||
"/jawLeft", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.JawRight, | ||
"/jawRight", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.NoseSneerLeft, | ||
"/noseSneerLeft", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.NoseSneerRight, | ||
"/noseSneerRight", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.LipFunnelLowerLeft, | ||
"/mouthFunnel", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.LipFunnelLowerRight, | ||
"/mouthFunnel", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.LipFunnelUpperLeft, | ||
"/mouthFunnel", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.LipFunnelUpperRight, | ||
"/mouthFunnel", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.LipPuckerLowerLeft, | ||
"/mouthPucker", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.LipPuckerLowerRight, | ||
"/mouthPucker", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.LipPuckerUpperLeft, | ||
"/mouthPucker", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.LipPuckerUpperRight, | ||
"/mouthPucker", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.MouthUpperLeft, | ||
"/mouthLeft", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.MouthLowerLeft, | ||
"/mouthLeft", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.MouthUpperRight, | ||
"/mouthRight", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.MouthLowerRight, | ||
"/mouthRight", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.LipSuckUpperLeft, | ||
"/mouthRollUpper", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.LipSuckUpperRight, | ||
"/mouthRollUpper", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.LipSuckLowerLeft, | ||
"/mouthRollLower", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.LipSuckLowerRight, | ||
"/mouthRollLower", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.MouthRaiserUpper, | ||
"/mouthShrugUpper", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.MouthRaiserLower, | ||
"/mouthShrugLower", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.MouthClosed, | ||
"/mouthClose", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.MouthCornerPullLeft, | ||
"/mouthSmileLeft", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.MouthCornerPullRight, | ||
"/mouthSmileRight", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.MouthFrownLeft, | ||
"/mouthFrownLeft", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.MouthFrownRight, | ||
"/mouthFrownRight", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.MouthDimpleLeft, | ||
"/mouthDimpleLeft", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.MouthDimpleRight, | ||
"/mouthDimpleRight", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.MouthUpperUpLeft, | ||
"/mouthUpperUpLeft", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.MouthUpperUpRight, | ||
"/mouthUpperUpRight", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.MouthLowerDownLeft, | ||
"/mouthLowerDownLeft", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.MouthLowerDownRight, | ||
"/mouthLowerDownRight", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.MouthPressLeft, | ||
"/mouthPressLeft", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.MouthPressRight, | ||
"/mouthPressRight", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.MouthStretchLeft, | ||
"/mouthStretchLeft", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.MouthStretchRight, | ||
"/mouthStretchRight", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.TongueOut, | ||
"/tongueOut", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.TongueUp, | ||
"/tongueUp", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.TongueDown, | ||
"/tongueDown", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.TongueLeft, | ||
"/tongueLeft", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.TongueRight, | ||
"/tongueRight", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.TongueRoll, | ||
"/tongueRoll", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.TongueBendDown, | ||
"/tongueBendDown", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.TongueCurlUp, | ||
"/tongueCurlUp", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.TongueSquish, | ||
"/tongueSquish", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.TongueFlat, | ||
"/tongueFlat", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.TongueTwistLeft, | ||
"/tongueTwistLeft", | ||
0f | ||
}, | ||
{ | ||
UnifiedExpressions.TongueTwistRight, | ||
"/tongueTwistRight", | ||
0f | ||
} | ||
}; | ||
} |
Oops, something went wrong.