[ADVANCED] How to make Unreal NOT reset object reference array elements to default values?

Hello,

I have this problematic behavior which I was not able to solve for a long time despite having asked numerous times.

The problem boils down to the following:
I have a Blueprint asset which has a details customization for viewing a certain component (custom editor code). This might not be the thing causing the issue but is still worth mentioning.

In this component, I have an array of UObject derived objects (pointers to those objects).
Every time I drag & drop an instance of this Blueprint into a scene, those array objects are duplicated and so the newly created instance now has its own set of those array objects. The idea here is that I need to be able to set template objects in the Blueprint asset for the sake of reusability and comfort, but then I need to have duplicates of these objects on each component in the scene. The reason I duplicate the objects is to avoid having references to objects that reside on “external packages”. The reason I cannot afford to have references in the scene to objects that reside to “external packages” is that I cannot save the scene with such references.

I use the “Instanced” property specifier. The reason I use “Instanced” property specifier is that it allows me to see the inner fields of a object in the details panel and thus allows me to customize how they look. I have tried using the “EditInline” specifier (thinking it might solve my problem) but it has been deprecated in favour if “Instanced”, which in turn implies “EditInline” and “Export” specifiers.

It all works great and as expected until I reopen my scene. I notice that upon reopening my scene the object references in the scene get reset to the references in the Blueprint asset (see video below).

My array is defined as:

UPROPERTY(EditAnywhere, Instanced)
TArray<USomeObjectClass*> Objects;

I have been debugging and it absolutely seems like I am not resetting these objects by myself.

I also noticed something curious - if I add more objects in the array to any component in the scene - those objects are not being reset. This leads me to think that the engine, for some reason, is resetting only those objects that have some equivalent in the Blueprint asset (see video below).

I have tested this on a clean project with very basic functionality. The issue persists there as well. Which means that neither my custom code nor the editor details customization is causing the issue.
To be explicit, I do NOT want the engine to reset my object reference values upon reopneing the scene. How would I do that?

You can download a very small example project of the issue here ~39 MB (version 4.26): Dropbox - ObjectReset.rar - Simplify your life

Also, here is a short video on how to reproduce the issue: Dropbox - ObjectReset.mkv - Simplify your life

Thank you :wink:

Bumping this, anybody got a clue?

Yet, another bump :slight_smile:

A final bump.