From e87e75acd4a8a62813ad43ec32f8b984bc911f1f Mon Sep 17 00:00:00 2001 From: Asval Date: Sat, 25 May 2024 02:42:54 +0200 Subject: [PATCH] removed atom model --- FModel/Creator/Bases/FN/BaseIcon.cs | 6 +-- FModel/Creator/CreatorPackage.cs | 2 + FModel/ViewModels/CUE4ParseViewModel.cs | 5 +-- FModel/Views/Snooper/Renderer.cs | 50 +------------------------ 4 files changed, 7 insertions(+), 56 deletions(-) diff --git a/FModel/Creator/Bases/FN/BaseIcon.cs b/FModel/Creator/Bases/FN/BaseIcon.cs index 884050c3..fbe98810 100644 --- a/FModel/Creator/Bases/FN/BaseIcon.cs +++ b/FModel/Creator/Bases/FN/BaseIcon.cs @@ -39,7 +39,7 @@ public void ParseForReward(bool isUsingDisplayAsset) Preview = preview; else if (Object.TryGetValue(out FPackageIndex itemDefinition, "HeroDefinition", "WeaponDefinition")) Preview = Utils.GetBitmap(itemDefinition); - else if (Object.TryGetValue(out FSoftObjectPath largePreview, "LargePreviewImage", "EntryListIcon", "SmallPreviewImage", "ItemDisplayAsset", "LargeIcon", "ToastIcon", "SmallIcon")) + else if (Object.TryGetValue(out FSoftObjectPath largePreview, "LargePreviewImage", "EntryListIcon", "SmallPreviewImage", "BundleImage", "ItemDisplayAsset", "LargeIcon", "ToastIcon", "SmallIcon")) Preview = Utils.GetBitmap(largePreview); else if (Object.TryGetValue(out string s, "LargePreviewImage") && !string.IsNullOrEmpty(s)) Preview = Utils.GetBitmap(s); @@ -51,9 +51,9 @@ public void ParseForReward(bool isUsingDisplayAsset) Preview = Utils.GetBitmap(res); // text - if (Object.TryGetValue(out FText displayName, "DisplayName", "ItemName", "DefaultHeaderText", "UIDisplayName", "EntryName", "EventCalloutTitle")) + if (Object.TryGetValue(out FText displayName, "DisplayName", "ItemName", "BundleName", "DefaultHeaderText", "UIDisplayName", "EntryName", "EventCalloutTitle")) DisplayName = displayName.Text; - if (Object.TryGetValue(out FText description, "Description", "ItemDescription", "GeneralDescription", "DefaultBodyText", "UIDescription", "UIDisplayDescription", "EntryDescription", "EventCalloutDescription")) + if (Object.TryGetValue(out FText description, "Description", "ItemDescription", "BundleDescription", "GeneralDescription", "DefaultBodyText", "UIDescription", "UIDisplayDescription", "EntryDescription", "EventCalloutDescription")) Description = description.Text; else if (Object.TryGetValue(out FText[] descriptions, "Description")) Description = string.Join('\n', descriptions.Select(x => x.Text)); diff --git a/FModel/Creator/CreatorPackage.cs b/FModel/Creator/CreatorPackage.cs index 30788ed4..4a10cde2 100644 --- a/FModel/Creator/CreatorPackage.cs +++ b/FModel/Creator/CreatorPackage.cs @@ -57,6 +57,7 @@ public bool TryConstructCreator(out UCreator creator) case "FortAbilityKit": case "FortWorkerType": case "RewardGraphToken": + case "JunoKnowledgeBundle": case "FortBannerTokenType": case "FortVariantTokenType": case "FortDecoItemDefinition": @@ -117,6 +118,7 @@ public bool TryConstructCreator(out UCreator creator) case "FortPersistentResourceItemDefinition": case "FortWeaponMeleeOffhandItemDefinition": case "FortHomebaseBannerIconItemDefinition": + case "JunoBuildingPropAccountItemDefinition": case "FortCampaignHeroLoadoutItemDefinition": case "FortConditionalResourceItemDefinition": case "FortChallengeBundleScheduleDefinition": diff --git a/FModel/ViewModels/CUE4ParseViewModel.cs b/FModel/ViewModels/CUE4ParseViewModel.cs index aff3c91e..c7dd23ca 100644 --- a/FModel/ViewModels/CUE4ParseViewModel.cs +++ b/FModel/ViewModels/CUE4ParseViewModel.cs @@ -34,15 +34,12 @@ using CUE4Parse.UE4.Versions; using CUE4Parse.UE4.Wwise; using CUE4Parse_Conversion; -using CUE4Parse_Conversion.Animations; -using CUE4Parse_Conversion.Meshes; using CUE4Parse_Conversion.Sounds; using CUE4Parse.GameTypes.UDWN.Encryption.Aes; using CUE4Parse.GameTypes.DBD.Encryption.Aes; using CUE4Parse.GameTypes.PAXDEI.Encryption.Aes; using CUE4Parse.GameTypes.NetEase.MAR.Encryption.Aes; using CUE4Parse.GameTypes.FSR.Encryption.Aes; -using CUE4Parse.UE4.Assets.Exports.Atom; using EpicManifestParser; using FModel.Creator; using FModel.Extensions; @@ -849,9 +846,9 @@ public void ExtractAndScroll(CancellationToken cancellationToken, string fullPat { "JunoBuildInstructionsItemDefinition" => true, "JunoBuildingSetAccountItemDefinition" => true, + "JunoBuildingPropAccountItemDefinition" => true, _ => false }: - case UAtomModel when isNone && UserSettings.Default.PreviewStaticMeshes: case UStaticMesh when isNone && UserSettings.Default.PreviewStaticMeshes: case USkeletalMesh when isNone && UserSettings.Default.PreviewSkeletalMeshes: case USkeleton when isNone && UserSettings.Default.SaveSkeletonAsMesh: diff --git a/FModel/Views/Snooper/Renderer.cs b/FModel/Views/Snooper/Renderer.cs index a623a065..4bc0d4d9 100644 --- a/FModel/Views/Snooper/Renderer.cs +++ b/FModel/Views/Snooper/Renderer.cs @@ -8,7 +8,6 @@ using CUE4Parse_Conversion.Meshes; using CUE4Parse.UE4.Assets.Exports; using CUE4Parse.UE4.Assets.Exports.Animation; -using CUE4Parse.UE4.Assets.Exports.Atom; using CUE4Parse.UE4.Assets.Exports.Component.StaticMesh; using CUE4Parse.UE4.Assets.Exports.GeometryCollection; using CUE4Parse.UE4.Assets.Exports.Material; @@ -104,9 +103,6 @@ public void Load(CancellationToken cancellationToken, UObject export) LoadJunoWorld(cancellationToken, bp, Transform.Identity); Color = VertexColor.Colors; break; - case UAtomModel at: - LoadAtom(cancellationToken, at); - break; } CameraOp.Mode = _saveCameraMode ? UserSettings.Default.CameraMode : Camera.WorldMode.FlyCam; SetupCamera(); @@ -677,7 +673,7 @@ private void OverrideJunoVertexColors(UStaticMesh staticMesh, UGeometryCollectio { ref var vertexColor = ref staticMesh.RenderData.LODs[0].ColorVertexBuffer.Data[i]; var indexAsByte = vertexColor.R; - if (vertexColor.R == 255) indexAsByte = vertexColor.A; + if (indexAsByte == 255) indexAsByte = vertexColor.A; distinctReds.Add(indexAsByte); } @@ -757,50 +753,6 @@ private void AdditionalWorlds(UObject actor, Matrix4x4 relation, CancellationTok LoadWorld(cancellationToken, w, transform); } - private void LoadAtom(CancellationToken cancellationToken, UAtomModel original) - { - var length = original.Primitives.Length; - for (var i = 0; i < length; i++) - { - cancellationToken.ThrowIfCancellationRequested(); - Services.ApplicationService.ApplicationView.Status.UpdateStatusLabel($"{original.Name} ... {i}/{length}"); - - foreach (var part in original.Primitives[i].Parts) - { - var fixedPath = part.AtomPrimitive.AssetPathName.Text - .Replace("Primitives", "ProcessedMeshes") - .Replace("VX", "SM_VX"); - if (!Utils.TryLoadObject(fixedPath, out UStaticMesh staticMesh) || !staticMesh.TryConvert(out var mesh)) - continue; - - var guid = staticMesh.LightingGuid; - var transform = new Transform - { - Position = part.Transforms[0].Translation * Constants.SCALE_DOWN_RATIO, - Rotation = part.Transforms[0].Rotation, - Scale = part.Transforms[0].Scale3D - }; - - if (Options.TryGetModel(guid, out var model)) - { - model.AddInstance(transform); - } - else - { - model = new StaticModel(staticMesh, mesh, transform); - foreach (var section in model.Sections) - { - section.Show = true; - } - Options.Models[guid] = model; - } - } - } - - CameraOp.Setup(original.SourceModel.Bounds * Constants.SCALE_DOWN_RATIO); - Services.ApplicationService.ApplicationView.Status.UpdateStatusLabel($"{original.Name} ... {length}/{length}"); - } - public void WindowResized(int width, int height) { CameraOp.AspectRatio = width / (float) height;