[C++] Array of Instanced UObjects NULL after BP Compile.
I'm seeing all my instanced objects not being properly copied over to the new CDO once the BP compiles. The array still has the same number of entries, but each entry is now a nullptr. I'm using a custom editor that inherits from BlueprintEditor to modify the entry so I'm curious if this is on my end, or just a bug.
Also this may be the same issue as described here: https://issues.unrealengine.com/issue/UE-37137
To repro it, add an array of instanced UObject*'s like so to a Blueprint class:
I've worked around this temporarily by caching off the values pre-compile and then restoring them post-compile, but man does it feel gross/hacky.
Let me know if you need me to provide you code/examples.
asked Nov 01 '16 at 12:10 AM in C++ Programming
I figured things out.
So, the field was marked instanced, but the class it was instantiating wasn't marked as EditInlineNew in a few child classes that derived from a common abstract uobject. So it would see the reference, go to copy it, but fail this logic check in the Duplicate method in InstancedReferenceSubobjectHelper.h:
So, my fault. It might be nice to have a warning if the for some reason this Duplicate fails (rather than silently failing) given it's copying known instanced objects from one object to another so a failure here is pretty nasty and you just end up with null pointers in containers, etc in the destination object.
answered Nov 02 '16 at 01:11 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here