From b525796f7903c28954c1170ca8363d1863ccb831 Mon Sep 17 00:00:00 2001 From: Asval Date: Thu, 9 Nov 2023 20:34:58 +0100 Subject: [PATCH] acl track skipping workaround --- CUE4Parse | 2 +- FModel/ViewModels/ApiEndpoints/FModelApiEndpoint.cs | 2 +- FModel/Views/Snooper/Animations/Skeleton.cs | 2 +- FModel/Views/Snooper/Models/Section.cs | 4 ++-- FModel/Views/Snooper/Shading/Material.cs | 12 ++++++------ 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/CUE4Parse b/CUE4Parse index 5107809d..27580a04 160000 --- a/CUE4Parse +++ b/CUE4Parse @@ -1 +1 @@ -Subproject commit 5107809d35e3c43121c717b3b3aa732aa08e77fb +Subproject commit 27580a04fd5a32572300c2a8f1d4d821a6634843 diff --git a/FModel/ViewModels/ApiEndpoints/FModelApiEndpoint.cs b/FModel/ViewModels/ApiEndpoints/FModelApiEndpoint.cs index 1e9e889d..498ae089 100644 --- a/FModel/ViewModels/ApiEndpoints/FModelApiEndpoint.cs +++ b/FModel/ViewModels/ApiEndpoints/FModelApiEndpoint.cs @@ -176,7 +176,7 @@ public class FModelApiEndpoint : AbstractApiProvider { if (AutoUpdater.DownloadUpdate(args)) { - UserSettings.Default.ShowChangelog = true; + UserSettings.Default.ShowChangelog = !qa.Value; UserSettings.Default.CommitHash = qa.CommitHash; Application.Current.Shutdown(); } diff --git a/FModel/Views/Snooper/Animations/Skeleton.cs b/FModel/Views/Snooper/Animations/Skeleton.cs index ff01318d..ce1a0dcc 100644 --- a/FModel/Views/Snooper/Animations/Skeleton.cs +++ b/FModel/Views/Snooper/Animations/Skeleton.cs @@ -201,7 +201,7 @@ public class Skeleton : IDisposable sequence.Tracks[bone.SkeletonIndex].GetBoneTransform(f, sequence.NumFrames, ref boneOrientation, ref bonePosition, ref boneScale); if (!bone.IsRoot) boneMatrix = _boneMatriceAtFrame[bone.ParentIndex]; - bonePosition = rotationOnly ? bone.Rest.Position : bonePosition * Constants.SCALE_DOWN_RATIO; + bonePosition = rotationOnly || bonePosition.IsZero() ? bone.Rest.Position : bonePosition * Constants.SCALE_DOWN_RATIO; boneMatrix = new Transform { diff --git a/FModel/Views/Snooper/Models/Section.cs b/FModel/Views/Snooper/Models/Section.cs index 0c96ed90..4a4ced53 100644 --- a/FModel/Views/Snooper/Models/Section.cs +++ b/FModel/Views/Snooper/Models/Section.cs @@ -16,11 +16,11 @@ public class Section public Section(int index, int facesCount, int firstFaceIndex) { - MaterialIndex = index; + MaterialIndex = Math.Max(0, index); FacesCount = facesCount; FirstFaceIndex = firstFaceIndex; FirstFaceIndexPtr = new IntPtr(FirstFaceIndex * sizeof(uint)); - Color = Constants.COLOR_PALETTE[index % Constants.PALETTE_LENGTH]; + Color = Constants.COLOR_PALETTE[MaterialIndex % Constants.PALETTE_LENGTH]; Show = true; } diff --git a/FModel/Views/Snooper/Shading/Material.cs b/FModel/Views/Snooper/Shading/Material.cs index 7c1d6296..2aabe66f 100644 --- a/FModel/Views/Snooper/Shading/Material.cs +++ b/FModel/Views/Snooper/Shading/Material.cs @@ -329,12 +329,12 @@ public class Material : IDisposable switch (SelectedTexture) { - case 0: + case 0 when DiffuseColor.Length > 0: SnimGui.Layout("Color");ImGui.PushID(3); ImGui.ColorEdit4("", ref DiffuseColor[SelectedChannel], ImGuiColorEditFlags.NoAlpha); ImGui.PopID(); break; - case 4: + case 4 when EmissiveColor.Length > 0: SnimGui.Layout("Color");ImGui.PushID(3); ImGui.ColorEdit4("", ref EmissiveColor[SelectedChannel], ImGuiColorEditFlags.NoAlpha); ImGui.PopID();SnimGui.Layout("Region");ImGui.PushID(4); @@ -357,11 +357,11 @@ public class Material : IDisposable { return SelectedTexture switch { - 0 => Diffuse[SelectedChannel], - 1 => Normals[SelectedChannel], - 2 => SpecularMasks[SelectedChannel], + 0 when Diffuse.Length > 0 => Diffuse[SelectedChannel], + 1 when Normals.Length > 0 => Normals[SelectedChannel], + 2 when SpecularMasks.Length > 0 => SpecularMasks[SelectedChannel], 3 => Ao.Texture, - 4 => Emissive[SelectedChannel], + 4 when Emissive.Length > 0 => Emissive[SelectedChannel], _ => null }; }