SerialisationTraits

I’d like to use SerialisationTraits to write serialization functions for several custom types that make up part of my plugin state. I’ve got a SerialisationTraits specialization that calls archive(named()), and in my AudioProcessor class I’m creating a ValueTree and setting a property on it with StrictVariantConverter<MyType>::toVar(). However, when I run my plugin, I hit an assertion inside ValueTree code on state saving that says that DynamicObjects cannot be written to a stream – it seems that archive(named()) creates a var that holds a DynamicObject, and a ValueTree that has any vars that are DynamicObjects cannot be written to a stream or to XML.

Am I missing something here? Is there any way around this, or is SerialisationTraits basically incompatible with ValueTree to/from streams/XML?