Fix some VMD export issues and some other changes (#100)
* Bug fix, improved UI layout and live vocals * Bug Fixes, New Live Compatibility * Android build support * Update build.yml * Fix issues with the new version of the game * bug fix * add config button * Improve performance * Sync fork * bug fix, new uma compatibility * Add /UserSettings to gitignore * bug fix, add live characher shader control * fix compilation errors * fix compilation errors 2 * fix the live lighting calculation logic * bug fix, add editor layout settings to gitignore * bug fix, add editor layout settings to gitignore * Add time scale keys for live * live camera bug fix * add live stage control, optimize live performance * fix build error * add uma head custom * Add tiptoes rotation for VMD export * Add a save path prompt when exporting VMD files. * Remove the debug code for body dragging. * Remove unused physics components to improve performance. * Fix incorrect VMD exports for loop animations Fix VMD motion errors during repeated recordings Fix ghost bone persistence after multiple recordings * Revert "Remove unused physics components to improve performance." This reverts commit 7a1ae7f7d13d05380f9215b653d1c6719303a458. * Reapply "Remove unused physics components to improve performance." This reverts commit fe4c05f6942198864ca06e25f17a11440961040d. * fix https://github.com/katboi01/UmaViewer/issues/95 * live timescale bug fix * bug fix for skin and tail textures in live * bug fix for skin and tail textures in live (2) * fix https://github.com/katboi01/UmaViewer/issues/108 * message ui bug fix
This commit is contained in:
@@ -5,6 +5,7 @@ using UnityEngine;
|
||||
|
||||
public class UnityCameraVMDRecorder : MonoBehaviour
|
||||
{
|
||||
public const string FileSavePath = "/../VMDRecords";
|
||||
const float WorldScaleFix = 12.5f;
|
||||
const float FPSs = 0.03333f;
|
||||
|
||||
@@ -209,8 +210,8 @@ public class UnityCameraVMDRecorder : MonoBehaviour
|
||||
/// <param name="filePath">保存先の絶対ファイルパス</param>
|
||||
public void SaveVMD()
|
||||
{
|
||||
string fileName = Application.dataPath + "/../VMDRecords/" + string.Format("Camera_{0}.vmd", DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss"));
|
||||
Directory.CreateDirectory(Application.dataPath + "/../VMDRecords");
|
||||
string fileName = $"{Application.dataPath}{FileSavePath}/{string.Format("Camera_{0}.vmd", DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss"))}";
|
||||
Directory.CreateDirectory(Application.dataPath + FileSavePath);
|
||||
if (IsRecording)
|
||||
{
|
||||
Debug.Log(targetCameraTransform.name + "VMD保存前にレコーディングをストップしてください。");
|
||||
@@ -327,7 +328,7 @@ public class UnityCameraVMDRecorder : MonoBehaviour
|
||||
|
||||
public static void SaveLiveCameraVMD(LiveEntry liveEntry,DateTime time, List<LiveCameraFrame> frames, int MultiCameraIndex = -1)
|
||||
{
|
||||
string directory = $"{Application.dataPath}/../VMDRecords/Live{liveEntry.MusicId}_{time.ToString("yyyy-MM-dd_HH-mm-ss")}/";
|
||||
string directory = $"{Application.dataPath}{FileSavePath}/Live{liveEntry.MusicId}_{time.ToString("yyyy-MM-dd_HH-mm-ss")}/";
|
||||
Directory.CreateDirectory(directory);
|
||||
string fileName = $"{directory}LiveCamera_POS.vmd";
|
||||
string fovFileName = $"{directory}LiveCamera_FOV.vmd";
|
||||
|
||||
@@ -8,6 +8,7 @@ using Gallop;
|
||||
//初期ポーズ(T,Aポーズ)の時点でアタッチ、有効化されている必要がある
|
||||
public class UnityHumanoidVMDRecorder : MonoBehaviour
|
||||
{
|
||||
public const string FileSavePath = "/../VMDRecords";
|
||||
public bool UseParentOfAll = true;
|
||||
public bool UseCenterAsParentOfAll = true;
|
||||
/// <summary>
|
||||
@@ -33,6 +34,7 @@ public class UnityHumanoidVMDRecorder : MonoBehaviour
|
||||
const float FPSs = 0.03333f;
|
||||
const string CenterNameString = "センター";
|
||||
const string GrooveNameString = "グルーブ";
|
||||
|
||||
public enum BoneNames
|
||||
{
|
||||
全ての親, センター, 左足IK, 右足IK, 上半身, 上半身2, 首, 頭,
|
||||
@@ -41,8 +43,7 @@ public class UnityHumanoidVMDRecorder : MonoBehaviour
|
||||
左薬指1, 左薬指2, 左薬指3, 左小指1, 左小指2, 左小指3, 右親指1, 右親指2,
|
||||
右人指1, 右人指2, 右人指3, 右中指1, 右中指2, 右中指3, 右薬指1, 右薬指2,
|
||||
右薬指3, 右小指1, 右小指2, 右小指3, 左足, 右足, 左ひざ, 右ひざ,
|
||||
左足首, 右足首, None
|
||||
//左つま先, 右つま先は情報付けると足首の回転、位置との矛盾が生じかねない
|
||||
左足首, 右足首, 左足先EX, 右足先EX, None
|
||||
}
|
||||
//コンストラクタにて初期化
|
||||
//全てのボーンを名前で引く辞書
|
||||
@@ -129,9 +130,8 @@ public class UnityHumanoidVMDRecorder : MonoBehaviour
|
||||
{ BoneNames.右ひざ, objs.Find(a=>a.name.Equals("Knee_R"))},
|
||||
{ BoneNames.左足首, objs.Find(a=>a.name.Equals("Ankle_L"))},
|
||||
{ BoneNames.右足首, objs.Find(a=>a.name.Equals("Ankle_R"))},
|
||||
//左つま先, 右つま先は情報付けると足首の回転、位置との矛盾が生じかねない
|
||||
//{ BoneNames.左つま先, (animator.GetBoneTransform(HumanBodyBones.LeftToes))},
|
||||
//{ BoneNames.右つま先, (animator.GetBoneTransform(HumanBodyBones.RightToes))}
|
||||
{ BoneNames.左足先EX, objs.Find(a=>a.name.Equals("Toe_L"))},
|
||||
{ BoneNames.右足先EX, objs.Find(a=>a.name.Equals("Toe_R"))}
|
||||
};
|
||||
|
||||
foreach (KeyValuePair<BoneNames, Transform> pair in BoneDictionary)
|
||||
@@ -139,9 +139,14 @@ public class UnityHumanoidVMDRecorder : MonoBehaviour
|
||||
transformDictionary.Add(pair.Key.ToString(), pair.Value);
|
||||
}
|
||||
|
||||
var animator = GetComponentInParent<UmaContainerCharacter>().UmaAnimator;
|
||||
var characterContainer = GetComponentInParent<UmaContainerCharacter>();
|
||||
var animator = characterContainer.UmaAnimator;
|
||||
var state = animator.GetCurrentAnimatorStateInfo(0);
|
||||
animator.Rebind();
|
||||
animator.enabled = false;
|
||||
|
||||
// Set to T-Pose
|
||||
characterContainer.ResetBodyPose();
|
||||
characterContainer.UpBodyReset();
|
||||
|
||||
BoneDictionary[BoneNames.左腕].Rotate(0, 0, -aposeDegress);
|
||||
BoneDictionary[BoneNames.右腕].Rotate(0, 0, aposeDegress);
|
||||
@@ -169,6 +174,9 @@ public class UnityHumanoidVMDRecorder : MonoBehaviour
|
||||
boneGhost = new BoneGhost(BoneDictionary, UseBottomCenter);
|
||||
morphRecorder = new MorphRecorder(transform);
|
||||
|
||||
BoneDictionary[BoneNames.左腕].Rotate(0, 0, aposeDegress);
|
||||
BoneDictionary[BoneNames.右腕].Rotate(0, 0, -aposeDegress);
|
||||
animator.enabled = true;
|
||||
animator.Play(state.shortNameHash, 0, state.normalizedTime);
|
||||
}
|
||||
|
||||
@@ -602,6 +610,13 @@ public class UnityHumanoidVMDRecorder : MonoBehaviour
|
||||
binaryWriter.Close();
|
||||
}
|
||||
}
|
||||
if (boneGhost != null)
|
||||
{
|
||||
foreach(var pair in boneGhost.GhostDictionary)
|
||||
{
|
||||
Destroy(pair.Value.ghost.gameObject);
|
||||
}
|
||||
}
|
||||
Destroy(this);
|
||||
}
|
||||
|
||||
@@ -614,15 +629,15 @@ public class UnityHumanoidVMDRecorder : MonoBehaviour
|
||||
/// <param name="keyReductionLevel">キーの書き込み頻度を減らして容量を減らす</param>
|
||||
public void SaveVMD(string modelName, int keyReductionLevel = 3)
|
||||
{
|
||||
string fileName = Application.dataPath + "/../VMDRecords/" + string.Format("UMA_{0}.vmd", DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss"));
|
||||
Directory.CreateDirectory(Application.dataPath + "/../VMDRecords");
|
||||
string fileName = $"{Application.dataPath}{FileSavePath}/{string.Format("UMA_{0}.vmd", DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss"))}";
|
||||
Directory.CreateDirectory(Application.dataPath + FileSavePath);
|
||||
KeyReductionLevel = keyReductionLevel;
|
||||
SaveVMD(modelName, fileName);
|
||||
}
|
||||
|
||||
public void SaveLiveVMD(LiveEntry liveEntry, DateTime time ,string modelName, int keyReductionLevel = 3)
|
||||
{
|
||||
string fileName = $"{Application.dataPath}/../VMDRecords/Live{liveEntry.MusicId}_{time.ToString("yyyy-MM-dd_HH-mm-ss")}/{modelName}.vmd";
|
||||
string fileName = $"{Application.dataPath}{FileSavePath}/Live{liveEntry.MusicId}_{time.ToString("yyyy-MM-dd_HH-mm-ss")}/{modelName}.vmd";
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(fileName));
|
||||
KeyReductionLevel = keyReductionLevel;
|
||||
SaveVMD(modelName, fileName);
|
||||
@@ -655,9 +670,11 @@ public class UnityHumanoidVMDRecorder : MonoBehaviour
|
||||
{ BoneNames.左足, (BoneNames.None, BoneNames.None, BoneNames.センター) },
|
||||
{ BoneNames.左ひざ, (BoneNames.None, BoneNames.None, BoneNames.左足) },
|
||||
{ BoneNames.左足首, (BoneNames.None, BoneNames.None, BoneNames.左ひざ) },
|
||||
{ BoneNames.左足先EX, (BoneNames.None, BoneNames.None, BoneNames.左足首) },
|
||||
{ BoneNames.右足, (BoneNames.None, BoneNames.None, BoneNames.センター) },
|
||||
{ BoneNames.右ひざ, (BoneNames.None, BoneNames.None, BoneNames.右足) },
|
||||
{ BoneNames.右足首, (BoneNames.None, BoneNames.None, BoneNames.右ひざ) },
|
||||
{ BoneNames.右足先EX, (BoneNames.None, BoneNames.None, BoneNames.右足首) },
|
||||
{ BoneNames.上半身, (BoneNames.None, BoneNames.None, BoneNames.センター) },
|
||||
{ BoneNames.上半身2, (BoneNames.None, BoneNames.None, BoneNames.上半身) },
|
||||
{ BoneNames.首, (BoneNames.上半身2, BoneNames.None, BoneNames.上半身) },
|
||||
|
||||
Reference in New Issue
Block a user