Saving JSON file from editor using getStateInformation in processor

Hello,
I just discorvered that we can save the state of the plugin in the processor but I didn’t know that when I did my plugIn.
My plugIn allows to export a JSON file that represent its internal state so I am able to drag and drop the JSON file back into the editor. This is convinient for me because I intend to use several presets. But when I close my plugIn in REAPER it goes back to the empty default state so I would like to find a way to recover the data.
In my understanding this is exactly what getStateInformation does but since all my JSON handling is made from my editor I wonder if there is a way to use this function.

To understand better I have, in my editor, an exportJSON function and I use filesDroped function to recover from it. In my fileDroped I recreate all the filters I need. Each filter is made of what I call a FilterCard in the editor side and when I create a new one it creates a new filter on the processor side to be linked with. So I do need all this stuff to happen in the editor side which is why I struggle to use getStateInformation from processor. I do not want to save the internal state only on the processor side and I unfortunatly don’t use valueTrees.

Thank you for any information that would help me !

According to the documentation of getStateInformation:

The host will call this method when it wants to save the processor’s internal state.
This must copy any info about the processor’s state into the block of memory provided, so that the host can store this and later restore it using setStateInformation()

Therefore, you have to save & load the internal state on the processor side (through those two functions). You can create filters on the editor side (although it might be a bad idea). However, you have to save this state somewhere (in the processor) so that

  • when the host calls getStateInformation, the internal state will be saved correctly.
  • when the host calls setStateInformation, the internal state will be loaded correctly.

Ok I get it but then all the UI will be missing. For instance, on my UI I choose some paramters for my filters, this will be applied in the processor filters, then if I quit the plugin an reopen it, I will only hear my filters but no way to retieve the UI right ?
Because the hole purpose of my plugIn is to be able to export the JSON to be shared later, so if I have no UI I will not be able to generate the JSON.

UI should get the internal state from the processor during its construction and update its state accordingly.

Ok thank you for the help, I did not design my plugin that way so I don’t think this is a suittable solution but I will make next ones so that it is feasable.