Add an option to regenerate the CDO of a blueprint class that derives from a C++ class

Hello, one common problem i frequently have is that I keep having leftovers from deleting/renaming variables and components (some still appear in the component list even though they no longer declared and initiatlized in the c++ constructor) or no longer use delegates that were binded in the constructor (some say it’s a better practice not bind stuff on the constructor, but sometimes it’s really useful, and once you get dangling binds, the only way is to remove bind in begin play so that it doesn’t execute) in the CDO. When a blueprint gets these types of problems usually you have to rebuild the blueprint to start off fresh, but some blueprints can have so much more stuff than the parent class, that rebuilding and making sure everything is 1:1 takes a lot of time take out of the development. Like there is a way to reload a blueprint (which is a really useful feature) there should be a recreate/update/clean option that would recreated the CDO (deleting unused variables/components/delegates, clearing the references to other assets, etc that are no longer defined in the constructor) while keeping the overriden values. I know there is a resavepackages commandlet that you can run that could help with that, but that runs it for the entire project, so a feature that could do this per asset would be a very welcome addition.

CDOs are rebuilt every time the editor is open.
Structural changes with editor open will cause structural problems.

I know the constructor gets called eveytime the editor starts, but it just seems to get overriden with that dangling behaviour (partially due to hot reloads like you mentioned) so there should be a way to reconstruct that blueprint fresh without having to rebuild it manually from scratch. Maybe not possible, but one can dream :slight_smile: I really like hot reload, but sometimes it gets to a point where it gives more hassle than it helps.

Yeah this is definitely an issue.

It seems like Blueprint classes are built from some precached template that doesn’t get regenerated without completely recreating the blueprint class from scratch.

Maybe I’ll try that commandlet to see if it fixes things.