animations and QOL

This commit is contained in:
bird_egop
2026-06-12 02:06:32 +03:00
parent 4d0d1aca12
commit 1cb3940cce
14 changed files with 444 additions and 32 deletions
@@ -1,5 +1,7 @@
namespace NResUI.Rendering.Inspection;
using NResUI.Rendering.Viewport.Msh;
/// <summary>
/// Состояние просмотра меша. State/LOD задаются только для конкретных pieces,
/// потому что 0x01 хранит таблицу slot indices отдельно для каждого узла.
@@ -15,6 +17,10 @@ public sealed class MeshRenderState
public HashSet<int> HiddenPieceIds { get; } = [];
public Dictionary<int, int> PieceStateOverrides { get; } = [];
public Dictionary<int, int> PieceLodOverrides { get; } = [];
public MshAnimationPoseMode AnimationPoseMode { get; set; } = MshAnimationPoseMode.DefaultKeyframe;
public float AnimationSampleTime { get; set; }
public float AnimationSpeed { get; set; } = 1.0f;
public bool AnimationPlay { get; set; }
public void ClearSelection()
{
@@ -27,4 +27,13 @@ public sealed class MshModelGeometry
/// <summary>Render batches 0x0D: диапазоны индексов, material id и render flags.</summary>
public required IReadOnlyList<Msh0x0D.Batch> Batches { get; init; }
/// <summary>Piece transform keyframes from MSH 0x08.</summary>
public required IReadOnlyList<MshTransformKeyframe> TransformKeyframes { get; init; }
/// <summary>Animation frame to 0x08 keyframe map from MSH 0x13. Optional in some files.</summary>
public required IReadOnlyList<MshAnimationMapEntry> AnimationMap { get; init; }
/// <summary>Animation frame count/window from MSH 0x13 NRes metadata.</summary>
public required int MaxAnimationTime { get; init; }
}