CDO is not an outer for soft object property. How is that?

Hi all.

I’m making an improved system for choosing a default value for soft references (actors and components)(The problem with search is still relevant…).

The actor references work as intended (I think), but there is a very serious bug with the component references:
The default value for component references does not change if you change the default value in the blueprint and compile. It stays the same as it was when the actor was added to the level.

However, next to the variable (if you make it visible) there is a reset to default value, and then the value will be as intended. But you have to do this for EVERY change and compilation.

I tried to understand what the problem was, and I think I found it. The owner of the Property for the actor reference is CDO.
Its path is:

/Engine/Transient.Default__BP_Test_C

But for components - for some reason it is not CDO.
Its path is:

/Engine/Transient.BP_Test_C_X

and after each compilation X becomes new.

I have an idea on how to FORCE the references to update (but it’s highly questionable).

The bug appears only for blueprint variables, references that are set as parameters for nodes work properly.

Is this an engine bug or was it done this way on purpose (why)?
And most importantly, is there a correct way to make references on components work similarly to references on actors?

I hope developers from Epic will drop by here, but I will also be very glad to just people in the know.
Thanks in advance to everyone.

I think it’s time for me to stop being surprised by my own ability to create problems where there aren’t any… :smirk:

All this time, under my nose there was a function that changes the value without any problems:

PropertyHandle->SetPerObjectValues(Buffer);

But instead I went through a huge (and not always working) path of searching for the owner, class, property etc.

…SomeCode…

void* ValuePtr = GetSoftObjectProperty()->ContainerPtrToValuePtr<void*>(PropertyOuter);
GetSoftObjectProperty()->SetPropertyValue(ValuePtr, FSoftObjectPtr(NewValue.ToString()));

There is an opinion that life develops in a spiral, but my life is a spiral rake… :laughing:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.