From e6ef05092e69d2a588582bcdbceb30e082d384b3 Mon Sep 17 00:00:00 2001 From: Asval Date: Tue, 15 Jul 2025 22:58:54 +0200 Subject: [PATCH] added back transforms manual inputs --- FModel/Views/Snooper/Renderer.cs | 2 +- FModel/Views/Snooper/SnimGui.cs | 3 ++ FModel/Views/Snooper/Transform.cs | 51 +++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 1 deletion(-) diff --git a/FModel/Views/Snooper/Renderer.cs b/FModel/Views/Snooper/Renderer.cs index a2317032..0a3a6795 100644 --- a/FModel/Views/Snooper/Renderer.cs +++ b/FModel/Views/Snooper/Renderer.cs @@ -123,7 +123,7 @@ public class Renderer : IDisposable public void Animate(UObject anim) { - if (!Options.ModelIsWaitingAnimation) + if (!Services.ApplicationService.ApplicationView.CUE4Parse.ModelIsWaitingAnimation) { if (anim is UAnimSequenceBase animBase) { diff --git a/FModel/Views/Snooper/SnimGui.cs b/FModel/Views/Snooper/SnimGui.cs index c8cf6f40..27112d6f 100644 --- a/FModel/Views/Snooper/SnimGui.cs +++ b/FModel/Views/Snooper/SnimGui.cs @@ -624,6 +624,9 @@ Snooper aims to give an accurate preview of models, materials, skeletal animatio ImGui.EndTable(); } + ImGui.SeparatorText("Manual Inputs"); + model.Transforms[model.SelectedInstance].ImGuiTransform(s.Renderer.CameraOp.Speed / 100f); + ImGui.EndTabItem(); } diff --git a/FModel/Views/Snooper/Transform.cs b/FModel/Views/Snooper/Transform.cs index ec9d270a..5f81874f 100644 --- a/FModel/Views/Snooper/Transform.cs +++ b/FModel/Views/Snooper/Transform.cs @@ -1,5 +1,6 @@ using System.Numerics; using CUE4Parse.UE4.Objects.Core.Math; +using ImGuiNET; namespace FModel.Views.Snooper; @@ -48,5 +49,55 @@ public class Transform ModifyLocal(_saved.Value); } + public void ImGuiTransform(float speed) + { + const float width = 100f; + + if (ImGui.TreeNode("Position")) + { + ImGui.SetNextItemWidth(width); + ImGui.DragFloat("X", ref Position.X, speed, 0f, 0f, "%.2f m"); + + ImGui.SetNextItemWidth(width); + ImGui.DragFloat("Y", ref Position.Y, speed, 0f, 0f, "%.2f m"); + + ImGui.SetNextItemWidth(width); + ImGui.DragFloat("Z", ref Position.Z, speed, 0f, 0f, "%.2f m"); + + ImGui.TreePop(); + } + + if (ImGui.TreeNode("Rotation")) + { + ImGui.SetNextItemWidth(width); + ImGui.DragFloat("W", ref Rotation.W, .005f, 0f, 0f, "%.3f rad"); + + ImGui.SetNextItemWidth(width); + ImGui.DragFloat("X", ref Rotation.X, .005f, 0f, 0f, "%.3f rad"); + + ImGui.SetNextItemWidth(width); + ImGui.DragFloat("Y", ref Rotation.Y, .005f, 0f, 0f, "%.3f rad"); + + ImGui.SetNextItemWidth(width); + ImGui.DragFloat("Z", ref Rotation.Z, .005f, 0f, 0f, "%.3f rad"); + + ImGui.TreePop(); + } + + if (ImGui.TreeNode("Scale")) + { + ImGui.SetNextItemWidth(width); + ImGui.DragFloat("X", ref Scale.X, speed, 0f, 0f, "%.3f"); + + ImGui.SetNextItemWidth(width); + ImGui.DragFloat("Y", ref Scale.Y, speed, 0f, 0f, "%.3f"); + + ImGui.SetNextItemWidth(width); + ImGui.DragFloat("Z", ref Scale.Z, speed, 0f, 0f, "%.3f"); + + ImGui.TreePop(); + } + } + public override string ToString() => Matrix.Translation.ToString(); }