From 3435897e994fef056190d5a35fe19c911138df97 Mon Sep 17 00:00:00 2001 From: GMatrixGames Date: Sun, 11 Jun 2023 08:51:24 -0400 Subject: [PATCH] Handle KeepMobileMinLODSettingOnDesktop --- CUE4Parse | 2 +- FModel/ViewModels/CUE4ParseViewModel.cs | 23 ++++++++++++++++++----- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/CUE4Parse b/CUE4Parse index f3ad3b30..2666e11a 160000 --- a/CUE4Parse +++ b/CUE4Parse @@ -1 +1 @@ -Subproject commit f3ad3b3093f2693604415fa94ce9a53bb5a5c3fa +Subproject commit 2666e11af8aa93222a07ac8513f5257af51304ce diff --git a/FModel/ViewModels/CUE4ParseViewModel.cs b/FModel/ViewModels/CUE4ParseViewModel.cs index 862138b9..265839ba 100644 --- a/FModel/ViewModels/CUE4ParseViewModel.cs +++ b/FModel/ViewModels/CUE4ParseViewModel.cs @@ -446,13 +446,26 @@ public Task VerifyConsoleVariables() return Task.Run(() => { - var inst = new List(); - Provider.DefaultEngine.FindPropertyInstructions("ConsoleVariables", "a.StripAdditiveRefPose", inst); - if (inst.Count > 0 && inst[0].Value.Equals("1")) + foreach (var token in Provider.DefaultEngine.Sections.FirstOrDefault(s => s.Name == "ConsoleVariables")?.Tokens ?? new List()) { - FLogger.Append(ELog.Warning, () => - FLogger.Text("Additive animations have their reference pose stripped, which will lead to inaccurate preview and export", Constants.WHITE, true)); + if (token is not InstructionToken it) continue; + var boolValue = it.Value.Equals("1"); + + switch (it.Key) + { + case "a.StripAdditiveRefPose" when boolValue: + FLogger.Append(ELog.Warning, () => + FLogger.Text("Additive animations have their reference pose stripped, which will lead to inaccurate preview and export", Constants.WHITE, true)); + continue; + case "r.StaticMesh.KeepMobileMinLODSettingOnDesktop": + Provider.Versions["StaticMesh.KeepMobileMinLODSettingOnDesktop"] = boolValue; + continue; + case "r.SkeletalMesh.KeepMobileMinLODSettingOnDesktop": + Provider.Versions["SkeletalMesh.KeepMobileMinLODSettingOnDesktop"] = boolValue; + continue; + } } + _cvaVerifDone = true; }); }