Forum

Deserialize custom datatype documentation

vl

#1

hi all

I checked the helppatches in lib/vlCore the grey book but still had troubles deserializing my custom datatype. maybe a extra example in lib/vlcore would help others. Took me a long time to figure out that I had to split the xElement to get a spread of my elements.

Deserialize node works, but behaves in a strange way when connected directly to the xElement node. It was not clear to me that I had been working with the wrong datatype.

Unbenannt


#2

i think you need the Root node of the XDocument, not its children elements…


#3

When I use the data coming out of “XDocument” I am unable to pass it through a sink. And when connected directly to the Deserialize the node outputs a messed up object, changing every frame.

When I patch it as shown in the first picture it works correctly.


#4

there is a node called Root (or RootElement) in the xml category, if i remember correctly.

but true, we should have a ready made node for load/save to file.


#5

but wait, this looks odd. can you share this patch with us?


#7

certainly, here you go

VL.zip (37.6 KB)


#8

in the gif above, the patch adds one spread dimension on every load/save, probably not what you want.


#9

mkay…the patch you attached is not exactly the one that shows the weird flickering in the gif above, so i cannot reproduce that.

anyway de/serialization for this case should be as simple as:

grafik

note the XMLReader/Writer nodes are not the advanced ones that you used in your patch!


#10

Thank you guys for the support!

@joreg
“xDocument -> Deserialize -> AddSpread” produces the flicker
I sent you the working one so please have a look at this patch if you want to investigate:

VVVV.Value.FI.vl (152.1 KB)


#11

upcoming vl version has a handy node called Persistent. it can be used to read/write data in a patch to disc:
image


#12

new alpha is up and this new node can be tested, among a few other new nodes, like tuples up to 8 items and quaternion to euler angles.