unreal_asset/
custom_version.rs

1//! UAsset CustomVersion and a known list of them
2
3use std::collections::HashMap;
4use std::fmt::Display;
5
6use byteorder::LE;
7use lazy_static::lazy_static;
8use num_enum::{IntoPrimitive, TryFromPrimitive};
9
10use crate::engine_version::EngineVersion;
11use crate::error::Error;
12use crate::reader::{archive_reader::ArchiveReader, archive_writer::ArchiveWriter};
13use crate::types::{new_guid, Guid};
14
15/// CustomVersions are engine "sub-versions"
16/// They are used to parse some propeties differently
17#[derive(Debug, Clone, PartialEq, Eq, Hash)]
18pub struct CustomVersion {
19    /// Custom veresion guid
20    pub guid: Guid,
21    /// Friendly name of the custom version
22    pub friendly_name: Option<String>,
23    /// Version number
24    pub version: i32,
25    /// Mappings from engine version to version number of this custom version
26    ///
27    /// # Example
28    /// UE4_27 -> 13
29    /// UE4_23 -> 12
30    pub version_mappings: &'static [(EngineVersion, i32)],
31}
32
33type VersionInfo = (String, Option<&'static [(EngineVersion, i32)]>);
34
35#[rustfmt::skip]
36lazy_static! {
37    static ref GUID_TO_VERSION_INFO: HashMap<Guid, VersionInfo> = HashMap::from([
38        ( new_guid(0, 0, 0, 0xF99D40C1),                            (String::from("UnusedCustomVersionKey"), None) ),
39        ( new_guid(0xB0D832E4, 0x1F894F0D, 0xACCF7EB7, 0x36FD4AA2), (String::from("FBlueprintsObjectVersion"), None) ),
40        ( new_guid(0xE1C64328, 0xA22C4D53, 0xA36C8E86, 0x6417BD8C), (String::from("FBuildObjectVersion"), None) ),
41        ( new_guid(0xB02B49B5, 0xBB2044E9, 0xA30432B7, 0x52E40360), (String::from("FMobileObjectVersion"), None) ),
42        ( new_guid(0xA4E4105C, 0x59A149B5, 0xA7C540C4, 0x547EDFEE), (String::from("FNetworkingObjectVersion"), None) ),
43        ( new_guid(0x39C831C9, 0x5AE647DC, 0x9A449C17, 0x3E1C8E7C), (String::from("FOnlineObjectVersion"), None) ),
44        ( new_guid(0x78F01B33, 0xEBEA4F98, 0xB9B484EA, 0xCCB95AA2), (String::from("FPhysicsObjectVersion"), None) ),
45        ( new_guid(0x6631380F, 0x2D4D43E0, 0x8009CF27, 0x6956A95A), (String::from("FPlatformObjectVersion"), None) ),
46        ( new_guid(0x12F88B9F, 0x88754AFC, 0xA67CD90C, 0x383ABD29), (String::from("FRenderingObjectVersion"), None) ),
47        ( new_guid(0xD7296918, 0x1DD64BDD, 0x9DE264A8, 0x3CC13884), (String::from("FVRObjectVersion"), None) ),
48        ( new_guid(0xC2A15278, 0xBFE74AFE, 0x6C1790FF, 0x531DF755), (String::from("FLoadTimesObjectVersion"), None) ),
49        ( new_guid(0x6EACA3D4, 0x40EC4CC1, 0xB7868BED, 0x9428FC5),  (String::from("FGeometryObjectVersion"), None) ),
50        ( new_guid(0x29E575DD, 0xE0A34627, 0x9D10D276, 0x232CDCEA), (String::from("FAnimPhysObjectVersion"), None) ), //
51        ( new_guid(0xAF43A65D, 0x7FD34947, 0x98733E8E, 0xD9C1BB05), (String::from("FAnimObjectVersion"), None) ),
52        ( new_guid(0x6B266CEC, 0x1EC74B8F, 0xA30BE4D9, 0x0942FC07), (String::from("FReflectionCaptureObjectVersion"), None) ),
53        ( new_guid(0x0DF73D61, 0xA23F47EA, 0xB72789E9, 0x0C41499A), (String::from("FAutomationObjectVersion"), None) ),
54        ( new_guid(0x9DFFBCD6, 0x494F0158, 0xE2211282, 0x3C92A888), (String::from("FEnterpriseObjectVersion"), None) ),
55        ( new_guid(0xF2AED0AC, 0x9AFE416F, 0x8664AA7F, 0xFA26D6FC), (String::from("FNiagaraObjectVersion"), None) ),
56        ( new_guid(0x174F1F0B, 0xB4C645A5, 0xB13F2EE8, 0xD0FB917D), (String::from("FDestructionObjectVersion"), None) ),
57        ( new_guid(0x35F94A83, 0xE258406C, 0xA31809F5, 0x9610247C), (String::from("FExternalPhysicsCustomObjectVersion"), None) ),
58        ( new_guid(0xB68FC16E, 0x8B1B42E2, 0xB453215C, 0x058844FE), (String::from("FExternalPhysicsMaterialCustomObjectVersion"), None) ),
59        ( new_guid(0xB2E18506, 0x4273CFC2, 0xA54EF4BB, 0x758BBA07), (String::from("FCineCameraObjectVersion"), None) ),
60        ( new_guid(0x64F58936, 0xFD1B42BA, 0xBA967289, 0xD5D0FA4E), (String::from("FVirtualProductionObjectVersion"), None) ),
61        ( new_guid(0x6f0ed827, 0xa6094895, 0x9c91998d, 0x90180ea4), (String::from("FMediaFrameworkObjectVersion"), None) ),
62        ( new_guid(0xAFE08691, 0x3A0D4952, 0xB673673B, 0x7CF22D1E), (String::from("FPoseDriverCustomVersion"), None) ),
63        ( new_guid(0xCB8AB0CD, 0xE78C4BDE, 0xA8621393, 0x14E9EF62), (String::from("FTempCustomVersion"), None) ),
64        ( new_guid(0x2EB5FDBD, 0x01AC4D10, 0x8136F38F, 0x3393A5DA), (String::from("FAnimationCustomVersion"), None) ),
65        ( new_guid(0x717F9EE7, 0xE9B0493A, 0x88B39132, 0x1B388107), (String::from("FAssetRegistryVersion"), None) ),
66        ( new_guid(0xFB680AF2, 0x59EF4BA3, 0xBAA819B5, 0x73C8443D), (String::from("FClothingAssetCustomVersion"), None) ),
67        ( new_guid(0x4A56EB40, 0x10F511DC, 0x92D3347E, 0xB2C96AE7), (String::from("FParticleSystemCustomVersion"), None) ),
68        ( new_guid(0xD78A4A00, 0xE8584697, 0xBAA819B5, 0x487D46B4), (String::from("FSkeletalMeshCustomVersion"), None) ),
69        ( new_guid(0x5579F886, 0x933A4C1F, 0x83BA087B, 0x6361B92F), (String::from("FRecomputeTangentCustomVersion"), None) ),
70        ( new_guid(0x612FBE52, 0xDA53400B, 0x910D4F91, 0x9FB1857C), (String::from("FOverlappingVerticesCustomVersion"), None) ),
71        ( new_guid(0x430C4D19, 0x71544970, 0x87699B69, 0xDF90B0E5), (String::from("FFoliageCustomVersion"), None) ),
72        ( new_guid(0xaafe32bd, 0x53954c14, 0xb66a5e25, 0x1032d1dd), (String::from("FProceduralFoliageCustomVersion"), None) ),
73        ( new_guid(0xab965196, 0x45d808fc, 0xb7d7228d, 0x78ad569e), (String::from("FLiveLinkCustomVersion"), None) ),
74
75        ( FCoreObjectVersion::GUID,                                 (String::from(FCoreObjectVersion::FRIENDLY_NAME), Some(FCoreObjectVersion::VERSION_MAPPINGS)) ),
76        ( FEditorObjectVersion::GUID,                               (String::from(FEditorObjectVersion::FRIENDLY_NAME), Some(FEditorObjectVersion::VERSION_MAPPINGS)) ),
77        ( FFrameworkObjectVersion::GUID,                            (String::from(FFrameworkObjectVersion::FRIENDLY_NAME), Some(FFrameworkObjectVersion::VERSION_MAPPINGS)) ),
78        ( FFortniteMainBranchObjectVersion::GUID,                   (String::from(FFortniteMainBranchObjectVersion::FRIENDLY_NAME), Some(FFortniteMainBranchObjectVersion::VERSION_MAPPINGS)) ),
79        ( FReleaseObjectVersion::GUID,                              (String::from(FReleaseObjectVersion::FRIENDLY_NAME), Some(FReleaseObjectVersion::VERSION_MAPPINGS)) ),
80        ( FSequencerObjectVersion::GUID,                            (String::from(FSequencerObjectVersion::FRIENDLY_NAME), Some(FSequencerObjectVersion::VERSION_MAPPINGS)) ),
81    ]);
82}
83
84impl CustomVersion {
85    /// Create a new custom version
86    pub fn new(guid: Guid, version: i32) -> Self {
87        let version_info = GUID_TO_VERSION_INFO.get(&guid).map(|e| e.to_owned());
88        CustomVersion {
89            guid,
90            friendly_name: version_info.as_ref().map(|e| e.0.clone()),
91            version,
92            version_mappings: version_info.and_then(|e| e.1).unwrap_or_default(),
93        }
94    }
95
96    /// Read a custom version from an asset
97    pub fn read<Reader: ArchiveReader>(asset: &mut Reader) -> Result<Self, Error> {
98        let mut key = [0u8; 16];
99        asset.read_exact(&mut key)?;
100        let version = asset.read_i32::<LE>()?;
101
102        let version_info = GUID_TO_VERSION_INFO.get(&key).map(|e| e.to_owned());
103        Ok(Self {
104            guid: key,
105            friendly_name: version_info.as_ref().map(|e| e.0.clone()),
106            version,
107            version_mappings: version_info.and_then(|e| e.1).unwrap_or_default(),
108        })
109    }
110
111    /// Write a custom version to an asset
112    pub fn write<Writer: ArchiveWriter>(&self, writer: &mut Writer) -> Result<(), Error> {
113        writer.write_all(&self.guid)?;
114        writer.write_i32::<LE>(self.version)?;
115        Ok(())
116    }
117
118    /// Create a custom version from a predefined custom version
119    pub fn from_version<T>(version: T) -> Self
120    where
121        T: CustomVersionTrait + Into<i32>,
122    {
123        CustomVersion {
124            guid: T::GUID,
125            friendly_name: Some(T::FRIENDLY_NAME.to_string()),
126            version: version.into(),
127            version_mappings: T::VERSION_MAPPINGS,
128        }
129    }
130
131    /// Get an engine version that corresponds to this version number
132    pub fn get_engine_version_from_version_number(
133        &self,
134        version_number: i32,
135    ) -> Option<EngineVersion> {
136        self.version_mappings
137            .iter()
138            .find(|(_, version)| *version == version_number)
139            .map(|(engine_version, _)| *engine_version)
140    }
141
142    /// Get a version number for a given engine version
143    pub fn get_version_number_from_engine_version(
144        &self,
145        engine_version: EngineVersion,
146    ) -> Option<i32> {
147        self.version_mappings
148            .iter()
149            .find(|(version, _)| *version <= engine_version)
150            .map(|(_, version)| *version)
151    }
152
153    /// Get all custom versions for a given engine version
154    pub fn get_default_custom_version_container(
155        engine_version: EngineVersion,
156    ) -> Vec<CustomVersion> {
157        let mut container = Vec::new();
158
159        for (guid, _) in GUID_TO_VERSION_INFO.iter() {
160            let mut version = CustomVersion::new(*guid, 0);
161            if let Some(version_number) =
162                version.get_version_number_from_engine_version(engine_version)
163            {
164                version.version = version_number;
165                container.push(version);
166            }
167        }
168
169        container
170    }
171}
172
173/// Used for predefining custom versions for nicer checking when parsing
174pub trait CustomVersionTrait {
175    /// Mappings from engine version to version number of this custom version
176    ///
177    /// # Example
178    /// UE4_27 -> 13
179    /// UE4_23 -> 12
180    const VERSION_MAPPINGS: &'static [(EngineVersion, i32)];
181    /// Custom version friendly name
182    const FRIENDLY_NAME: &'static str;
183    /// Custom version guid
184    const GUID: Guid;
185}
186
187macro_rules! impl_custom_version_trait {
188    ($enum_name:ident, $friendly_name:expr, $guid:expr, $($ver_name:ident : $ver:ident),*) => {
189        impl CustomVersionTrait for $enum_name {
190            const VERSION_MAPPINGS: &'static [(EngineVersion, i32)] = &[
191                $(
192                    (EngineVersion::$ver_name, Self::$ver as i32),
193                )*
194            ];
195            const FRIENDLY_NAME: &'static str = $friendly_name;
196            const GUID: Guid = $guid;
197        }
198    }
199}
200
201/// Custom serialization version for changes made in the //Fortnite/Main stream
202#[derive(IntoPrimitive)]
203#[repr(i32)]
204pub enum FFortniteMainBranchObjectVersion {
205    /// Before any version changes were made
206    /// Introduced: ObjectVersion.VER_UE4_OLDEST_LOADABLE_PACKAGE
207    BeforeCustomVersionWasAdded = 0,
208
209    /// World composition tile offset changed from 2d to 3d
210    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_SUMMARY_LOCALIZATION_ID
211    WorldCompositionTile3DOffset,
212
213    /// Minor material serialization optimization
214    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_SUMMARY_LOCALIZATION_ID
215    MaterialInstanceSerializeOptimizationShaderFname,
216
217    /// Refactored cull distances to account for HLOD, explicit override and globals in priority
218    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_SUMMARY_LOCALIZATION_ID
219    CullDistanceRefactorRemovedDefaultDistance,
220    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_SUMMARY_LOCALIZATION_ID
221    CullDistanceRefactorNeverCullHlodsByDefault,
222    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_SUMMARY_LOCALIZATION_ID
223    CullDistanceRefactorNeverCullAlodactorsByDefault,
224
225    /// Support to remove morphtarget generated by bRemapMorphtarget
226    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_SUMMARY_LOCALIZATION_ID
227    SaveGeneratedMorphTargetByEngine,
228
229    /// Convert reduction setting options
230    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_SUMMARY_LOCALIZATION_ID
231    ConvertReductionSettingOptions,
232
233    /// Serialize the type of blending used for landscape layer weight static params
234    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_SUMMARY_LOCALIZATION_ID
235    StaticParameterTerrainLayerWeightBlendType,
236
237    /// Fix up None Named animation curve names,
238    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_SUMMARY_LOCALIZATION_ID
239    FixUpNoneNameAnimationCurves,
240
241    /// Ensure ActiveBoneIndices to have parents even not skinned for old assets
242    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_SUMMARY_LOCALIZATION_ID
243    EnsureActiveBoneIndicesToContainParents,
244
245    /// Serialize the instanced static mesh render data, to avoid building it at runtime
246    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_SUMMARY_LOCALIZATION_ID
247    SerializeInstancedStaticMeshRenderData,
248
249    /// Cache material quality node usage
250    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_SUMMARY_LOCALIZATION_ID
251    CachedMaterialQualityNodeUsage,
252
253    /// Font outlines no longer apply to drop shadows for new objects but we maintain the opposite way for backwards compat
254    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_SUMMARY_LOCALIZATION_ID
255    FontOutlineDropShadowFixup,
256
257    /// New skeletal mesh import workflow (Geometry only or animation only re-import )
258    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_SUMMARY_LOCALIZATION_ID
259    NewSkeletalMeshImporterWorkflow,
260
261    /// Migrate data from previous data structure to new one to support materials per LOD on the Landscape
262    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_SUMMARY_LOCALIZATION_ID
263    NewLandscapeMaterialPerLOD,
264
265    /// New Pose Asset data type
266    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_SUMMARY_LOCALIZATION_ID
267    RemoveUnnecessaryTracksFromPose,
268
269    /// Migrate Foliage TLazyObjectPtr to TSoftObjectPtr
270    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_SUMMARY_LOCALIZATION_ID
271    FoliageLazyObjPtrToSoftObjPtr,
272
273    /// TimelineTemplates store their derived names instead of dynamically generating. This code tied to this version was reverted and redone at a later date
274    /// Introduced: ObjectVersion.VER_UE4_FIX_WIDE_STRING_CRC
275    RevertedStoreTimelineNamesInTemplate,
276
277    /// Added BakePoseOverride for LOD setting
278    /// Introduced: ObjectVersion.VER_UE4_FIX_WIDE_STRING_CRC
279    AddBakePoseOverrideForSkeletalMeshReductionSetting,
280
281    /// TimelineTemplates store their derived names instead of dynamically generating
282    /// Introduced: ObjectVersion.VER_UE4_FIX_WIDE_STRING_CRC
283    StoreTimelineNamesInTemplate,
284
285    /// New Pose Asset data type
286    /// Introduced: ObjectVersion.VER_UE4_FIX_WIDE_STRING_CRC
287    WidgetStopDuplicatingAnimations,
288
289    /// Allow reducing of the base LOD, we need to store some imported model data so we can reduce again from the same data.
290    /// Introduced: ObjectVersion.VER_UE4_FIX_WIDE_STRING_CRC
291    AllowSkeletalMeshToReduceTheBaseLOD,
292
293    /// Curve Table size reduction
294    /// Introduced: ObjectVersion.VER_UE4_FIX_WIDE_STRING_CRC
295    ShrinkCurveTableSize,
296
297    /// Widgets upgraded with WidgetStopDuplicatingAnimations, may not correctly default-to-self for the widget parameter.
298    /// Introduced: ObjectVersion.VER_UE4_FIX_WIDE_STRING_CRC
299    WidgetAnimationDefaultToSelfFail,
300
301    /// HUDWidgets now require an element tag
302    /// Introduced: ObjectVersion.VER_UE4_FIX_WIDE_STRING_CRC
303    FortHUDElementNowRequiresTag,
304
305    /// Animation saved as bulk data when cooked
306    /// Introduced: ObjectVersion.VER_UE4_FIX_WIDE_STRING_CRC
307    FortMappedCookedAnimation,
308
309    /// Support Virtual Bone in Retarget Manager
310    /// Introduced: ObjectVersion.VER_UE4_FIX_WIDE_STRING_CRC
311    SupportVirtualBoneInRetargeting,
312
313    /// Fixup bad defaults in water metadata
314    /// Introduced: ObjectVersion.VER_UE4_FIX_WIDE_STRING_CRC
315    FixUpWaterMetadata,
316
317    /// Move the location of water metadata
318    /// Introduced: ObjectVersion.VER_UE4_FIX_WIDE_STRING_CRC
319    MoveWaterMetadataToActor,
320
321    /// Replaced lake collision component
322    /// Introduced: ObjectVersion.VER_UE4_FIX_WIDE_STRING_CRC
323    ReplaceLakeCollision,
324
325    /// Anim layer node names are now conformed by Guid
326    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_OWNER
327    AnimLayerGuidConformation,
328
329    /// Ocean collision component has become dynamic
330    /// Introduced: ObjectVersion.VER_UE4_SKINWEIGHT_PROFILE_DATA_LAYOUT_CHANGES
331    MakeOceanCollisionTransient,
332
333    /// FFieldPath will serialize the owner struct reference and only a short path to its property
334    /// Introduced: ObjectVersion.VER_UE4_SKINWEIGHT_PROFILE_DATA_LAYOUT_CHANGES
335    FFieldPathOwnerSerialization,
336
337    /// Simplified WaterBody post process material handling
338    /// Introduced: ObjectVersion.VER_UE4_SKINWEIGHT_PROFILE_DATA_LAYOUT_CHANGES
339    FixUpUnderwaterPostProcessMaterial,
340
341    /// A single water exclusion volume can now exclude N water bodies
342    /// Introduced: ObjectVersion.VER_UE4_SKINWEIGHT_PROFILE_DATA_LAYOUT_CHANGES
343    SupportMultipleWaterBodiesPerExclusionVolume,
344
345    /// Serialize rigvm operators one by one instead of the full byte code array to ensure determinism
346    /// Introduced: ObjectVersion.VER_UE4_NON_OUTER_PACKAGE_IMPORT
347    RigVMByteCodeDeterminism,
348
349    /// Serialize the physical materials generated by the render material
350    /// Introduced: ObjectVersion.VER_UE4_NON_OUTER_PACKAGE_IMPORT
351    LandscapePhysicalMaterialRenderData,
352
353    /// RuntimeVirtualTextureVolume fix transforms
354    /// Introduced: ObjectVersion.VER_UE4_NON_OUTER_PACKAGE_IMPORT
355    FixupRuntimeVirtualTextureVolume,
356
357    /// Retrieve water body collision components that were lost in cooked builds
358    /// Introduced: ObjectVersion.VER_UE4_NON_OUTER_PACKAGE_IMPORT
359    FixUpRiverCollisionComponents,
360
361    /// Fix duplicate spline mesh components on rivers
362    /// Introduced: ObjectVersion.VER_UE4_NON_OUTER_PACKAGE_IMPORT
363    FixDuplicateRiverSplineMeshCollisionComponents,
364
365    /// Indicates level has stable actor guids
366    /// Introduced: ObjectVersion.VER_UE4_NON_OUTER_PACKAGE_IMPORT
367    ContainsStableActorGUIDs,
368
369    /// Levelset Serialization support for BodySetup.
370    /// Introduced: ObjectVersion.VER_UE4_NON_OUTER_PACKAGE_IMPORT
371    LevelsetSerializationSupportForBodySetup,
372
373    /// Moving Chaos solver properties to allow them to exist in the project physics settings
374    /// Introduced: ObjectVersion.VER_UE4_ASSETREGISTRY_DEPENDENCYFLAGS
375    ChaosSolverPropertiesMoved,
376
377    /// Moving some UFortGameFeatureData properties and behaviors into the UGameFeatureAction pattern
378    /// Introduced: ObjectVersion.VER_UE4_CORRECT_LICENSEE_FLAG
379    GameFeatureDataMovedComponentListAndCheats,
380
381    /// Add centrifugal forces for cloth
382    /// Introduced: ObjectVersion.VER_UE4_CORRECT_LICENSEE_FLAG
383    ChaosClothAddfictitiousforces,
384
385    /// Chaos Convex StructureData supports different index sizes based on num verts/planes. Chaos FConvex uses array of FVec3s for vertices instead of particles (Merged from //UE4/Main)
386    /// Introduced: ObjectVersion.VER_UE4_CORRECT_LICENSEE_FLAG
387    ChaosConvexVariableStructureDataAndVerticesArray,
388
389    /// Remove the WaterVelocityHeightTexture dependency on MPC_Landscape and LandscapeWaterIndo
390    /// Introduced: ObjectVersion.VER_UE4_CORRECT_LICENSEE_FLAG
391    RemoveLandscapeWaterInfo,
392
393    // CHANGES BEYOND HERE ARE UE5 ONLY //
394    /// Added the weighted value property type to store the cloths weight maps' low/high ranges
395    /// Introduced: EngineVersion.VER_UE4_AUTOMATIC_VERSION_PLUS_ONE
396    ChaosClothAddWeightedValue,
397
398    /// Added the Long Range Attachment stiffness weight map
399    /// Introduced: EngineVersion.VER_UE4_AUTOMATIC_VERSION_PLUS_ONE
400    ChaosClothAddTetherStiffnessWeightMap,
401
402    /// Fix corrupted LOD transition maps
403    /// Introduced: EngineVersion.VER_UE4_AUTOMATIC_VERSION_PLUS_ONE
404    ChaosClothFixLODTransitionMaps,
405
406    /// Enable a few more weight maps to better art direct the cloth simulation
407    /// Introduced: EngineVersion.VER_UE4_AUTOMATIC_VERSION_PLUS_ONE
408    ChaosClothAddTetherScaleAndDragLiftWeightMaps,
409
410    /// Enable material (edge, bending, and area stiffness) weight maps
411    /// Introduced: EngineVersion.VER_UE4_AUTOMATIC_VERSION_PLUS_ONE
412    ChaosClothAddMaterialWeightMaps,
413
414    /// Added bShowCurve for movie scene float channel serialization
415    /// Introduced: EngineVersion.VER_UE4_AUTOMATIC_VERSION_PLUS_ONE
416    SerializeFloatChannelShowCurve,
417
418    /// Minimize slack waste by using a single array for grass data
419    /// Introduced: EngineVersion.VER_UE4_AUTOMATIC_VERSION_PLUS_ONE
420    LandscapeGrassSingleArray,
421
422    /// Add loop counters to sequencer's compiled sub-sequence data
423    /// Introduced: EngineVersion.VER_UE4_AUTOMATIC_VERSION_PLUS_ONE
424    AddedSubSequenceEntryWarpCounter,
425
426    /// Water plugin is now component-based rather than actor based
427    /// Introduced: EngineVersion.VER_UE4_AUTOMATIC_VERSION_PLUS_ONE
428    WaterBodyComponentRefactor,
429
430    /// Cooked BPGC storing editor-only asset tags
431    /// Introduced: EngineVersion.VER_UE4_AUTOMATIC_VERSION_PLUS_ONE
432    BPGCCookedEditorTags,
433
434    /// Terrain layer weights are no longer considered material parameters
435    /// Introduced: EngineVersion.VER_UE4_AUTOMATIC_VERSION_PLUS_ONE
436    TerrainLayerWeightsAreNotParameters,
437
438    /// Anim Dynamics Node Gravity Override vector is now defined in world space, not simulation space.
439    /// Legacy behavior can be maintained with a flag, which is set false by default for new nodes,
440    /// true for nodes predating this change.
441    GravityOverrideDefinedInWorldSpace,
442
443    /// Introduced: ObjectVersion.VER_UE4_AUTOMATIC_VERSION_PLUS_ONE
444    VersionPlusOne,
445    /// Introduced: ObjectVersion.VER_UE4_AUTOMATIC_VERSION
446    LatestVersion = (FFortniteMainBranchObjectVersion::VersionPlusOne as i32) + 1,
447}
448
449impl_custom_version_trait!(
450    FFortniteMainBranchObjectVersion,
451    "FFortniteMainBranchObjectVersion",
452    new_guid(0x601D1886, 0xAC644F84, 0xAA16D3DE, 0x0DEAC7D6),
453    VER_UE4_AUTOMATIC_VERSION: LatestVersion,
454    VER_UE4_AUTOMATIC_VERSION_PLUS_ONE: VersionPlusOne,
455    VER_UE4_27: RemoveLandscapeWaterInfo,
456    VER_UE4_26: ChaosSolverPropertiesMoved,
457    VER_UE4_24: AnimLayerGuidConformation,
458    VER_UE4_23: SupportVirtualBoneInRetargeting,
459    VER_UE4_22: FortHUDElementNowRequiresTag,
460    VER_UE4_21: FoliageLazyObjPtrToSoftObjPtr,
461    VER_UE4_20: CachedMaterialQualityNodeUsage,
462    VER_UE4_OLDEST_LOADABLE_PACKAGE: BeforeCustomVersionWasAdded
463);
464
465/// Custom serialization version for changes made in Dev-Framework stream.
466#[derive(IntoPrimitive)]
467#[repr(i32)]
468pub enum FFrameworkObjectVersion {
469    /// Before any version changes were made
470    /// Introduced: ObjectVersion.VER_UE4_OLDEST_LOADABLE_PACKAGE
471    BeforeCustomVersionWasAdded = 0,
472
473    /// BodySetup's default instance collision profile is used by default when creating a new instance.
474    /// Introduced: ObjectVersion.VER_UE4_STREAMABLE_TEXTURE_AABB
475    UseBodySetupCollisionProfile,
476
477    /// Regenerate subgraph arrays correctly in animation blueprints to remove duplicates and add missing graphs that appear read only when edited
478    /// Introduced: ObjectVersion.VER_UE4_PROPERTY_GUID_IN_PROPERTY_TAG
479    AnimBlueprintSubgraphFix,
480
481    /// Static and skeletal mesh sockets now use the specified scale
482    /// Introduced: ObjectVersion.VER_UE4_NAME_HASHES_SERIALIZED
483    MeshSocketScaleUtilization,
484
485    /// Attachment rules are now explicit in how they affect location, rotation and scale
486    /// Introduced: ObjectVersion.VER_UE4_NAME_HASHES_SERIALIZED
487    ExplicitAttachmentRules,
488
489    /// Moved compressed anim data from uasset to the DDC
490    /// Introduced: ObjectVersion.VER_UE4_NAME_HASHES_SERIALIZED
491    MoveCompressedAnimDataToTheDDC,
492
493    /// Some graph pins created using legacy code seem to have lost the RF_Transactional flag, which causes issues with undo. Restore the flag at this version
494    /// Introduced: ObjectVersion.VER_UE4_NAME_HASHES_SERIALIZED
495    FixNonTransactionalPins,
496
497    /// Create new struct for SmartName, and use that for CurveName
498    /// Introduced: ObjectVersion.VER_UE4_NAME_HASHES_SERIALIZED
499    SmartNameRefactor,
500
501    /// Add Reference Skeleton to Rig
502    /// Introduced: ObjectVersion.VER_UE4_NAME_HASHES_SERIALIZED
503    AddSourceReferenceSkeletonToRig,
504
505    /// Refactor ConstraintInstance so that we have an easy way to swap behavior paramters
506    /// Introduced: ObjectVersion.VER_UE4_INSTANCED_STEREO_UNIFORM_REFACTOR
507    ConstraintInstanceBehaviorParameters,
508
509    /// Pose Asset support mask per bone
510    /// Introduced: ObjectVersion.VER_UE4_INSTANCED_STEREO_UNIFORM_REFACTOR
511    PoseAssetSupportPerBoneMask,
512
513    /// Physics Assets now use SkeletalBodySetup instead of BodySetup
514    /// Introduced: ObjectVersion.VER_UE4_INSTANCED_STEREO_UNIFORM_REFACTOR
515    PhysAssetUseSkeletalBodySetup,
516
517    /// Remove SoundWave CompressionName
518    /// Introduced: ObjectVersion.VER_UE4_INSTANCED_STEREO_UNIFORM_REFACTOR
519    RemoveSoundWaveCompressionName,
520
521    /// Switched render data for clothing over to unreal data, reskinned to the simulation mesh
522    /// Introduced: ObjectVersion.VER_UE4_INSTANCED_STEREO_UNIFORM_REFACTOR
523    AddInternalClothingGraphicalSkinning,
524
525    /// Wheel force offset is now applied at the wheel instead of vehicle COM
526    /// Introduced: ObjectVersion.VER_UE4_INSTANCED_STEREO_UNIFORM_REFACTOR
527    WheelOffsetIsFromWheel,
528
529    /// Move curve metadata to be saved in skeleton. Individual asset still saves some flag - i.e. disabled curve and editable or not, but major flag - i.e. material types - moves to skeleton and handle in one place
530    /// Introduced: ObjectVersion.VER_UE4_COMPRESSED_SHADER_RESOURCES
531    MoveCurveTypesToSkeleton,
532
533    /// Cache destructible overlaps on save
534    /// Introduced: ObjectVersion.VER_UE4_TemplateIndex_IN_COOKED_EXPORTS
535    CacheDestructibleOverlaps,
536
537    /// Added serialization of materials applied to geometry cache objects
538    /// Introduced: ObjectVersion.VER_UE4_TemplateIndex_IN_COOKED_EXPORTS
539    GeometryCacheMissingMaterials,
540
541    /// Switch static and skeletal meshes to calculate LODs based on resolution-independent screen size
542    /// Introduced: ObjectVersion.VER_UE4_ADDED_SEARCHABLE_NAMES
543    LODsUseResolutionIndependentScreenSize,
544
545    /// Blend space post load verification
546    /// Introduced: ObjectVersion.VER_UE4_ADDED_SEARCHABLE_NAMES
547    BlendSpacePostLoadSnapToGrid,
548
549    /// Addition of rate scales to blend space samples
550    /// Introduced: ObjectVersion.VER_UE4_ADDED_SEARCHABLE_NAMES
551    SupportBlendSpaceRateScale,
552
553    /// LOD hysteresis also needs conversion from the LODsUseResolutionIndependentScreenSize version
554    /// Introduced: ObjectVersion.VER_UE4_ADDED_SEARCHABLE_NAMES
555    LODHysteresisUseResolutionIndependentScreenSize,
556
557    /// AudioComponent override subtitle priority default change
558    /// Introduced: ObjectVersion.VER_UE4_ADDED_SEARCHABLE_NAMES
559    ChangeAudioComponentOverrideSubtitlePriorityDefault,
560
561    /// Serialize hard references to sound files when possible
562    /// Introduced: ObjectVersion.VER_UE4_64BIT_EXPORTMAP_SERIALSIZES
563    HardSoundReferences,
564
565    /// Enforce const correctness in Animation Blueprint function graphs
566    /// Introduced: ObjectVersion.VER_UE4_ADDED_SWEEP_WHILE_WALKING_FLAG
567    EnforceConstInAnimBlueprintFunctionGraphs,
568
569    /// Upgrade the InputKeySelector to use a text style
570    /// Introduced: ObjectVersion.VER_UE4_ADDED_SWEEP_WHILE_WALKING_FLAG
571    InputKeySelectorTextStyle,
572
573    /// Represent a pins container type as an enum not 3 independent booleans
574    /// Introduced: ObjectVersion.VER_UE4_ADDED_SWEEP_WHILE_WALKING_FLAG
575    EdGraphPinContainerType,
576
577    /// Switch asset pins to store as string instead of hard object reference
578    /// Introduced: ObjectVersion.VER_UE4_ADDED_SWEEP_WHILE_WALKING_FLAG
579    ChangeAssetPinsToString,
580
581    /// Fix Local Variables so that the properties are correctly flagged as blueprint visible
582    /// Introduced: ObjectVersion.VER_UE4_ADDED_SWEEP_WHILE_WALKING_FLAG
583    LocalVariablesBlueprintVisible,
584
585    /// Stopped serializing UField_Next so that UFunctions could be serialized in dependently of a UClass in order to allow us to do all UFunction loading in a single pass (after classes and CDOs are created)
586    /// Introduced: ObjectVersion.VER_UE4_ADDED_SOFT_OBJECT_PATH
587    RemoveUfieldNext,
588
589    /// Fix User Defined structs so that all members are correct flagged blueprint visible
590    /// Introduced: ObjectVersion.VER_UE4_ADDED_SOFT_OBJECT_PATH
591    UserDefinedStructsBlueprintVisible,
592
593    /// FMaterialInput and FEdGraphPin store their name as FName instead of FString
594    /// Introduced: ObjectVersion.VER_UE4_ADDED_SOFT_OBJECT_PATH
595    PinsStoreFName,
596
597    /// User defined structs store their default instance, which is used for initializing instances
598    /// Introduced: ObjectVersion.VER_UE4_POINTLIGHT_SOURCE_ORIENTATION
599    UserDefinedStructsStoreDefaultInstance,
600
601    /// Function terminator nodes serialize an FMemberReference rather than a name/class pair
602    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_SUMMARY_LOCALIZATION_ID
603    FunctionTerminatorNodesUseMemberReference,
604
605    /// Custom event and non-native interface event implementations add 'const' to reference parameters
606    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_SUMMARY_LOCALIZATION_ID
607    EditableEventsUseConstRefParameters,
608
609    /// No longer serialize the legacy flag that indicates this state, as it is now implied since we don't serialize the skeleton CDO
610    /// Introduced: ObjectVersion.VER_UE4_FIX_WIDE_STRING_CRC
611    BlueprintGeneratedClassIsAlwaysAuthoritative,
612
613    /// Enforce visibility of blueprint functions - e.g. raise an error if calling a private function from another blueprint:
614    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_OWNER
615    EnforceBlueprintFunctionVisibility,
616
617    /// ActorComponents now store their serialization index
618    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_OWNER
619    StoringUCSSerializationIndex,
620
621    /// Introduced: ObjectVersion.VER_UE4_AUTOMATIC_VERSION_PLUS_ONE
622    VersionPlusOne,
623    /// Introduced: ObjectVersion.VER_UE4_AUTOMATIC_VERSION
624    LatestVersion = (FFrameworkObjectVersion::VersionPlusOne as i32) + 1,
625}
626
627impl_custom_version_trait!(
628    FFrameworkObjectVersion,
629    "FFrameworkObjectVersion",
630    new_guid(0xCFFC743F, 0x43B04480, 0x939114DF, 0x171D2073),
631    VER_UE4_AUTOMATIC_VERSION: LatestVersion,
632    VER_UE4_AUTOMATIC_VERSION_PLUS_ONE: VersionPlusOne,
633    VER_UE4_25: StoringUCSSerializationIndex,
634    VER_UE4_24: EnforceBlueprintFunctionVisibility,
635    VER_UE4_22: BlueprintGeneratedClassIsAlwaysAuthoritative,
636    VER_UE4_20: EditableEventsUseConstRefParameters,
637    VER_UE4_19: FunctionTerminatorNodesUseMemberReference,
638    VER_UE4_18: UserDefinedStructsBlueprintVisible,
639    VER_UE4_17: LocalVariablesBlueprintVisible,
640    VER_UE4_16: HardSoundReferences,
641    VER_UE4_15: ChangeAudioComponentOverrideSubtitlePriorityDefault,
642    VER_UE4_14: GeometryCacheMissingMaterials,
643    VER_UE4_13: RemoveSoundWaveCompressionName,
644    VER_UE4_12: FixNonTransactionalPins,
645    VER_UE4_OLDEST_LOADABLE_PACKAGE: BeforeCustomVersionWasAdded
646);
647
648/// Custom serialization version for changes made in Dev-Core stream.
649#[derive(IntoPrimitive)]
650#[repr(i32)]
651pub enum FCoreObjectVersion {
652    /// Before any version changes were made
653    /// Introduced: ObjectVersion.VER_UE4_OLDEST_LOADABLE_PACKAGE
654    BeforeCustomVersionWasAdded = 0,
655
656    /// Introduced: ObjectVersion.VER_UE4_PROPERTY_GUID_IN_PROPERTY_TAG
657    MaterialInputNativeSerialize,
658
659    /// Introduced: ObjectVersion.VER_UE4_ADDED_SEARCHABLE_NAMES
660    EnumProperties,
661
662    /// Introduced: ObjectVersion.VER_UE4_FIX_WIDE_STRING_CRC
663    SkeletalMaterialEditorDataStripping,
664
665    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_OWNER
666    FProperties,
667
668    /// Introduced: ObjectVersion.VER_UE4_AUTOMATIC_VERSION_PLUS_ONE
669    VersionPlusOne,
670    /// Introduced: ObjectVersion.VER_UE4_AUTOMATIC_VERSION
671    LatestVersion = (FCoreObjectVersion::VersionPlusOne as i32) + 1,
672}
673
674impl_custom_version_trait!(
675    FCoreObjectVersion,
676    "FCoreObjectVersion",
677    new_guid(0x375EC13C, 0x06E448FB, 0xB50084F0, 0x262A717E),
678    VER_UE4_AUTOMATIC_VERSION: LatestVersion,
679    VER_UE4_AUTOMATIC_VERSION_PLUS_ONE: VersionPlusOne,
680    VER_UE4_25: FProperties,
681    VER_UE4_22: SkeletalMaterialEditorDataStripping,
682    VER_UE4_15: EnumProperties,
683    VER_UE4_12: MaterialInputNativeSerialize,
684    VER_UE4_OLDEST_LOADABLE_PACKAGE: BeforeCustomVersionWasAdded
685);
686
687/// Custom serialization version for changes made in Dev-Editor stream.
688#[derive(IntoPrimitive)]
689#[repr(i32)]
690pub enum FEditorObjectVersion {
691    /// Before any version changes were made
692    /// Introduced: ObjectVersion.VER_UE4_OLDEST_LOADABLE_PACKAGE
693    BeforeCustomVersionWasAdded = 0,
694
695    /// Localizable text gathered and stored in packages is now flagged with a localizable text gathering process version
696    /// Introduced: ObjectVersion.VER_UE4_STREAMABLE_TEXTURE_AABB
697    GatheredTextProcessVersionFlagging,
698
699    /// Fixed several issues with the gathered text cache stored in package headers
700    /// Introduced: ObjectVersion.VER_UE4_NAME_HASHES_SERIALIZED
701    GatheredTextPackageCacheFixesV1,
702
703    /// Added support for "root" meta-data (meta-data not associated with a particular object in a package)
704    /// Introduced: ObjectVersion.VER_UE4_INSTANCED_STEREO_UNIFORM_REFACTOR
705    RootMetaDataSupport,
706
707    /// Fixed issues with how Blueprint bytecode was cached
708    /// Introduced: ObjectVersion.VER_UE4_INSTANCED_STEREO_UNIFORM_REFACTOR
709    GatheredTextPackageCacheFixesV2,
710
711    /// Updated FFormatArgumentData to allow variant data to be marshaled from a BP into C++
712    /// Introduced: ObjectVersion.VER_UE4_INSTANCED_STEREO_UNIFORM_REFACTOR
713    TextFormatArgumentDataIsVariant,
714
715    /// Changes to SplineComponent
716    /// Introduced: ObjectVersion.VER_UE4_INSTANCED_STEREO_UNIFORM_REFACTOR
717    SplineComponentCurvesInStruct,
718
719    /// Updated ComboBox to support toggling the menu open, better controller support
720    /// Introduced: ObjectVersion.VER_UE4_COMPRESSED_SHADER_RESOURCES
721    ComboBoxControllerSupportUpdate,
722
723    /// Refactor mesh editor materials
724    /// Introduced: ObjectVersion.VER_UE4_COMPRESSED_SHADER_RESOURCES
725    RefactorMeshEditorMaterials,
726
727    /// Added UFontFace assets
728    /// Introduced: ObjectVersion.VER_UE4_TemplateIndex_IN_COOKED_EXPORTS
729    AddedFontFaceAssets,
730
731    /// Add UPROPERTY for TMap of Mesh section, so the serialize will be done normally (and export to text will work correctly)
732    /// Introduced: ObjectVersion.VER_UE4_ADDED_SEARCHABLE_NAMES
733    UPropertryForMeshSection,
734
735    /// Update the schema of all widget blueprints to use the WidgetGraphSchema
736    /// Introduced: ObjectVersion.VER_UE4_ADDED_SEARCHABLE_NAMES
737    WidgetGraphSchema,
738
739    /// Added a specialized content slot to the background blur widget
740    /// Introduced: ObjectVersion.VER_UE4_ADDED_SEARCHABLE_NAMES
741    AddedBackgroundBlurContentSlot,
742
743    /// Updated UserDefinedEnums to have stable keyed display names
744    /// Introduced: ObjectVersion.VER_UE4_ADDED_SEARCHABLE_NAMES
745    StableUserDefinedEnumDisplayNames,
746
747    /// Added "Inline" option to UFontFace assets
748    /// Introduced: ObjectVersion.VER_UE4_ADDED_SEARCHABLE_NAMES
749    AddedInlineFontFaceAssets,
750
751    /// Fix a serialization issue with static mesh FMeshSectionInfoMap FProperty
752    /// Introduced: ObjectVersion.VER_UE4_ADDED_SEARCHABLE_NAMES
753    UPropertryForMeshSectionSerialize,
754
755    /// Adding a version bump for the new fast widget construction in case of problems.
756    /// Introduced: ObjectVersion.VER_UE4_64BIT_EXPORTMAP_SERIALSIZES
757    FastWidgetTemplates,
758
759    /// Update material thumbnails to be more intelligent on default primitive shape for certain material types
760    /// Introduced: ObjectVersion.VER_UE4_64BIT_EXPORTMAP_SERIALSIZES
761    MaterialThumbnailRenderingChanges,
762
763    /// Introducing a new clipping system for Slate/UMG
764    /// Introduced: ObjectVersion.VER_UE4_ADDED_SWEEP_WHILE_WALKING_FLAG
765    NewSlateClippingSystem,
766
767    /// MovieScene Meta Data added as native Serialization
768    /// Introduced: ObjectVersion.VER_UE4_ADDED_SWEEP_WHILE_WALKING_FLAG
769    MovieSceneMetaDataSerialization,
770
771    /// Text gathered from properties now adds two variants: a version without the package localization ID (for use at runtime), and a version with it (which is editor-only)
772    /// Introduced: ObjectVersion.VER_UE4_ADDED_SWEEP_WHILE_WALKING_FLAG
773    GatheredTextEditorOnlyPackageLocId,
774
775    /// Added AlwaysSign to FNumberFormattingOptions
776    /// Introduced: ObjectVersion.VER_UE4_ADDED_SOFT_OBJECT_PATH
777    AddedAlwaysSignNumberFormattingOption,
778
779    /// Added additional objects that must be serialized as part of this new material feature
780    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_SUMMARY_LOCALIZATION_ID
781    AddedMaterialSharedInputs,
782
783    /// Added morph target section indices
784    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_SUMMARY_LOCALIZATION_ID
785    AddedMorphTargetSectionIndices,
786
787    /// Serialize the instanced static mesh render data, to avoid building it at runtime
788    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_SUMMARY_LOCALIZATION_ID
789    SerializeInstancedStaticMeshRenderData,
790
791    /// Change to MeshDescription serialization (moved to release)
792    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_SUMMARY_LOCALIZATION_ID
793    MeshDescriptionNewSerializationMovedToRelease,
794
795    /// New format for mesh description attributes
796    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_SUMMARY_LOCALIZATION_ID
797    MeshDescriptionNewAttributeFormat,
798
799    /// Switch root component of SceneCapture actors from MeshComponent to SceneComponent
800    /// Introduced: ObjectVersion.VER_UE4_FIX_WIDE_STRING_CRC
801    ChangeSceneCaptureRootComponent,
802
803    /// StaticMesh serializes MeshDescription instead of RawMesh
804    /// Introduced: ObjectVersion.VER_UE4_FIX_WIDE_STRING_CRC
805    StaticMeshDeprecatedRawMesh,
806
807    /// MeshDescriptionBulkData contains a Guid used as a DDC key
808    /// Introduced: ObjectVersion.VER_UE4_FIX_WIDE_STRING_CRC
809    MeshDescriptionBulkDataGuid,
810
811    /// Change to MeshDescription serialization (removed FMeshPolygon::HoleContours)
812    /// Introduced: ObjectVersion.VER_UE4_FIX_WIDE_STRING_CRC
813    MeshDescriptionRemovedHoles,
814
815    /// Change to the WidgetCompoent WindowVisibilty default value
816    /// Introduced: ObjectVersion.VER_UE4_FIX_WIDE_STRING_CRC
817    ChangedWidgetComponentWindowVisibilityDefault,
818
819    /// Avoid keying culture invariant display strings during serialization to avoid non-deterministic cooking issues
820    /// Introduced: ObjectVersion.VER_UE4_FIX_WIDE_STRING_CRC
821    CultureInvariantTextSerializationKeyStability,
822
823    /// Change to UScrollBar and UScrollBox thickness property (removed implicit padding of 2, so thickness value must be incremented by 4).
824    /// Introduced: ObjectVersion.VER_UE4_FIX_WIDE_STRING_CRC
825    ScrollBarThicknessChange,
826
827    /// Deprecated LandscapeHoleMaterial
828    /// Introduced: ObjectVersion.VER_UE4_FIX_WIDE_STRING_CRC
829    RemoveLandscapeHoleMaterial,
830
831    /// MeshDescription defined by triangles instead of arbitrary polygons
832    /// Introduced: ObjectVersion.VER_UE4_FIX_WIDE_STRING_CRC
833    MeshDescriptionTriangles,
834
835    /// Add weighted area and angle when computing the normals
836    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_OWNER
837    ComputeWeightedNormals,
838
839    /// SkeletalMesh now can be rebuild in editor, no more need to re-import
840    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_OWNER
841    SkeletalMeshBuildRefactor,
842
843    /// Move all SkeletalMesh source data into a private uasset in the same package has the skeletalmesh
844    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_OWNER
845    SkeletalMeshMoveEditorSourceDataToPrivateAsset,
846
847    /// Parse text only if the number is inside the limits of its type
848    /// Introduced: ObjectVersion.VER_UE4_NON_OUTER_PACKAGE_IMPORT
849    NumberParsingOptionsNumberLimitsAndClamping,
850
851    /// Make sure we can have more then 255 material in the skeletal mesh source data
852    /// Introduced: ObjectVersion.VER_UE4_NON_OUTER_PACKAGE_IMPORT
853    SkeletalMeshSourceDataSupport16bitOfMaterialNumber,
854
855    /// Introduced: ObjectVersion.VER_UE4_AUTOMATIC_VERSION_PLUS_ONE
856    VersionPlusOne,
857    /// Introduced: ObjectVersion.VER_UE4_AUTOMATIC_VERSION
858    LatestVersion = (FEditorObjectVersion::VersionPlusOne as i32) + 1,
859}
860
861impl_custom_version_trait!(
862    FEditorObjectVersion,
863    "FEditorObjectVersion",
864    new_guid(0xE4B068ED, 0xF49442E9, 0xA231DA0B, 0x2E46BB41),
865    VER_UE4_AUTOMATIC_VERSION: LatestVersion,
866    VER_UE4_AUTOMATIC_VERSION_PLUS_ONE: VersionPlusOne,
867    VER_UE4_26: SkeletalMeshSourceDataSupport16bitOfMaterialNumber,
868    VER_UE4_25: SkeletalMeshMoveEditorSourceDataToPrivateAsset,
869    VER_UE4_24: SkeletalMeshBuildRefactor,
870    VER_UE4_23: RemoveLandscapeHoleMaterial,
871    VER_UE4_22: MeshDescriptionRemovedHoles,
872    VER_UE4_21: MeshDescriptionNewAttributeFormat,
873    VER_UE4_20: SerializeInstancedStaticMeshRenderData,
874    VER_UE4_19: AddedMorphTargetSectionIndices,
875    VER_UE4_17: GatheredTextEditorOnlyPackageLocId,
876    VER_UE4_16: MaterialThumbnailRenderingChanges,
877    VER_UE4_15: AddedInlineFontFaceAssets,
878    VER_UE4_14: AddedFontFaceAssets,
879    VER_UE4_13: SplineComponentCurvesInStruct,
880    VER_UE4_12: GatheredTextPackageCacheFixesV1,
881    VER_UE4_OLDEST_LOADABLE_PACKAGE: BeforeCustomVersionWasAdded
882);
883
884/// Custom serialization version for changes made in Dev-AnimPhys stream
885#[derive(IntoPrimitive)]
886#[repr(i32)]
887pub enum FAnimPhysObjectVersion {
888    /// Before any version changes were made
889    /// Introduced: ObjectVersion.VER_UE4_OLDEST_LOADABLE_PACKAGE
890    BeforeCustomVersionWasAdded,
891
892    /// convert animnode look at to use just default axis instead of enum, which doesn't do much
893    /// Introduced: ObjectVersion.VER_UE4_ADDED_SWEEP_WHILE_WALKING_FLAG
894    ConvertAnimNodeLookAtAxis,
895
896    /// Change FKSphylElem and FKBoxElem to use Rotators not Quats for easier editing
897    /// Introduced: ObjectVersion.VER_UE4_ADDED_SWEEP_WHILE_WALKING_FLAG
898    BoxSphylElemsUseRotators,
899
900    /// Change thumbnail scene info and asset import data to be transactional
901    /// Introduced: ObjectVersion.VER_UE4_ADDED_SWEEP_WHILE_WALKING_FLAG
902    ThumbnailSceneInfoAndAssetImportDataAreTransactional,
903
904    /// Enabled clothing masks rather than painting parameters directly
905    /// Introduced: ObjectVersion.VER_UE4_ADDED_SWEEP_WHILE_WALKING_FLAG
906    AddedClothingMaskWorkflow,
907
908    /// Remove UID from smart name serialize, it just breaks determinism
909    /// Introduced: ObjectVersion.VER_UE4_ADDED_SWEEP_WHILE_WALKING_FLAG
910    RemoveUIDFromSmartNameSerialize,
911
912    /// Convert FName Socket to FSocketReference and added TargetReference that support bone and socket
913    /// Introduced: ObjectVersion.VER_UE4_ADDED_SWEEP_WHILE_WALKING_FLAG
914    CreateTargetReference,
915
916    /// Tune soft limit stiffness and damping coefficients
917    /// Introduced: ObjectVersion.VER_UE4_ADDED_SWEEP_WHILE_WALKING_FLAG
918    TuneSoftLimitStiffnessAndDamping,
919
920    /// Fix possible inf/nans in clothing particle masses
921    /// Introduced: ObjectVersion.VER_UE4_ADDED_SWEEP_WHILE_WALKING_FLAG
922    FixInvalidClothParticleMasses,
923
924    /// Moved influence count to cached data
925    /// Introduced: ObjectVersion.VER_UE4_ADDED_SWEEP_WHILE_WALKING_FLAG
926    CacheClothMeshInfluences,
927
928    /// Remove GUID from Smart Names entirely + remove automatic name fixup
929    /// Introduced: ObjectVersion.VER_UE4_ADDED_SOFT_OBJECT_PATH
930    SmartNameRefactorForDeterministicCooking,
931
932    /// rename the variable and allow individual curves to be set
933    /// Introduced: ObjectVersion.VER_UE4_ADDED_SOFT_OBJECT_PATH
934    RenameDisableAnimCurvesToAllowAnimCurveEvaluation,
935
936    /// link curve to LOD, so curve metadata has to include LODIndex
937    /// Introduced: ObjectVersion.VER_UE4_ADDED_SOFT_OBJECT_PATH
938    AddLODToCurveMetaData,
939
940    /// Fixed blend profile references persisting after paste when they aren't compatible
941    /// Introduced: ObjectVersion.VER_UE4_ADDED_SOFT_OBJECT_PATH
942    FixupBadBlendProfileReferences,
943
944    /// Allowing multiple audio plugin settings
945    /// Introduced: ObjectVersion.VER_UE4_ADDED_SOFT_OBJECT_PATH
946    AllowMultipleAudioPluginSettings,
947
948    /// Change RetargetSource reference to SoftObjectPtr
949    /// Introduced: ObjectVersion.VER_UE4_POINTLIGHT_SOURCE_ORIENTATION
950    ChangeRetargetSourceReferenceToSoftObjectPtr,
951
952    /// Save editor only full pose for pose asset
953    /// Introduced: ObjectVersion.VER_UE4_POINTLIGHT_SOURCE_ORIENTATION
954    SaveEditorOnlyFullPoseForPoseAsset,
955
956    /// Asset change and cleanup to facilitate new streaming system
957    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_SUMMARY_LOCALIZATION_ID
958    GeometryCacheAssetDeprecation,
959
960    /// Introduced: ObjectVersion.VER_UE4_AUTOMATIC_VERSION_PLUS_ONE
961    VersionPlusOne,
962    /// Introduced: ObjectVersion.VER_UE4_AUTOMATIC_VERSION
963    LatestVersion = (FAnimPhysObjectVersion::VersionPlusOne as i32) + 1,
964}
965
966impl_custom_version_trait!(
967    FAnimPhysObjectVersion,
968    "FAnimPhysObjectVersion",
969    new_guid(0x29E575DD, 0xE0A34627, 0x9D10D276, 0x232CDCEA),
970    VER_UE4_AUTOMATIC_VERSION: LatestVersion,
971    VER_UE4_AUTOMATIC_VERSION_PLUS_ONE: VersionPlusOne,
972    VER_UE4_20: GeometryCacheAssetDeprecation,
973    VER_UE4_19: SaveEditorOnlyFullPoseForPoseAsset,
974    VER_UE4_18: AddLODToCurveMetaData,
975    VER_UE4_17: TuneSoftLimitStiffnessAndDamping,
976    VER_UE4_16: ThumbnailSceneInfoAndAssetImportDataAreTransactional,
977    VER_UE4_OLDEST_LOADABLE_PACKAGE: BeforeCustomVersionWasAdded
978);
979
980/// Custom serialization version for changes made in Release streams.
981#[derive(IntoPrimitive)]
982#[repr(i32)]
983pub enum FReleaseObjectVersion {
984    /// Before any version changes were made
985    /// Introduced: ObjectVersion.VER_UE4_OLDEST_LOADABLE_PACKAGE
986    BeforeCustomVersionWasAdded = 0,
987
988    /// Static Mesh extended bounds radius fix
989    /// Introduced: ObjectVersion.VER_UE4_NAME_HASHES_SERIALIZED
990    StaticMeshExtendedBoundsFix,
991
992    /// Physics asset bodies are either in the sync scene or the async scene, but not both
993    /// Introduced: ObjectVersion.VER_UE4_INSTANCED_STEREO_UNIFORM_REFACTOR
994    NoSyncAsyncPhysAsset,
995
996    /// ULevel was using TTransArray incorrectly (serializing the entire array in addition to individual mutations). converted to a TArray
997    /// Introduced: ObjectVersion.VER_UE4_INSTANCED_STEREO_UNIFORM_REFACTOR
998    LevelTransArrayConvertedToTArray,
999
1000    /// Add Component node templates now use their own unique naming scheme to ensure more reliable archetype lookups.
1001    /// Introduced: ObjectVersion.VER_UE4_TemplateIndex_IN_COOKED_EXPORTS
1002    AddComponentNodeTemplateUniqueNames,
1003
1004    /// Fix a serialization issue with static mesh FMeshSectionInfoMap FProperty
1005    /// Introduced: ObjectVersion.VER_UE4_ADDED_SEARCHABLE_NAMES
1006    UPropertryForMeshSectionSerialize,
1007
1008    /// Existing HLOD settings screen size to screen area conversion
1009    /// Introduced: ObjectVersion.VER_UE4_ADDED_SEARCHABLE_NAMES
1010    ConvertHLODScreenSize,
1011
1012    /// Adding mesh section info data for existing billboard LOD models
1013    /// Introduced: ObjectVersion.VER_UE4_ADDED_SEARCHABLE_NAMES
1014    SpeedTreeBillboardSectionInfoFixup,
1015
1016    /// Change FMovieSceneEventParameters::StructType to be a string asset reference from a TWeakObjectPtr UScriptStruct
1017    /// Introduced: ObjectVersion.VER_UE4_ADDED_SWEEP_WHILE_WALKING_FLAG
1018    EventSectionParameterStringAssetRef,
1019
1020    /// Remove serialized irradiance map data from skylight.
1021    /// Introduced: ObjectVersion.VER_UE4_ADDED_SWEEP_WHILE_WALKING_FLAG
1022    SkyLightRemoveMobileIrradianceMap,
1023
1024    /// rename bNoTwist to bAllowTwist
1025    /// Introduced: ObjectVersion.VER_UE4_ADDED_SWEEP_WHILE_WALKING_FLAG
1026    RenameNoTwistToAllowTwistInTwoBoneIK,
1027
1028    /// Material layers serialization refactor
1029    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_SUMMARY_LOCALIZATION_ID
1030    MaterialLayersParameterSerializationRefactor,
1031
1032    /// Added disable flag to skeletal mesh data
1033    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_SUMMARY_LOCALIZATION_ID
1034    AddSkeletalMeshSectionDisable,
1035
1036    /// Removed objects that were serialized as part of this material feature
1037    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_SUMMARY_LOCALIZATION_ID
1038    RemovedMaterialSharedInputCollection,
1039
1040    /// HISMC Cluster Tree migration to add new data
1041    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_SUMMARY_LOCALIZATION_ID
1042    HISMCClusterTreeMigration,
1043
1044    /// Default values on pins in blueprints could be saved incoherently
1045    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_SUMMARY_LOCALIZATION_ID
1046    PinDefaultValuesVerified,
1047
1048    /// During copy and paste transition getters could end up with broken state machine references
1049    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_SUMMARY_LOCALIZATION_ID
1050    FixBrokenStateMachineReferencesInTransitionGetters,
1051
1052    /// Change to MeshDescription serialization
1053    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_SUMMARY_LOCALIZATION_ID
1054    MeshDescriptionNewSerialization,
1055
1056    /// Change to not clamp RGB values > 1 on linear color curves
1057    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_SUMMARY_LOCALIZATION_ID
1058    UnclampRGBColorCurves,
1059
1060    /// Bugfix for FAnimObjectVersion::LinkTimeAnimBlueprintRootDiscovery.
1061    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_SUMMARY_LOCALIZATION_ID
1062    LinkTimeAnimBlueprintRootDiscoveryBugFix,
1063
1064    /// Change trail anim node variable deprecation
1065    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_SUMMARY_LOCALIZATION_ID
1066    TrailNodeBlendVariableNameChange,
1067
1068    /// Make sure the Blueprint Replicated Property Conditions are actually serialized properly.
1069    /// Introduced: ObjectVersion.VER_UE4_FIX_WIDE_STRING_CRC
1070    PropertiesSerializeRepCondition,
1071
1072    /// DepthOfFieldFocalDistance at 0 now disables DOF instead of DepthOfFieldFstop at 0.
1073    /// Introduced: ObjectVersion.VER_UE4_FIX_WIDE_STRING_CRC
1074    FocalDistanceDisablesDOF,
1075
1076    /// Removed versioning, but version entry must still exist to keep assets saved with this version loadable
1077    /// Introduced: ObjectVersion.VER_UE4_FIX_WIDE_STRING_CRC
1078    UnusedSoundClass2dreverbSend,
1079
1080    /// Groom asset version
1081    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_OWNER
1082    GroomAssetVersion1,
1083
1084    /// Groom asset version
1085    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_OWNER
1086    GroomAssetVersion2,
1087
1088    /// Store applied version of Animation Modifier to use when reverting
1089    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_OWNER
1090    SerializeAnimModifierState,
1091
1092    /// Groom asset version
1093    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_OWNER
1094    GroomAssetVersion3,
1095
1096    /// Upgrade filmback
1097    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_OWNER
1098    DeprecateFilmbackSettings,
1099
1100    /// custom collision type
1101    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_OWNER
1102    CustomImplicitCollisionType,
1103
1104    /// FFieldPath will serialize the owner struct reference and only a short path to its property
1105    /// Introduced: ObjectVersion.VER_UE4_ADDED_PACKAGE_OWNER
1106    FFieldPathOwnerSerialization,
1107
1108    /// Dummy version to allow us to fix up the fact that ReleaseObjectVersion was changed elsewhere
1109    /// Introduced: ObjectVersion.VER_UE4_SKINWEIGHT_PROFILE_DATA_LAYOUT_CHANGES
1110    ReleaseObjectVersionFixup,
1111
1112    /// Pin types include a flag that propagates the 'CPF_UObjectWrapper' flag to generated properties
1113    /// Introduced: ObjectVersion.VER_UE4_ASSETREGISTRY_DEPENDENCYFLAGS
1114    PinTypeIncludesUObjectWrapperFlag,
1115
1116    /// Added Weight member to FMeshToMeshVertData
1117    /// Introduced: ObjectVersion.VER_UE4_ASSETREGISTRY_DEPENDENCYFLAGS
1118    WeightFMeshToMeshVertData,
1119
1120    /// Animation graph node bindings displayed as pins
1121    /// Introduced: ObjectVersion.VER_UE4_ASSETREGISTRY_DEPENDENCYFLAGS
1122    AnimationGraphNodeBindingsDisplayedAsPins,
1123
1124    /// Serialized rigvm offset segment paths
1125    /// Introduced: ObjectVersion.VER_UE4_ASSETREGISTRY_DEPENDENCYFLAGS
1126    SerializeRigVMOffsetSegmentPaths,
1127
1128    /// Upgrade AbcGeomCacheImportSettings for velocities
1129    /// Introduced: ObjectVersion.VER_UE4_ASSETREGISTRY_DEPENDENCYFLAGS
1130    AbcVelocitiesSupport,
1131
1132    /// Add margin support to Chaos Convex
1133    /// Introduced: ObjectVersion.VER_UE4_ASSETREGISTRY_DEPENDENCYFLAGS
1134    MarginAddedToConvexAndBox,
1135
1136    /// Add structure data to Chaos Convex
1137    /// Introduced: ObjectVersion.VER_UE4_ASSETREGISTRY_DEPENDENCYFLAGS
1138    StructureDataAddedToConvex,
1139
1140    /// Changed axis UI for LiveLink AxisSwitch Pre Processor
1141    /// Introduced: ObjectVersion.VER_UE4_CORRECT_LICENSEE_FLAG
1142    AddedFrontRightUpAxesToLiveLinkPreProcessor,
1143
1144    /// Some sequencer event sections that were copy-pasted left broken links to the director BP
1145    /// Introduced: ObjectVersion.VER_UE4_CORRECT_LICENSEE_FLAG
1146    FixupCopiedEventSections,
1147
1148    /// Serialize the number of bytes written when serializing function arguments
1149    /// Introduced: ObjectVersion.VER_UE4_CORRECT_LICENSEE_FLAG
1150    RemoteControlSerializeFunctionArgumentsSize,
1151
1152    /// Add loop counters to sequencer's compiled sub-sequence data
1153    /// Introduced: ObjectVersion.VER_UE4_CORRECT_LICENSEE_FLAG
1154    AddedSubSequenceEntryWarpCounter,
1155
1156    /// Remove default resolution limit of 512 pixels for cubemaps generated from long-lat sources
1157    /// Introduced: ObjectVersion.VER_UE4_CORRECT_LICENSEE_FLAG
1158    LonglatTextureCubeDefaultMaxResolution,
1159
1160    /// bake center of mass into chaos cache
1161    /// Introduced: ObjectVersion.VER_UE4_CORRECT_LICENSEE_FLAG
1162    GeometryCollectionCacheRemovesMassToLocal,
1163
1164    /// Introduced: ObjectVersion.VER_UE4_AUTOMATIC_VERSION_PLUS_ONE
1165    VersionPlusOne,
1166    /// Introduced: ObjectVersion.VER_UE4_AUTOMATIC_VERSION
1167    LatestVersion = (FReleaseObjectVersion::VersionPlusOne as i32) + 1,
1168}
1169
1170impl_custom_version_trait!(
1171    FReleaseObjectVersion,
1172    "FReleaseObjectVersion",
1173    new_guid(0x9C54D522, 0xA8264FBE, 0x94210746, 0x61B482D0),
1174    VER_UE4_AUTOMATIC_VERSION: LatestVersion,
1175    VER_UE4_AUTOMATIC_VERSION_PLUS_ONE: VersionPlusOne,
1176    VER_UE4_27: LonglatTextureCubeDefaultMaxResolution,
1177    VER_UE4_26: StructureDataAddedToConvex,
1178    VER_UE4_25: FFieldPathOwnerSerialization,
1179    VER_UE4_24: DeprecateFilmbackSettings,
1180    VER_UE4_23: UnusedSoundClass2dreverbSend,
1181    VER_UE4_21: TrailNodeBlendVariableNameChange,
1182    VER_UE4_20: MeshDescriptionNewSerialization,
1183    VER_UE4_19: RemovedMaterialSharedInputCollection,
1184    VER_UE4_17: RenameNoTwistToAllowTwistInTwoBoneIK,
1185    VER_UE4_16: SkyLightRemoveMobileIrradianceMap,
1186    VER_UE4_15: SpeedTreeBillboardSectionInfoFixup,
1187    VER_UE4_14: AddComponentNodeTemplateUniqueNames,
1188    VER_UE4_13: LevelTransArrayConvertedToTArray,
1189    VER_UE4_11: StaticMeshExtendedBoundsFix,
1190    VER_UE4_OLDEST_LOADABLE_PACKAGE: BeforeCustomVersionWasAdded
1191);
1192
1193/// Custom serialization version for changes made in Dev-Sequencer stream
1194#[derive(IntoPrimitive)]
1195#[repr(i32)]
1196pub enum FSequencerObjectVersion {
1197    /// Before any version changes were made
1198    /// Introduced: EngineVersion.VER_UE4_OLDEST_LOADABLE_PACKAGE
1199    BeforeCustomVersionWasAdded = 0,
1200
1201    /// Per-platform overrides player overrides for media sources changed name and type
1202    /// Introduced: EngineVersion.VER_UE4_14
1203    RenameMediaSourcePlatformPlayers,
1204
1205    /// Enable root motion isn't the right flag to use, but force root lock
1206    /// Introduced: EngineVersion.VER_UE4_15
1207    ConvertEnableRootMotionToForceRootLock,
1208
1209    /// Convert multiple rows to tracks
1210    /// Introduced: EngineVersion.VER_UE4_15
1211    ConvertMultipleRowsToTracks,
1212
1213    /// When finished now defaults to restore state
1214    /// Introduced: EngineVersion.VER_UE4_16
1215    WhenFinishedDefaultsToRestoreState,
1216
1217    /// EvaluationTree added
1218    /// Introduced: EngineVersion.VER_UE4_19
1219    EvaluationTree,
1220
1221    /// When finished now defaults to project default
1222    /// Introduced: EngineVersion.VER_UE4_19
1223    WhenFinishedDefaultsToProjectDefault,
1224
1225    /// Use int range rather than float range in FMovieSceneSegment
1226    /// Introduced: EngineVersion.VER_UE4_20
1227    FloatToIntConversion,
1228
1229    /// Purged old spawnable blueprint classes from level sequence assets
1230    /// Introduced: EngineVersion.VER_UE4_20
1231    PurgeSpawnableBlueprints,
1232
1233    /// Finish UMG evaluation on end
1234    /// Introduced: EngineVersion.VER_UE4_20
1235    FinishUMGEvaluation,
1236
1237    /// Manual serialization of float channel
1238    /// Introduced: EngineVersion.VER_UE4_22
1239    SerializeFloatChannel,
1240
1241    /// Change the linear keys so they act the old way and interpolate always
1242    /// Introduced: EngineVersion.VER_UE4_22
1243    ModifyLinearKeysForOldInterp,
1244
1245    /// Full Manual serialization of float channel
1246    /// Introduced: EngineVersion.VER_UE4_25
1247    SerializeFloatChannelCompletely,
1248
1249    /// Set ContinuouslyRespawn to false by default, added FMovieSceneSpawnable::bNetAddressableName
1250    /// Introduced: EngineVersion.VER_UE4_27
1251    SpawnableImprovements,
1252
1253    /// Introduced: EngineVersion.VER_UE4_AUTOMATIC_VERSION
1254    LatestVersion,
1255    /// Introduced: EngineVersion.VER_UE4_AUTOMATIC_VERSION_PLUS_ONE
1256    VersionPlusOne,
1257}
1258
1259impl_custom_version_trait!(
1260    FSequencerObjectVersion,
1261    "FSequencerObjectVersion",
1262    new_guid(0x7B5AE74C, 0xD2704C10, 0xA9585798, 0x0B212A5A),
1263    VER_UE4_AUTOMATIC_VERSION: LatestVersion,
1264    VER_UE4_AUTOMATIC_VERSION_PLUS_ONE: VersionPlusOne,
1265    VER_UE4_27: SpawnableImprovements,
1266    VER_UE4_25: SerializeFloatChannelCompletely,
1267    VER_UE4_22: ModifyLinearKeysForOldInterp,
1268    VER_UE4_20: FinishUMGEvaluation,
1269    VER_UE4_19: WhenFinishedDefaultsToProjectDefault,
1270    VER_UE4_16: WhenFinishedDefaultsToRestoreState,
1271    VER_UE4_15: ConvertMultipleRowsToTracks,
1272    VER_UE4_14: RenameMediaSourcePlatformPlayers,
1273    VER_UE4_OLDEST_LOADABLE_PACKAGE: BeforeCustomVersionWasAdded
1274);
1275
1276/// Asset registry version
1277#[derive(IntoPrimitive, TryFromPrimitive, PartialEq, Eq, PartialOrd, Ord, Copy, Clone, Debug)]
1278#[repr(i32)]
1279pub enum FAssetRegistryVersionType {
1280    /// From before file versioning was implemented
1281    PreVersioning = 0,
1282    /// The first version of the runtime asset registry to include file versioning.
1283    HardSoftDependencies,
1284    /// Added FAssetRegistryState and support for piecemeal serialization
1285    AddAssetRegistryState,
1286    /// AssetData serialization format changed, versions before this are not readable
1287    ChangedAssetData,
1288    /// Removed MD5 hash from package data
1289    RemovedMD5Hash,
1290    /// Added hard/soft manage references
1291    AddedHardManage,
1292    /// Added MD5 hash of cooked package to package data
1293    AddedCookedMD5Hash,
1294    /// Added UE::AssetRegistry::EDependencyProperty to each dependency
1295    AddedDependencyFlags,
1296    /// Major tag format change that replaces USE_COMPACT_ASSET_REGISTRY:
1297    /// * Target tag INI settings cooked into tag data
1298    /// * Instead of FString values are stored directly as one of:
1299    ///     - Narrow / wide string
1300    ///     - \[Numberless\] FName
1301    ///     - \[Numberless\] export path
1302    ///     - Localized string
1303    /// * All value types are deduplicated
1304    /// * All key-value maps are cooked into a single contiguous range
1305    /// * Switched from FName table to seek-free and more optimized FName batch loading
1306    /// * Removed global tag storage, a tag map reference-counts one store per asset registry
1307    /// * All configs can mix fixed and loose tag maps
1308    FixedTags,
1309    /// Added Version information to AssetPackageData
1310    WorkspaceDomain,
1311    /// Added ImportedClasses to AssetPackageData
1312    PackageImportedClasses,
1313    /// A new version number of UE5 was added to FPackageFileSummary
1314    PackageFileSummaryVersionChange,
1315    /// Change to linker export/import resource serialization
1316    ObjectResourceOptionalVersionChange,
1317    /// Added FIoHash for each FIoChunkId in the package to the AssetPackageData.
1318    AddedChunkHashes,
1319    /// Classes are serialized as path names rather than short object names, e.g. /Script/Engine.StaticMesh
1320    ClassPaths,
1321
1322    // -----<new versions can be added above this line>-------------------------------------------------
1323    /// Latest version
1324    LatestVersion,
1325    /// Version plus one
1326    VersionPlusOne,
1327}
1328
1329lazy_static! {
1330    static ref ASSET_REGISTRY_VERSION_GUID: Guid =
1331        new_guid(0x717F9EE7, 0xE9B0493A, 0x88B39132, 0x1B388107);
1332}
1333
1334impl FAssetRegistryVersionType {
1335    /// Read an asset registry version from an asset
1336    pub fn new<Reader: ArchiveReader>(asset: &mut Reader) -> Result<Self, Error> {
1337        let mut guid = [0u8; 16];
1338        asset.read_exact(&mut guid)?;
1339
1340        if guid == *ASSET_REGISTRY_VERSION_GUID {
1341            return Ok(Self::try_from(asset.read_i32::<LE>()?)?);
1342        }
1343
1344        Ok(FAssetRegistryVersionType::LatestVersion)
1345    }
1346
1347    /// Write an asset registry version to an asset
1348    pub fn write<Writer: ArchiveWriter>(&self, writer: &mut Writer) -> Result<(), Error> {
1349        writer.write_all(&*ASSET_REGISTRY_VERSION_GUID)?;
1350        writer.write_i32::<LE>((*self).into())?;
1351        Ok(())
1352    }
1353}
1354
1355impl Display for FAssetRegistryVersionType {
1356    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1357        match *self {
1358            FAssetRegistryVersionType::PreVersioning => write!(f, "PreVersioning"),
1359            FAssetRegistryVersionType::HardSoftDependencies => write!(f, "HardSoftDependencies"),
1360            FAssetRegistryVersionType::AddAssetRegistryState => write!(f, "AddAssetRegistryState"),
1361            FAssetRegistryVersionType::ChangedAssetData => write!(f, "ChangedAssetData"),
1362            FAssetRegistryVersionType::RemovedMD5Hash => write!(f, "RemovedMD5Hash"),
1363            FAssetRegistryVersionType::AddedHardManage => write!(f, "AddedHardManage"),
1364            FAssetRegistryVersionType::AddedCookedMD5Hash => write!(f, "AddedCookedMD5Hash"),
1365            FAssetRegistryVersionType::AddedDependencyFlags => write!(f, "AddedDependencyFlags"),
1366            FAssetRegistryVersionType::FixedTags => write!(f, "FixedTags"),
1367            FAssetRegistryVersionType::WorkspaceDomain => write!(f, "WorkspaceDomain"),
1368            FAssetRegistryVersionType::PackageImportedClasses => {
1369                write!(f, "PackageImportedClasses")
1370            }
1371            FAssetRegistryVersionType::PackageFileSummaryVersionChange => {
1372                write!(f, "PackageFileSummaryVersionChange")
1373            }
1374            FAssetRegistryVersionType::ObjectResourceOptionalVersionChange => {
1375                write!(f, "ObjectResourceOptionalVersionChange")
1376            }
1377            FAssetRegistryVersionType::AddedChunkHashes => write!(f, "AddedChunkHashes"),
1378            FAssetRegistryVersionType::ClassPaths => write!(f, "ClassPaths"),
1379            FAssetRegistryVersionType::LatestVersion => write!(f, "LatestVersion"),
1380            FAssetRegistryVersionType::VersionPlusOne => write!(f, "VersionPlusOne"),
1381        }
1382    }
1383}