Description

From UDN Description


Hello, there's an ensure that's firing in `DetailLayoutHelpers.cpp#137`:
[Start code block]
ensure(PropertyNodeMap.ParentProperty == CurObjectNode);

[End code block]whenever we have:
- 2 of the same components on an actor...
- each with a VisibleAnywhere Instanced object property...
- ...and the instanced object has any properties to display.

We're assuming that because VisibleAnywhere + Instanced properties are treated specially (e.g. they flatten similar to ShowInnerProperties), there's some issue with multiple of the same property existing under the same 'parent node' when the details are being built. I don't fully understand how the property node map works in general, but we're wondering if there's a fix? Everything seems to function fine, but we're not sure if this setup could lead to problems were unaware of.

Here's an easy way to repro the issue in stock 5.3:
[Start code block]
/** Test object that gets instanced. */
UCLASS(BlueprintType, DefaultToInstanced, EditInlineNew)
class REPRO_API UTestInstancedObject : public UObject
{
GENERATED_BODY()

UPROPERTY(EditAnywhere)
int32 TestInstanceProperty;
};


/** Test component, add 2 to an actor. */
UCLASS(BlueprintType)
class UTestComponent : public UActorComponent
{
GENERATED_BODY()

public:
UTestComponent(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
TestObjectProperty = CreateDefaultSubobject<UTestInstancedObject>("TestObject");
}

/** Problematic property, inlined. */
UPROPERTY(VisibleAnywhere, Instanced)
UTestInstancedObject* TestObjectProperty;
};


/**
* Problematic actor, has two components with inlined-instanced objects.
* Add this actor to a level and select it to cause DetailLayoutHelpers to trigger an ensure.
*/
UCLASS(BlueprintType)
class ATestActor : public AActor
{
GENERATED_BODY()

public:
ATestActor(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
ComponentA = CreateDefaultSubobject<UTestComponent>("ComponentA");
ComponentB = CreateDefaultSubobject<UTestComponent>("ComponentB");
}

UPROPERTY(VisibleAnywhere)
UTestComponent* ComponentA;

UPROPERTY(VisibleAnywhere)
UTestComponent* ComponentB;
};

[End code block]Thanks!

Steps to Reproduce

Please see UDN Description

Have Comments or More Details?

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

14
Login to Vote

Backlogged
CreatedJan 11, 2024
UpdatedJan 20, 2024
View Jira Issue