bug fix
This commit is contained in:
@@ -325,17 +325,16 @@ public class UnityCameraVMDRecorder : MonoBehaviour
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void SaveLiveCameraVMD(List<LiveCameraFrame> frames, int MultiCameraIndex = -1)
|
public static void SaveLiveCameraVMD(LiveEntry liveEntry,DateTime time, List<LiveCameraFrame> frames, int MultiCameraIndex = -1)
|
||||||
{
|
{
|
||||||
string directory = $"{Application.dataPath}/../VMDRecords/";
|
string directory = $"{Application.dataPath}/../VMDRecords/Live{liveEntry.MusicId}_{time.ToString("yyyy-MM-dd_HH-mm-ss")}/";
|
||||||
Directory.CreateDirectory(directory);
|
Directory.CreateDirectory(directory);
|
||||||
var time = DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss");
|
string fileName = $"{directory}LiveCamera_POS.vmd";
|
||||||
string fileName = $"{directory}LiveCamera_POS_{time}.vmd";
|
string fovFileName = $"{directory}LiveCamera_FOV.vmd";
|
||||||
string fovFileName = $"{directory}LiveCamera_FOV_{time}.vmd";
|
|
||||||
if(MultiCameraIndex >= 0)
|
if(MultiCameraIndex >= 0)
|
||||||
{
|
{
|
||||||
fileName = $"{directory}LiveMultiCamera{MultiCameraIndex}_POS_{time}.vmd";
|
fileName = $"{directory}LiveMultiCamera{MultiCameraIndex}_POS.vmd";
|
||||||
fovFileName = $"{directory}LiveMultiCamera{MultiCameraIndex}_FOV_{time}.vmd";
|
fovFileName = $"{directory}LiveMultiCamera{MultiCameraIndex}_FOV.vmd";
|
||||||
}
|
}
|
||||||
|
|
||||||
const string modelName = "カメラ・照明";
|
const string modelName = "カメラ・照明";
|
||||||
|
|||||||
@@ -596,10 +596,10 @@ public class UnityHumanoidVMDRecorder : MonoBehaviour
|
|||||||
SaveVMD(modelName, fileName);
|
SaveVMD(modelName, fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SaveLiveVMD(string modelName, int keyReductionLevel = 3)
|
public void SaveLiveVMD(LiveEntry liveEntry, DateTime time ,string modelName, int keyReductionLevel = 3)
|
||||||
{
|
{
|
||||||
string fileName = Application.dataPath + "/../VMDRecords/" + string.Format("{0}_{1}.vmd", modelName, DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss"));
|
string fileName = $"{Application.dataPath}/../VMDRecords/Live{liveEntry.MusicId}_{time.ToString("yyyy-MM-dd_HH-mm-ss")}/{modelName}.vmd";
|
||||||
Directory.CreateDirectory(Application.dataPath + "/../VMDRecords");
|
Directory.CreateDirectory(Path.GetDirectoryName(fileName));
|
||||||
KeyReductionLevel = keyReductionLevel;
|
KeyReductionLevel = keyReductionLevel;
|
||||||
SaveVMD(modelName, fileName);
|
SaveVMD(modelName, fileName);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -387,7 +387,8 @@ namespace Gallop.Live
|
|||||||
|
|
||||||
var characterStandPos = this._liveTimelineControl.transform.Find("CharacterStandPos");
|
var characterStandPos = this._liveTimelineControl.transform.Find("CharacterStandPos");
|
||||||
int counter = 0;
|
int counter = 0;
|
||||||
foreach (Transform trans in characterStandPos.GetComponentsInChildren<Transform>()) {
|
foreach (Transform trans in characterStandPos.GetComponentsInChildren<Transform>())
|
||||||
|
{
|
||||||
if (trans == characterStandPos)
|
if (trans == characterStandPos)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
@@ -446,7 +447,7 @@ namespace Gallop.Live
|
|||||||
var nextKey = keyData_.nextKey as LiveTimelineKeyLipSyncData;
|
var nextKey = keyData_.nextKey as LiveTimelineKeyLipSyncData;
|
||||||
for (int k = 0; k < charaObjs.Count; k++)
|
for (int k = 0; k < charaObjs.Count; k++)
|
||||||
{
|
{
|
||||||
if(k < CharaContainerScript.Count)
|
if (k < CharaContainerScript.Count)
|
||||||
{
|
{
|
||||||
var container = CharaContainerScript[k];
|
var container = CharaContainerScript[k];
|
||||||
container.FaceDrivenKeyTarget.AlterUpdateAutoLip(prevKey, curKey, liveTime_, ((int)curKey.character >> k) % 2);
|
container.FaceDrivenKeyTarget.AlterUpdateAutoLip(prevKey, curKey, liveTime_, ((int)curKey.character >> k) % 2);
|
||||||
@@ -455,7 +456,7 @@ namespace Gallop.Live
|
|||||||
};
|
};
|
||||||
_liveTimelineControl.OnUpdateFacial += delegate (FacialDataUpdateInfo updateInfo_, float liveTime_, int position)
|
_liveTimelineControl.OnUpdateFacial += delegate (FacialDataUpdateInfo updateInfo_, float liveTime_, int position)
|
||||||
{
|
{
|
||||||
if( position < charaObjs.Count)
|
if (position < charaObjs.Count)
|
||||||
{
|
{
|
||||||
var container = CharaContainerScript[position];
|
var container = CharaContainerScript[position];
|
||||||
container.FaceDrivenKeyTarget.AlterUpdateFacialNew(ref updateInfo_, liveTime_);
|
container.FaceDrivenKeyTarget.AlterUpdateFacialNew(ref updateInfo_, liveTime_);
|
||||||
@@ -613,8 +614,8 @@ namespace Gallop.Live
|
|||||||
|
|
||||||
if (IsRecordVMD)
|
if (IsRecordVMD)
|
||||||
{
|
{
|
||||||
foreach(var container in CharaContainerScript)
|
foreach (var container in CharaContainerScript)
|
||||||
{
|
{
|
||||||
var rootbone = container.transform.Find("Position");
|
var rootbone = container.transform.Find("Position");
|
||||||
var newRecorder = rootbone.gameObject.AddComponent<UnityHumanoidVMDRecorder>();
|
var newRecorder = rootbone.gameObject.AddComponent<UnityHumanoidVMDRecorder>();
|
||||||
newRecorder.UseParentOfAll = true;
|
newRecorder.UseParentOfAll = true;
|
||||||
@@ -624,7 +625,7 @@ namespace Gallop.Live
|
|||||||
{
|
{
|
||||||
newRecorder.StartRecording();
|
newRecorder.StartRecording();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -721,18 +722,16 @@ namespace Gallop.Live
|
|||||||
_liveTimelineControl.AlterLateUpdate();
|
_liveTimelineControl.AlterLateUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DateTime ExitTime;
|
||||||
private void ExitLive()
|
private void ExitLive()
|
||||||
{
|
{
|
||||||
isExit = true;
|
isExit = true;
|
||||||
if (_liveTimelineControl.IsRecordVMD)
|
if (_liveTimelineControl.IsRecordVMD)
|
||||||
{
|
{
|
||||||
|
ExitTime = DateTime.Now;
|
||||||
SaveCameraVMD();
|
SaveCameraVMD();
|
||||||
SaveMultiCameraVMD();
|
SaveMultiCameraVMD();
|
||||||
SaveCharacterVMD();
|
SaveCharacterVMD();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
UmaSceneController.LoadScene("Version2");
|
UmaSceneController.LoadScene("Version2");
|
||||||
UmaAssetManager.UnloadAllBundle(true);
|
UmaAssetManager.UnloadAllBundle(true);
|
||||||
@@ -748,7 +747,7 @@ namespace Gallop.Live
|
|||||||
if (recorder.IsRecording)
|
if (recorder.IsRecording)
|
||||||
{
|
{
|
||||||
recorder.StopRecording();
|
recorder.StopRecording();
|
||||||
recorder.SaveLiveVMD($"Live{live.MusicId}_Pos{CharaContainerScript.IndexOf(container)}");
|
recorder.SaveLiveVMD(live, ExitTime, $"Live{live.MusicId}_Pos{CharaContainerScript.IndexOf(container)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -761,18 +760,21 @@ namespace Gallop.Live
|
|||||||
var frames = _liveTimelineControl.MultiRecordFrames[i];
|
var frames = _liveTimelineControl.MultiRecordFrames[i];
|
||||||
frames[0].FovVaild = true;
|
frames[0].FovVaild = true;
|
||||||
var fov = _liveTimelineControl.data.worksheetList[0].multiCameraPosKeys[i].keys.thisList;
|
var fov = _liveTimelineControl.data.worksheetList[0].multiCameraPosKeys[i].keys.thisList;
|
||||||
fov.ForEach(k => {
|
fov.ForEach(k =>
|
||||||
var index = k.frame;
|
{
|
||||||
if (index < frames.Count)
|
var keyframe = frames.Find(f => f.frameIndex == k.frame);
|
||||||
|
if (keyframe != null)
|
||||||
{
|
{
|
||||||
frames[index].FovVaild = true;
|
var index = frames.IndexOf(keyframe);
|
||||||
|
keyframe.FovVaild = true;
|
||||||
|
if (index + 1 < frames.Count) frames[index + 1].FovVaild = true;
|
||||||
if (index - 1 > 0) frames[index - 1].FovVaild = true;
|
if (index - 1 > 0) frames[index - 1].FovVaild = true;
|
||||||
if (index - 2 > 0) frames[index - 2].FovVaild = true;
|
if (index - 2 > 0) frames[index - 2].FovVaild = true;
|
||||||
if (index - 3 > 0) frames[index - 3].FovVaild = true;
|
if (index - 3 > 0) frames[index - 3].FovVaild = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
UnityCameraVMDRecorder.SaveLiveCameraVMD(frames,i);
|
UnityCameraVMDRecorder.SaveLiveCameraVMD(live, ExitTime, frames, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -781,18 +783,22 @@ namespace Gallop.Live
|
|||||||
var frames = _liveTimelineControl.RecordFrames;
|
var frames = _liveTimelineControl.RecordFrames;
|
||||||
frames[0].FovVaild = true;
|
frames[0].FovVaild = true;
|
||||||
var fov = _liveTimelineControl.data.worksheetList[0].cameraFovKeys.thisList;
|
var fov = _liveTimelineControl.data.worksheetList[0].cameraFovKeys.thisList;
|
||||||
fov.ForEach(k => {
|
fov.ForEach(k =>
|
||||||
var index = k.frame;
|
{
|
||||||
if (index < frames.Count)
|
|
||||||
|
var keyframe = frames.Find(f => f.frameIndex == k.frame);
|
||||||
|
if (keyframe != null)
|
||||||
{
|
{
|
||||||
frames[index].FovVaild = true;
|
var index = frames.IndexOf(keyframe);
|
||||||
|
keyframe.FovVaild = true;
|
||||||
|
if (index + 1 < frames.Count) frames[index + 1].FovVaild = true;
|
||||||
if (index - 1 > 0) frames[index - 1].FovVaild = true;
|
if (index - 1 > 0) frames[index - 1].FovVaild = true;
|
||||||
if (index - 2 > 0) frames[index - 2].FovVaild = true;
|
if (index - 2 > 0) frames[index - 2].FovVaild = true;
|
||||||
if (index - 3 > 0) frames[index - 3].FovVaild = true;
|
if (index - 3 > 0) frames[index - 3].FovVaild = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
UnityCameraVMDRecorder.SaveLiveCameraVMD(frames);
|
UnityCameraVMDRecorder.SaveLiveCameraVMD(live, ExitTime, frames);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user