added back transforms manual inputs

This commit is contained in:
Asval 2025-07-15 22:58:54 +02:00
parent 364df7f402
commit e6ef05092e
3 changed files with 55 additions and 1 deletions

View File

@ -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)
{

View File

@ -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();
}

View File

@ -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();
}