Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ void UMaterialInstanceGenerator::PreFinishAssetGeneration() {
const TSharedPtr<FJsonValue> AssetUserDataJson = AssetObjectProperties->GetField<EJson::Array>(TEXT("AssetUserData"));

GetPropertySerializer()->DeserializePropertyValue(AssetUserDataProperty, AssetUserDataJson.ToSharedRef(), AssetUserData);

// AssetUserData is deserialized in PRE_FINSHED, after the
// DATA_POPULATION save. Without marking the asset changed the package is not re-saved and the
// AssetUserData written here is lost (IsSimpleAssetUpToDate then fails on every re-run).
MarkAssetChanged();
}

void EnsureStaticSwitchNodesPresent(UMaterial* Material, const FStaticParameterSet& StaticParameters) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ void USimpleAssetGenerator::PopulateAssetWithData() {
UE_LOG(LogAssetGenerator, Display, TEXT("%s %s is not up to date, regenerating data"), *ExistingAssetObject->GetClass()->GetName(), *ExistingAssetObject->GetPathName());

PopulateSimpleAssetWithData(ExistingAssetObject);

// Commit d665fd6 ("Update to UE 5.6.1")
// moved data population out of CreateAssetPackage() (CONSTRUCTION, which always marks
// the asset changed) into this DATA_POPULATION stage, but never marks the asset as
// changed here. UAssetTypeGenerator::AdvanceGenerationState only saves when
// bAssetChanged is set, and the property serializer does not dirty the package, so
// every simple asset (MaterialInstance, PhysicalMaterial, MPC, DataAsset, curves...)
// was written to disk as the empty CONSTRUCTION shell and the populated data was lost.
// Marking the asset changed makes AdvanceGenerationState save the populated package.
MarkAssetChanged();
}
}

Expand Down