Skip to content

Commit

Permalink
removed atom model
Browse files Browse the repository at this point in the history
  • Loading branch information
4sval committed May 25, 2024
1 parent 9781446 commit e87e75a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 56 deletions.
6 changes: 3 additions & 3 deletions FModel/Creator/Bases/FN/BaseIcon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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));
Expand Down
2 changes: 2 additions & 0 deletions FModel/Creator/CreatorPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public bool TryConstructCreator(out UCreator creator)
case "FortAbilityKit":
case "FortWorkerType":
case "RewardGraphToken":
case "JunoKnowledgeBundle":
case "FortBannerTokenType":
case "FortVariantTokenType":
case "FortDecoItemDefinition":
Expand Down Expand Up @@ -117,6 +118,7 @@ public bool TryConstructCreator(out UCreator creator)
case "FortPersistentResourceItemDefinition":
case "FortWeaponMeleeOffhandItemDefinition":
case "FortHomebaseBannerIconItemDefinition":
case "JunoBuildingPropAccountItemDefinition":
case "FortCampaignHeroLoadoutItemDefinition":
case "FortConditionalResourceItemDefinition":
case "FortChallengeBundleScheduleDefinition":
Expand Down
5 changes: 1 addition & 4 deletions FModel/ViewModels/CUE4ParseViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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:
Expand Down
50 changes: 1 addition & 49 deletions FModel/Views/Snooper/Renderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit e87e75a

Please sign in to comment.