diff --git a/Content/MoCapMap.umap b/Content/MoCapMap.umap index 5eeed50cf24f46524808bf24768cfb369414d7a6..6af5fe79f4e0420a7f37d853e434535ce6c86216 100644 --- a/Content/MoCapMap.umap +++ b/Content/MoCapMap.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:663239c10a78e8dc8c84216b516ead89004f427730dfd3832bcd0a0a109ee925 -size 89658 +oid sha256:2d95074fcf135c44a169ad0e3686dec1a1a526af97dea8f05b59d5c0d63268f9 +size 88607 diff --git a/Content/SaveSequenceAnimBP.uasset b/Content/SaveSequenceAnimBP.uasset index 4f0085589f4ba36a41bbcbb79c699003c596e96b..713af97aac058a0f715dd102d440efea48190d00 100644 --- a/Content/SaveSequenceAnimBP.uasset +++ b/Content/SaveSequenceAnimBP.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:65c6df4b10f870223de801c4cced33316dccad914ce68b84b5817b873182b76a -size 295984 +oid sha256:2a895522e77ef964af43e6d1bb3b5542ecbd84c02e91e6a87dadac1e170affe4 +size 296647 diff --git a/Content/SaveSequenceRig.uasset b/Content/SaveSequenceRig.uasset index 2462d08def208d11151577508dcc1ebda2e7d0ad..3508f1206ba2b6609118d91d7068d1b2ec05f4c8 100644 --- a/Content/SaveSequenceRig.uasset +++ b/Content/SaveSequenceRig.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e783ae3899229e90aa70870cef373611f04e5aea1573280bc6ae685649784c9a -size 4650026 +oid sha256:3d67a03995c90aaac10fc5be49d660b4d62348324e431d440f10137f4d245db1 +size 4945189 diff --git a/Source/MoCapPlugin/Private/MCController.cpp b/Source/MoCapPlugin/Private/MCController.cpp index 45c799432e6005d12388b8e77e24b48394b5aad1..35ed5f26ecfa66cb453a751aa010fa84c10f7e21 100644 --- a/Source/MoCapPlugin/Private/MCController.cpp +++ b/Source/MoCapPlugin/Private/MCController.cpp @@ -51,6 +51,9 @@ void AMCController::BeginPlay() { Pawn->LoadMeasurementFile(MeasurementPath); Pawn->GetAnimInstance()->PawnOwner = Pawn; + if (Scale > 0.f) { + Pawn->GetAnimInstance()->Scale = FVector(Scale, Scale, Scale); + } if (LeftFootPlane && RightFootPlane) { Pawn->GetAnimInstance()->LeftFootPlane = LeftFootPlane->GetActorTransform(); Pawn->GetAnimInstance()->RightFootPlane = RightFootPlane->GetActorTransform(); @@ -1486,6 +1489,11 @@ void AMCController::ToggleRecording() { } if (!IsRecording) { + FString LogFolderName = LogHandler.GetSessionIdentifier(); + FString LogPathString = FPaths::ProjectSavedDir() + "OwnLogs/" + LogFolderName + "/DataLog"; + while (FPaths::FileExists(LogPathString + FString::FromInt(CurRecordingInSession) + ".log")) { + CurRecordingInSession++; + } LogHandler.NewLog("DataLog" + FString::FromInt(CurRecordingInSession)); LogHandler.StartRecording(); Pawn->CalcSensorOffsets(LogHandler, UseLastOffsets, DebugMode); @@ -1650,6 +1658,10 @@ void AMCController::SaveAnimation(float StartHaltingPoint, float EndHaltingPoint AnimSaveState.Pawn->GetAnimInstance()->LimitHandRot = LimitHandRotation; AnimSaveState.Pawn->GetAnimInstance()->FingerAngleScale = FingerAngleScale; AnimSaveState.Pawn->GetAnimInstance()->SnapshotAnimations.Empty(); + if (Scale > 0.f) { + AnimSaveState.Pawn->GetAnimInstance()->Scale = FVector(Scale, Scale, Scale); + } + AnimSaveState.Pawn->GetAnimInstance()->FixChest = FixChest; AnimSaveState.FPS = FramesPerSecond; AnimSaveState.SPF = 1.f / ((float)AnimSaveState.FPS); diff --git a/Source/MoCapPlugin/Private/MCLogHandler.cpp b/Source/MoCapPlugin/Private/MCLogHandler.cpp index e347d8db2ba44b8440406ec8a0c2e58d0ebb9b73..836fbad6a3a79a02e618230de24025d92f1400b7 100644 --- a/Source/MoCapPlugin/Private/MCLogHandler.cpp +++ b/Source/MoCapPlugin/Private/MCLogHandler.cpp @@ -11,6 +11,10 @@ #include "JsonUtilities/Public/JsonUtilities.h" +FString UMCLogHandler::GetSessionIdentifier() { + return UniLog.GetSessionIdentifier(); +} + void UMCLogHandler::NewLog(const FString& Name) { UniLog.NewLogStream(Name, "Saved/OwnLogs/", Name + ".log", true); CurLog = Name; @@ -104,7 +108,7 @@ void UMCLogHandler::CopyLogToRecordings(FString& Name) { FString PathStopped = Visitor.Files[MaxIndex]; LastSubIndex = PathStopped.Find("/", ESearchCase::CaseSensitive, ESearchDir::FromEnd); PathStopped = PathStopped.RightChop(LastSubIndex + 1); - PathStopped = PathStopped + "/" + CurLog + ".log"; //TODO CurLog oder 0? + PathStopped = PathStopped + "/" + CurLog + ".log"; PathMostRecent += "\n" + PathStopped; } FFileHelper::SaveStringToFile(PathMostRecent, *(Path + "LogSourcePath.txt")); diff --git a/Source/MoCapPlugin/Public/MCAnimInstance.h b/Source/MoCapPlugin/Public/MCAnimInstance.h index 80745643485debb925144124b14ea27bedc92414..a294e831b39d67adca96b2eecb751914d57575ec 100644 --- a/Source/MoCapPlugin/Public/MCAnimInstance.h +++ b/Source/MoCapPlugin/Public/MCAnimInstance.h @@ -59,6 +59,9 @@ public: UPROPERTY(BlueprintReadWrite) bool UseHandPos; + UPROPERTY(BlueprintReadWrite) + bool FixChest; + UPROPERTY(BlueprintReadWrite) bool SkipCalibration; diff --git a/Source/MoCapPlugin/Public/MCController.h b/Source/MoCapPlugin/Public/MCController.h index 72805e9325162959affbb5bfdd7c6e6db5821b49..e0225ddc2e41ad0a85fc5e5399e023bc69618857 100644 --- a/Source/MoCapPlugin/Public/MCController.h +++ b/Source/MoCapPlugin/Public/MCController.h @@ -142,6 +142,9 @@ public: /*------------GENERAL PROPERTIES-------------*/ + UPROPERTY(EditAnywhere, meta = (DisplayName = "Scale Mesh", Category = "MotionCapture")) + float Scale = -1.f; + UPROPERTY(EditAnywhere, meta = (DisplayName = "Path to Measurement File", Category = "MotionCapture")) FString MeasurementPath = "Plugins/MocapPlugin/Content/Measurements.txt"; @@ -212,6 +215,9 @@ public: //UPROPERTY(EditAnywhere, meta = (DisplayName = "Chest Control Keep Length", Category = "MotionCapture Anim")) bool ChestKeepLength = false; + UPROPERTY(EditAnywhere, meta = (DisplayName = "Set Chest Transform After Arm IK", Category = "MotionCapture Anim")) + bool FixChest = true; + UPROPERTY(EditAnywhere, meta = (DisplayName = "Hip Shift To Reducing Center", Category = "MotionCapture Anim")) bool HipShiftToReducingCenter = false; diff --git a/Source/MoCapPlugin/Public/MCLogHandler.h b/Source/MoCapPlugin/Public/MCLogHandler.h index 0e9e6fbe1f8f536de9d2a9b758ba472e2fbc02c5..7241cc62d3fbc74a18c9398714aba1179412103f 100644 --- a/Source/MoCapPlugin/Public/MCLogHandler.h +++ b/Source/MoCapPlugin/Public/MCLogHandler.h @@ -16,6 +16,7 @@ public: FString CurLog; + FString GetSessionIdentifier(); void NewLog(const FString& Name); void LogData(const FString& Message);