AssetGenerator: save simple assets (MaterialInstance, MPC, PhysMat, DataAsset...) after data population - 5.6.1 regression - #18
Open
UresiiZo wants to merge 1 commit into
Conversation
…ssion) Since d665fd6 ("Update to UE 5.6.1") USimpleAssetGenerator populates its asset in the DATA_POPULATION stage (PopulateAssetWithData) instead of in CreateAssetPackage (CONSTRUCTION). CONSTRUCTION always calls MarkAssetChanged(), DATA_POPULATION never did, and the property serializers do not dirty the package, so AdvanceGenerationState() never saved the populated object. Every MaterialInstanceConstant, MPC, PhysicalMaterial, DataAsset, curve, ... ended up on disk as the empty CONSTRUCTION shell (MI: Parent=None, no parameters). Measured on a full Satisfactory dump: 2,034 of 2,042 MaterialInstanceConstant packages were empty shells; after this change 0 (Parent==None: 0/2042). Also mark the asset changed in UMaterialInstanceGenerator:: PreFinishAssetGeneration, which writes AssetUserData after the DATA_POPULATION save.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Symptom
Since the UE 5.6.1 update (
d665fd6) every asset handled byUSimpleAssetGeneratorand its subclasses(
UMaterialInstanceGenerator,UMaterialParameterCollectionGenerator,UPhysicalMaterialGenerator,UDataAssetGenerator,UCurveBaseGenerator, ...) is written to disk without its data:MI_Foundation_Concrete.uasset= 1,847 bytes,Parent = None,TextureParameterValues = []MPC_Panini.uasset= 1,041 bytes (no parameters),PM_FreeLinearAngular.uasset= 1,119 bytesMaterialInstanceConstantpackageswere empty shells (file <= 2,000 bytes; the 8 others got dirtied by another generator), 10 of 12
MaterialParameterCollection, all 25PhysicalMaterial, all 674FGMessage, 255FGUserSetting,221
AnimMontage, 98CurveFloat, ...Meshes / textures / materials / blueprints are fine, so every vanilla mesh shows up grey in the editor.
No error is logged; every re-run prints
MaterialInstanceConstant ... is not up to date, regenerating datafor the same assets, but the file on disk never changes (its mtime stays at the CONSTRUCTION-stage save).
Cause
d665fd6moved the population of simple assets out ofUSimpleAssetGenerator::CreateAssetPackage()(CONSTRUCTION stage, which always calls
MarkAssetChanged()inUAssetTypeGenerator::ConstructAssetAndPackage)into the new
USimpleAssetGenerator::PopulateAssetWithData()(DATA_POPULATION stage). That method never callsMarkAssetChanged(), and neitherUObjectHierarchySerializernorUPropertySerializerdirty the package.UAssetTypeGenerator::AdvanceGenerationState()only saves whenbAssetChangedis set, so:UMaterialInstanceGenerator::PreFinishAssetGeneration()has the same problem: it deserializesAssetUserDatain PRE_FINSHED, after the DATA_POPULATION save.
Fix
SimpleAssetGenerator.cpp: callMarkAssetChanged()right afterPopulateSimpleAssetWithData()inPopulateAssetWithData().MaterialInstanceGenerator.cpp: callMarkAssetChanged()at the end ofPreFinishAssetGeneration().Verification (real dump, UE 5.6.1-CSS, Windows,
-run=AssetGeneratorcommandlet)Targeted re-run of 3 floor MIs first (
-ForceGeneratePackageNames, everything else blacklisted; 1.6 s):MI_Foundation_Concrete.uasset1,847 -> 7,702 B; editor Python read-back:Parent = MMI_FoundationSet_Concrete,Albedo = TX_Concrete_BC,Normal = TX_Concrete_N,Masks = TX_Concrete_Relf,MaskAO = TX_Concrete_AOMasks;MMI_FoundationSet_Concrete.Parent = MM_BakedStencil_01.Then a full re-run over the whole dump with the fix (commandlet time 4 min 48 s, 18,347 packages generated,
no crash). Empty-shell counts (file <= 2,000 B) before -> after:
(*) these are just small assets: all of them were rewritten by the fixed run with a larger size, and the
editor reads their data back (e.g.
PhysMat_Cement.SurfaceType = SurfaceType11,DebugColorset; MPC withzero parameters: 0 / 12).
Cross-check from the log: 3,671 packages logged
is not up to date, regenerating data; 3,661 of them nowhave a rewritten file on disk. The 10 that do not are all
CurveLinearColorAtlas, which uses its owngenerator (
UCurveLinearColorAtlasGenerator, populated in CONSTRUCTION, so it was never a shell) and has thesame missing
MarkAssetChanged()inOnExistingPackageLoaded()- left out of this PR to keep it minimal.Editor Python read-back over all 2,042
MaterialInstanceConstantassets:Parent == None= 0. One MI(
MI_Liana_Ivy_01) has the engine default parent - that is the existing "Failed to deserialize Parent Material... Falling back to default material" path, unrelated to this bug. A random sample of 8 MIs shows parent,
texture, scalar and vector parameters matching the dump.
Steps to reproduce (before the fix)
-run=AssetGenerator -DumpDirectory=...on a UE 5.6.1 project.unreal.load_asset('/Game/FactoryGame/Buildable/Building/Foundation/ConcreteSet/MI_Foundation_Concrete').get_editor_property('parent')->
None; file size ~1.8 KB.Possibly related
Reports on the modding Discord (2026-05) of "followed the docs, everything in the editor is still white cubes /
grey" after generating with the 5.6 toolkit may have the same root cause (material instances empty ->
default material), though I have not verified those cases.