Description

TMaps do not function as I would expect when blueprinted. Any change made to the instance completely disables inheritance of all changes to the CDO, rather than only overriding the keys that are modified.

Repro as pictures follows.

Initial situation:
[Link Removed]
Modify Foo in instance:
[Link Removed]
Modify Bar in BP:
[Link Removed]
Add Baz to BP:
[Link Removed]

Definition of test class used:

UCLASS(Blueprintable)
class AMapTestActor : public AActor
{  
GENERATED_BODY()  

public:  
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Test)  
TMap<FString, int> Map;  
};

Steps to Reproduce
  1. Create a Blueprintable actor class with any map as a UPROPERTY, eg. TMap<FString, int>.
  2. Create a blueprint class from the class.
  3. Edit the blueprint, and add 2 keys, eg. "Foo" = 100, "Bar" = 200, save the blueprint
  4. Create an actor from the blueprint.
  5. Observe that all changes made in the CDO are reflected in the instance.
  6. Change the value of "Foo" to 101 in the instance, save the instance
  7. Change the value of "Bar" to 202 in the CDO. Compile.
  8. Observe that the change to "Bar" is not changed in the instance anymore.
  9. Add a third key, "Baz" = 300 to the CDO. Compile.
  10. Observe that no "Baz" is added to the instance, this is a bug
  11. If you save the CDO (but not the instance) and reload, it will actually apply the changes. But if you saved the instance in a broken state it may stay broken

Have Comments or More Details?

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

1
Login to Vote

Backlogged
ComponentUE - Gameplay - Blueprint Editor
Affects Versions4.25
CreatedMar 18, 2020
UpdatedNov 22, 2023