Wanted to post this to raise awareness for those creators that may use BP generated structs and enums in your projects.
TLDR: When you need to modify a BP generated struct or enum follow these steps
Save your current work
Make the change to the struct/enum (rename or add property/entry)
Save the struct/enum
Exit the editor WITHOUT SAVING anything else
Relaunch the editor to resume working
More info:
When you modify a Struct or Enum that is already referenced in loaded BP classes, those referencing classes will be marked dirty. If you (very reasonably) Save All at this point, these referencing BPs will become damaged. You won’t see any errors in your BPs when working. However you will see errors in your output log when loading these BPs and your game will not package until they are resolved. Up until now this was a tedious process of renaming the struct/enum and then opening all referencing BPs and compiling / re-saving them.
Further, if you continue to work while your BPs are in this damaged state, it’s possible to fully corrupt them resulting in being able to no longer open them or other classes that reference them. I have had this fully brick projects where the asset reference chain would load corrupted BPs crashing the editor on launch.
For years I have run into this bug over and over in many engine versions and could never understand what the cause was. I recently found this youtube vid (not mine) that finally explained the cause and provides the workaround.
I reported a bug with full repro steps and logs on UDN so hopefully we can finally get this fixed.
For years I have run into this bug over and over in many engine versions
And it’s still there, indeed. I’ll have you know it can manifest without enumerators, you can have it happen by merely exposing / updating struct variable, too . First time I run into this issue was around 2016/2017 (?) when structs declared in BPs were ridiculously prone to corruption. Since then I’ve been leaving slightly more detailed steps very much like yours dotted around the Anwer Hub and then the Forums. I reported it a bunch of times, too. Problem is, providing 100% repro steps cannot be done, can it?
I have provided 100% repro steps to epic in a bug report. They also already have the bug in their database with 100% repro steps. It’s been there for over 2 years. Not sure why it never gets fixed.
This is one of the worst things in the engine. Literally EVERY time we add a value to an enum or struct we have to restart the editor, else risk data lose.