An editor crash can be observed when copy-pasting an actor with an actor component with an instanced object property when set to a non-default value.
Detailed steps to reproduce are provided below.
The crash seems to be caused by a check in FObjectInstancingGraph::GetInstancedSubobject at line 210:
checkf(SubobjectOuter && SubobjectOuter != INVALID_OBJECT, TEXT("No corresponding destination object found for '%s' while attempting to instance subobject '%s'"), *SourceSubobject->GetOuter()>GetFullName(), *SourceSubobject>GetFullName());
This behaviour seems similar to that described in this knowledge base article:
https://udn.unrealengine.com/s/article/EditInlineNew-Instanced-Components
Use the following code in the header:
UCLASS(BlueprintType, Abstract, EditInlineNew)
class UPL_TestSubobjectBase : public UObject
;
UCLASS()
class UPL_TestSubobjectOne : public UPL_TestSubobjectBase
{
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere, BlueprintReadWrite)
int32 One
;
};
UCLASS()
class UPL_TestSubobjectTwo : public UPL_TestSubobjectBase
{
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere, BlueprintReadWrite)
int32 Two
;
};
UCLASS(BlueprintType, Meta = (BlueprintSpawnableComponent))
class UPL_TestComponent : public UActorComponent
{
GENERATED_BODY()
public:
UPL_TestComponent(const FObjectInitializer& ObjectInitializer);
UPROPERTY(EditAnywhere, BlueprintReadWrite, Instanced, NoClear)
TObjectPtr<UPL_TestSubobjectBase> TestSubobject
;
};
Use the following code in the CPP:
UPL_TestComponent::UPL_TestComponent(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
Do the following:
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-205705 in the post.
0 |
Component | UE - Framework |
---|---|
Affects Versions | 5.3, 5.3.2 |
Created | Feb 2, 2024 |
---|---|
Updated | Aug 27, 2024 |