95
95
VER_UE4_SKINWEIGHT_PROFILE_DATA_LAYOUT_CHANGES = 519 ,
96
96
VER_UE4_NON_OUTER_PACKAGE_IMPORT = 520 ,
97
97
VER_UE4_26 = 522 ,
98
- VER_UE4_27 = 523 , //?? TODO
98
+ VER_UE4_27 = 522 ,
99
99
// look for NEW_ENGINE_VERSION over the code to find places where version constants should be inserted.
100
100
// LATEST_SUPPORTED_UE4_VERSION should be updated too.
101
101
};
102
102
103
103
int GetUE4CustomVersion (const FArchive & Ar , const FGuid & Guid );
104
104
105
+
106
+ /*
107
+ * Rules for writing code for custom versions
108
+ * - Each version is a "struct". Ideally could use "enum class", however we're adding some code into it, so "struct" is ideal.
109
+ * - Use "enum Type" inside of it.
110
+ * - Each enum has members:
111
+ * - VersionPlusOne - equals to the recent declared constant + 1, used to correctly set up LatestVersion without explicit
112
+ * mentioning of the latest constant name.
113
+ * - optional: ForceVersion - use it in a case we're not declaring the latest version as a constant, so LatestVersion value
114
+ * will work correctly.
115
+ * - There's "static Type Get(const FArchive& Ar)" function, it computes custom version based on Game constant. Needed in order
116
+ * to make unversioned packages to work.
117
+ * - This function does comparison of game constant with engine number PLUS ONE, so games which are derived from e.g. UE4.25
118
+ * will work correctly after using logic "Game < GAME_UE4(26)", i.e. game is using engine smaller than UE4.26. If we'll use
119
+ * "Game <= GAME_UE4.25", this WILL work for UE4.25, but not for 4.25-based games which has custom override.
120
+ */
121
+
105
122
struct FFrameworkObjectVersion
106
123
{
107
124
enum Type
@@ -124,7 +141,9 @@ struct FFrameworkObjectVersion
124
141
// UE4.20, UE4.21 = 34
125
142
// UE4.22, UE4.23 = 35
126
143
// UE4.24 = 36
127
- // UE4.25, UE4.26 = 37
144
+ // UE4.25-UE4.27 = 37
145
+
146
+ ForceVersion = 37 , // the recent version, added here just to force LatestVersion to be correct
128
147
129
148
VersionPlusOne ,
130
149
LatestVersion = VersionPlusOne - 1
@@ -165,10 +184,10 @@ struct FFrameworkObjectVersion
165
184
return (Type )35 ;
166
185
if (Ar .Game < GAME_UE4 (25 ))
167
186
return (Type )36 ;
168
- // if (Ar.Game < GAME_UE4(27 ))
187
+ if (Ar .Game < GAME_UE4 (28 ))
169
188
return (Type )37 ;
170
189
// NEW_ENGINE_VERSION
171
- // return LatestVersion;
190
+ return LatestVersion ;
172
191
}
173
192
};
174
193
@@ -195,7 +214,9 @@ struct FEditorObjectVersion
195
214
// UE4.23 = 34
196
215
// UE4.24 = 37
197
216
// UE4.25 = 38
198
- // UE4.26 = 40
217
+ // UE4.26, UE4.27 = 40
218
+
219
+ ForceVersion = 40 ,
199
220
200
221
VersionPlusOne ,
201
222
LatestVersion = VersionPlusOne - 1
@@ -243,10 +264,10 @@ struct FEditorObjectVersion
243
264
return (Type )37 ;
244
265
if (Ar .Game < GAME_UE4 (26 ))
245
266
return (Type )38 ;
246
- // if (Ar.Game < GAME_UE4(27 ))
267
+ if (Ar .Game < GAME_UE4 (28 ))
247
268
return (Type )40 ;
248
269
// NEW_ENGINE_VERSION
249
- // return LatestVersion;
270
+ return LatestVersion ;
250
271
}
251
272
};
252
273
@@ -278,7 +299,7 @@ struct FSkeletalMeshCustomVersion
278
299
SectionIgnoreByReduceAdded = 16 ,
279
300
// UE4.23-UE4.25 = 17
280
301
SkinWeightProfiles = 17 , //todo: FSkeletalMeshLODModel::Serialize (editor mesh)
281
- // UE4.26 = 18
302
+ // UE4.26, UE4.27 = 18
282
303
RemoveEnableClothLOD = 18 , //todo
283
304
284
305
VersionPlusOne ,
@@ -316,10 +337,10 @@ struct FSkeletalMeshCustomVersion
316
337
return SectionIgnoreByReduceAdded ;
317
338
if (Ar .Game < GAME_UE4 (26 ))
318
339
return SkinWeightProfiles ;
319
- // if (Ar.Game < GAME_UE4(27 ))
340
+ if (Ar .Game < GAME_UE4 (28 ))
320
341
return RemoveEnableClothLOD ;
321
342
// NEW_ENGINE_VERSION
322
- // return LatestVersion;
343
+ return LatestVersion ;
323
344
}
324
345
};
325
346
@@ -333,7 +354,7 @@ struct FCoreObjectVersion
333
354
// UE4.15-UE4.21 = 2
334
355
// UE4.22-UE4.24 = 3
335
356
SkeletalMaterialEditorDataStripping = 3 ,
336
- // UE4.25-UE4.26 = 4
357
+ // UE4.25-UE4.27 = 4
337
358
338
359
VersionPlusOne ,
339
360
LatestVersion = VersionPlusOne - 1
@@ -353,10 +374,10 @@ struct FCoreObjectVersion
353
374
return (Type )2 ;
354
375
if (Ar .Game < GAME_UE4 (25 ))
355
376
return SkeletalMaterialEditorDataStripping ;
356
- // if (Ar.Game < GAME_UE4(27 ))
377
+ if (Ar .Game < GAME_UE4 (28 ))
357
378
return (Type )4 ;
358
379
// NEW_ENGINE_VERSION
359
- // return LatestVersion;
380
+ return LatestVersion ;
360
381
}
361
382
};
362
383
@@ -378,9 +399,12 @@ struct FRenderingObjectVersion
378
399
// UE4.22 = 28
379
400
// UE4.23 = 31
380
401
// UE4.24 = 36
402
+ StaticMeshSectionForceOpaqueField = 37 ,
381
403
// UE4.25 = 43
382
404
// UE4.26 = 44
383
- StaticMeshSectionForceOpaqueField = 37 ,
405
+ // UE4.27 = 45
406
+
407
+ ForceVersion = 45 ,
384
408
385
409
VersionPlusOne ,
386
410
LatestVersion = VersionPlusOne - 1
@@ -425,10 +449,12 @@ struct FRenderingObjectVersion
425
449
return (Type )36 ;
426
450
if (Ar .Game < GAME_UE4 (26 ))
427
451
return (Type )43 ;
428
- // if (Ar.Game < GAME_UE4(27))
452
+ if (Ar .Game < GAME_UE4 (27 ))
429
453
return (Type )44 ;
454
+ if (Ar .Game < GAME_UE4 (28 ))
455
+ return (Type )45 ;
430
456
// NEW_ENGINE_VERSION
431
- // return LatestVersion;
457
+ return LatestVersion ;
432
458
}
433
459
};
434
460
@@ -442,7 +468,9 @@ struct FAnimObjectVersion
442
468
// UE4.25 = 7
443
469
IncreaseBoneIndexLimitPerChunk = 4 ,
444
470
UnlimitedBoneInfluences = 5 ,
445
- // UE4.26 = 15
471
+ // UE4.26, UE4.27 = 15
472
+
473
+ ForceVersion = 15 ,
446
474
447
475
VersionPlusOne ,
448
476
LatestVersion = VersionPlusOne - 1
@@ -460,11 +488,10 @@ struct FAnimObjectVersion
460
488
return StoreMarkerNamesOnSkeleton ;
461
489
if (Ar .Game < GAME_UE4 (26 ))
462
490
return (Type )7 ;
463
- // if (Ar.Game < GAME_UE4(27 ))
491
+ if (Ar .Game < GAME_UE4 (28 ))
464
492
return (Type )15 ;
465
-
466
493
// NEW_ENGINE_VERSION
467
- // return LatestVersion;
494
+ return LatestVersion ;
468
495
}
469
496
};
470
497
@@ -481,7 +508,9 @@ struct FAnimPhysObjectVersion
481
508
AddLODToCurveMetaData = 12 ,
482
509
// UE4.19 = 16
483
510
ChangeRetargetSourceReferenceToSoftObjectPtr = 15 ,
484
- // UE4.20-UE4.26 = 17
511
+ // UE4.20-UE4.27 = 17
512
+
513
+ ForceVersion = 17 ,
485
514
486
515
VersionPlusOne ,
487
516
LatestVersion = VersionPlusOne - 1
@@ -503,10 +532,10 @@ struct FAnimPhysObjectVersion
503
532
return AddLODToCurveMetaData ;
504
533
if (Ar .Game < GAME_UE4 (20 ))
505
534
return (Type )16 ;
506
- // if (Ar.Game < GAME_UE4(27 ))
535
+ if (Ar .Game < GAME_UE4 (28 ))
507
536
return (Type )17 ;
508
537
// NEW_ENGINE_VERSION
509
- // return LatestVersion;
538
+ return LatestVersion ;
510
539
}
511
540
};
512
541
@@ -517,6 +546,9 @@ struct FReleaseObjectVersion
517
546
BeforeCustomVersionWasAdded = 0 ,
518
547
// UE4.19 = 12
519
548
AddSkeletalMeshSectionDisable = 12 ,
549
+ // Not used in our code, so for version mapping please refer to "Get()" method below...
550
+
551
+ ForceVersion = 43 ,
520
552
521
553
VersionPlusOne ,
522
554
LatestVersion = VersionPlusOne - 1
@@ -554,10 +586,12 @@ struct FReleaseObjectVersion
554
586
return (Type )28 ;
555
587
if (Ar .Game < GAME_UE4 (26 ))
556
588
return (Type )30 ;
557
- // if (Ar.Game < GAME_UE4(27))
589
+ if (Ar .Game < GAME_UE4 (27 ))
558
590
return (Type )37 ;
591
+ if (Ar .Game < GAME_UE4 (28 ))
592
+ return (Type )43 ;
559
593
// NEW_ENGINE_VERSION
560
- // return LatestVersion;
594
+ return LatestVersion ;
561
595
}
562
596
};
563
597
@@ -569,6 +603,8 @@ struct FEnterpriseObjectVersion
569
603
// UE4.24 = 8
570
604
MeshDescriptionBulkDataGuidIsHash = 8 ,
571
605
606
+ ForceVersion = 10 ,
607
+
572
608
VersionPlusOne ,
573
609
LatestVersion = VersionPlusOne - 1
574
610
};
@@ -589,10 +625,10 @@ struct FEnterpriseObjectVersion
589
625
return (Type )6 ;
590
626
if (Ar .Game < GAME_UE4 (25 ))
591
627
return MeshDescriptionBulkDataGuidIsHash ;
592
- // if (Ar.Game < GAME_UE4(27 ))
628
+ if (Ar .Game < GAME_UE4 (28 ))
593
629
return (Type )10 ;
594
630
// NEW_ENGINE_VERSION
595
- // return LatestVersion;
631
+ return LatestVersion ;
596
632
}
597
633
};
598
634
0 commit comments