Description

In UE 5.4, when deleting actors in our levels, some blueprints will be mark dirty despite not having changed. We traced that down to FAssetRenameManager::CheckPackageForSoftObjectReferences.

The affected blueprints have the following properties

  • They have soft references to actors in the level
  • They have a latent node with an enum parameter in the delegate type

The following happens when an actor is deleted in the level,

  • FAssetRenameManager checks if the blueprint has any soft reference to the deleted actor.
  • In order to do so, it serializes the Blueprint with a custom serializer. The serialization observes a mismatch of the pin's default value with the following callstack
UK2Node_EditablePinBase::UpdateUserDefinedPinDefaultValues() Line 446
UK2Node_FunctionEntry::FixupPinStringDataReferences(FArchive * SavingArchive) Line 1078
UK2Node::Serialize(FArchive & Ar) Line 133
UK2Node_EditablePinBase::Serialize(FArchive & Ar) Line 256
UK2Node_FunctionTerminator::Serialize(FArchive &) Line 39
UK2Node_FunctionEntry::Serialize(FArchive & Ar) Line 273
FAssetRenameManager::CheckPackageForSoftObjectReferences(...) Line 1568
FAssetRenameManager::GatherReferencingObjects(...) Line 1046
FAssetRenameManager::FindSoftReferencesToObjects(...) Line 320
UUnrealEdEngine::DeleteActors(...) Line 940
UActorElementEditorWorldInterface::DeleteElements(...) Line 77
FTypedElementCommonActionsCustomization::DeleteElements(...) Line 30
FActorElementLevelEditorCommonActionsCustomization::DeleteElements(...) Line 24
UTypedElementCommonActions::DeleteNormalizedElements(...) Line 83
UTypedElementCommonActions::DeleteSelectedElements(...) Line 62
UUnrealEdEngine::Exec_Actor(...) Line 2610
UUnrealEdEngine::Exec(...) Line 725

The mismatch is caused by the fact that the default value of enum pins is handled differently between the UserDefinedPins and the Pins arrays.

  • "Pin->DefaultValue" will contain the string value of the enum
  • "PinInfo->PinDefaultValue" will be an empty string

The code in UpdateUserDefinedPinDefaultValues will copy the string value of the enum in "PinInfo->PinDefaultValue" and mark the blueprint dirty. Since the modified node is transient (K2Node_FunctionEntry for the output pin of the latent node) this new value doesn't get serialized so the "fixup" doesn't hold up.

Steps to Reproduce
  • Create a UAbilityTask class with an enum parameter in the delegate type
  • Create any class of blueprint which uses the new UAbilityTask node, e.g. a Gameplay Ability
  • Delete any actor from a level
  • Note that the blueprint has been marked dirty despite no reasonable changes to it

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-225128 in the post.

1
Login to Vote

Unresolved
ComponentUE - Gameplay - Blueprint Editor
Affects Versions5.45.4.4
Target Fix5.6
CreatedSep 23, 2024
UpdatedSep 26, 2024
View Jira Issue