UCLASS(BlueprintType, EditInlineNew, DefaultToInstanced)
class UTestEditInlineObject : public UObject
{
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere, Category=Test)
float TestProperty = 0.5f;
UPROPERTY(EditAnywhere, Category=Test)
bool bTestProperty2 = false;
};
UCLASS(BlueprintType, meta = (BlueprintSpawnableComponent))
class UTestComponent : public UChildActorComponent
{
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere, Instanced, Category=Test)
UTestEditInlineObject* EditInlineObject;
};
- Create an empty actor in the level. Add a “Test” component and set the EditInlineObject on the new component.
- Create a blueprint from the actor using the option in the details panel.
- Save the level. The save will fail due to “external references”.
- (optional) Delete the actor. Add a new instance of the actor to the level, using the blueprint that was just created. Save the level; this time, the save will work.
This bug seems to be triggered by having an instanced subobject in a component on the actor. Crucially the external package reference doesn’t make sense, as it’s listing a property in the new blueprint which is pointing to an object which is also in the blueprint, and everything is fine if you then replace the actor. I assume the initial BP instance which replaces the original actor in the world is somehow corrupted.
Reference log:
LogSavePackage: Warning: Referencers of TestEditInlineObject /Game/Test_Actor_Blueprint1.Test_Actor_Blueprint1_C:Test_GEN_VARIABLE.TestEditInlineObject_0:
LogSavePackage: Warning: TestComponent /Game/Test_Actor_Blueprint1.Test_Actor_Blueprint1_C:Test_GEN_VARIABLE (1 refs)
LogSavePackage: Warning: 0) ObjectProperty /Script/Plugin.TestComponent:EditInlineObject