add morph convert config

This commit is contained in:
CroakFang
2023-07-30 14:54:00 +08:00
parent 2a26536d74
commit eb3173f6ac
4 changed files with 92 additions and 55 deletions
+76 -1
View File
@@ -1,4 +1,5 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using UnityEngine;
@@ -17,6 +18,67 @@ public class Config
public string WorkModeTip = "Affects how application work, options: 0 - work with game client, 1 - work without game client(slow), Database needs to be updated manually";
public WorkMode WorkMode = WorkMode.Default;
public List<MorphConvertConfig> MorphConvertSetting = new List<MorphConvertConfig>
{
new MorphConvertConfig("にこり右", new string[] { "EyeBrow_1_R" }),
new MorphConvertConfig("にこり左", new string[] { "EyeBrow_1_L" }),
new MorphConvertConfig("真面目右", new string[] { "EyeBrow_17_R" }),
new MorphConvertConfig("真面目左", new string[] { "EyeBrow_17_L" }),
new MorphConvertConfig("困る右", new string[] { "EyeBrow_6_R", "EyeBrow_12_R" }),
new MorphConvertConfig("困る左", new string[] { "EyeBrow_6_L" }),
new MorphConvertConfig("困る2", new string[] { "EyeBrow_13_L", "EyeBrow_20_L", "EyeBrow_10_L" }),
new MorphConvertConfig("怒り右", new string[] { "EyeBrow_5_R", "EyeBrow_15_R", "EyeBrow_16_R", "EyeBrow_19_R", "EyeBrow_7_R" }),
new MorphConvertConfig("怒り左", new string[] { "EyeBrow_5_L", "EyeBrow_15_L", "EyeBrow_16_L", "EyeBrow_19_L", "EyeBrow_7_L" }),
new MorphConvertConfig("怒り2", new string[] { "EyeBrow_18_L" }),
new MorphConvertConfig("下右", new string[] { "EyeBrow_14_R", "EyeBrow_22_R", "EyeBrow_11_R" }),
new MorphConvertConfig("下左", new string[] { "EyeBrow_14_L", "EyeBrow_22_L", "EyeBrow_11_L" }),
new MorphConvertConfig("上右", new string[] { "EyeBrow_21_R" }),
new MorphConvertConfig("上左", new string[] { "EyeBrow_21_L" }),
new MorphConvertConfig("眉左", new string[] { "EyeBrow_23_L", "EyeBrow_23_R" }),
new MorphConvertConfig("眉右", new string[] { "EyeBrow_24_L", "EyeBrow_24_R" }),
new MorphConvertConfig("ウィンク2右", new string[] { "Eye_2_R" }),
new MorphConvertConfig("ウィンク2", new string[] { "Eye_2_L" }),
new MorphConvertConfig("ウィンク右", new string[] { "Eye_5_R", "Eye_8_R" }),
new MorphConvertConfig("ウィンク", new string[] { "Eye_5_L", "Eye_8_L" }),
new MorphConvertConfig("キリッ", new string[] { "Eye_9_L", "Eye_10_L", "Eye_11_L", "Eye_18_L" }),
new MorphConvertConfig("なごみ", new string[] { "Eye_16_L" }),
new MorphConvertConfig("びっくり", new string[] { "Eye_12_L" }),
new MorphConvertConfig("じと目", new string[] { "Eye_15_L" }),
new MorphConvertConfig("瞳小", new string[] { "Eye_14_L" }),
new MorphConvertConfig("笑い目", new string[] { "Eye_19_L" }),
new MorphConvertConfig("笑い目2", new string[] { "Eye_23_L" }),
new MorphConvertConfig("ぷく~_左", new string[] { "Mouth_2_0" }),
new MorphConvertConfig("ぷく~_右", new string[] { "Mouth_3_0" }),
new MorphConvertConfig("ん", new string[] { "Mouth_9_0" }),
new MorphConvertConfig("~~", new string[] { "Mouth_44_0", "Mouth_11_0" }),
new MorphConvertConfig("にっこり", new string[] { "Mouth_12_0" }),
new MorphConvertConfig("口角上げ", new string[] { "Mouth_13_0" }),
new MorphConvertConfig("□", new string[] { "Mouth_15_0" }),
new MorphConvertConfig("▲", new string[] { "Mouth_16_0" }),
new MorphConvertConfig("ω□", new string[] { "Mouth_17_0" }),
new MorphConvertConfig("にやり2", new string[] { "Mouth_18_0" }),
new MorphConvertConfig("にやり3", new string[] { "Mouth_19_0" }),
new MorphConvertConfig("にやり", new string[] { "Mouth_1_0", "Mouth_4_0", "Mouth_22_0" }),
new MorphConvertConfig("にぃー", new string[] { "Mouth_26_0" }),
new MorphConvertConfig("あ", new string[] { "Mouth_5_0", "Mouth_6_0", "Mouth_7_0", "Mouth_23_0" }),
new MorphConvertConfig("い", new string[] { "Mouth_25_0", "Mouth_35_0", "Mouth_36_0", "Mouth_8_0" }),
new MorphConvertConfig("う", new string[] { "Mouth_28_0", "Mouth_27_0" }),
new MorphConvertConfig("お", new string[] { "Mouth_31_0", "Mouth_10_0", "Mouth_14_0" }),
new MorphConvertConfig("え", new string[] { "Mouth_29_0", "Mouth_30_0", "Mouth_37_0", "Mouth_33_0" }),
new MorphConvertConfig("口角下げ", new string[] { "Mouth_41_0" }),
new MorphConvertConfig("ぺろっ", new string[] { "Mouth_45_0" }),
new MorphConvertConfig("てへぺろ", new string[] { "Mouth_46_0" }),
new MorphConvertConfig("ぺろっ2", new string[] { "Mouth_47_0" }),
new MorphConvertConfig("てへぺろ2", new string[] { "Mouth_48_0" }),
new MorphConvertConfig("ぺろっ3", new string[] { "Mouth_49_0" }),
new MorphConvertConfig("口上", new string[] { "Mouth_50_0" }),
new MorphConvertConfig("口下", new string[] { "Mouth_51_0" }),
new MorphConvertConfig("口左", new string[] { "Mouth_52_0" }),
new MorphConvertConfig("口右", new string[] { "Mouth_53_0" }),
new MorphConvertConfig("口横広げ", new string[] { "Mouth_54_0" }),
new MorphConvertConfig("口横狭い", new string[] { "Mouth_55_0" })
};
public Config()
{
@@ -61,4 +123,17 @@ public enum WorkMode
{
Default,
Standalone
}
[Serializable]
public class MorphConvertConfig
{
public string MMDMorph;
public List<string> UMAMorph;
public MorphConvertConfig(string mmdMorph, string[] umaMorphs)
{
UMAMorph = new List<string>(umaMorphs);
MMDMorph = mmdMorph;
}
}
@@ -417,10 +417,9 @@ public class UnityHumanoidVMDRecorder : MonoBehaviour
{
for (int i = 0; i < frameNumberSaved; i++)
{
if ((i % KeyReductionLevel) != 0) { continue; }
foreach (BoneNames boneName in Enum.GetValues(typeof(BoneNames)))
{
if ((i % KeyReductionLevel) != 0 && boneName != BoneNames.全ての親) { continue; }
if (!BoneDictionary.Keys.Contains(boneName)) { continue; }
if (BoneDictionary[boneName] == null) { continue; }
if (!UseParentOfAll && boneName == BoneNames.全ての親) { continue; }
@@ -817,60 +816,24 @@ public class UnityHumanoidVMDRecorder : MonoBehaviour
}
}
public string ConvertMorphName(string name)
{
switch (name)
if (Config.Instance.MorphConvertSetting.Count > 0)
{
case "EyeBrow_1_R": return "にこり右";
case "EyeBrow_1_L": return "にこり左";
case "EyeBrow_5_R": return "真面目右";
case "EyeBrow_5_L": return "真面目左";
case "EyeBrow_6_R": return "困る右";
case "EyeBrow_6_L": return "困る左";
case "EyeBrow_7_R": return "怒り右";
case "EyeBrow_7_L": return "怒り左";
case "EyeBrow_11_R": return "下右";
case "EyeBrow_11_L": return "下左";
case "EyeBrow_21_R": return "上右";
case "EyeBrow_21_L": return "上左";
case "Eye_2_R": return "ウィンク2右";
case "Eye_2_L": return "ウィンク2";
case "Eye_5_R": return "ウィンク右";
case "Eye_5_L": return "ウィンク";
case "Eye_8_R": return "ウィンク右";
case "Eye_8_L": return "ウィンク";
case "Eye_9_L":
case "Eye_10_L":
case "Eye_11_L":
case "Eye_18_L": return "キリッ";
case "Eye_16_L": return "なごみ";
case "Eye_12_L": return "びっくり";
case "Eye_15_L": return "じと目";
case "Eye_14_L": return "瞳小";
case "Mouth_9_0": return "ん";
case "Mouth_12_0": return "にっこり";
case "Mouth_13_0": return "口角上げ";
case "Mouth_22_0": return "にやり";
case "Mouth_5_0":
case "Mouth_6_0":
case "Mouth_7_0":
case "Mouth_23_0": return "あ";
case "Mouth_25_0":
case "Mouth_8_0": return "い";
case "Mouth_28_0":
case "Mouth_16_0": return "う";
case "Mouth_31_0":
case "Mouth_10_0":
case "Mouth_14_0": return "お";
case "Mouth_33_0": return "え";
case "Mouth_41_0": return "口角下げ";
case "Mouth_45_0": return "ぺろっ";
case "Mouth_54_0": return "口横広げ";
case "Mouth_55_0": return "口横狭い";
default: return name;
var setting = Config.Instance.MorphConvertSetting;
foreach (var val in setting)
{
foreach (var v in val.UMAMorph)
{
if(v.Equals(name))
{
return val.MMDMorph;
}
}
}
}
return name;
}
public void RecrodAllMorph()
-1
View File
@@ -22,7 +22,6 @@ public class UmaViewerAudio
static public UmaSoundInfo getSoundPath(string name)
{
//Debug.Log(name);
UmaSoundInfo info;
info.awb = Main.AbSounds.FirstOrDefault(a => a.Name.Contains(name) && a.Name.EndsWith("awb"));
return info;
@@ -729,7 +729,7 @@ namespace Gallop.Live
if (recorder.IsRecording)
{
recorder.StopRecording();
recorder.SaveLiveVMD($"Live{live.MusicId}_Pos{CharaContainerScript.IndexOf(container)}", 1);
recorder.SaveLiveVMD($"Live{live.MusicId}_Pos{CharaContainerScript.IndexOf(container)}");
}
}
}