After overriding SerializeState and UnserializeState and setting PLUG_DOES_STATE_CHUNKS to 1, how do you get those functions to actually be called during saving and loading the file in the VST host, respectively? I got this to work years ago for a different project but can’t get it working now. IPlugChunks also only calls these functions during preset saving and loading while using the plugin, not when it is reloaded or closed.
Check that your plugin class actually inherits from IPlugChunks and that PLUG_DOES_STATE_CHUNKS is defined to 1 in the config used when the VST2 wrapper is compiled, not just in an editor project or precompiled header. In VST2 the host saves/restores project state through effGetChunk/effSetChunk with isPreset=0; closing the GUI is not a save point, and some hosts only save on project save/autosave. Add logging in SerializeState/UnserializeState and the wrapper’s getChunk/setChunk to see which path fires. If testing VST3, that uses getState/setState instead.