How save user input data in vvvv gamma


I want to save the values entered by the user so that they are displayed the next time the user opens the application, without having to enter the values again. How should I do this?

You have several options :

  • You could either save these settings to disk (Serialize them) and read them again when your program starts (Deserialize them)
  • Or you could save them to a pin using the advanced SaveToModelPin node, which would save the settings in the patch directly.

In both cases I would first recommend create a Record or a Class that contains those settings, it’ll be easier to manage them!

1 Like

image


I have made such attempts, but it can only save one value. When I want to save multiple values, there is a problem of value overwriting.

Not sure what you’re attempting there.

Workflow would be :

  1. On Create, look for a settings file (let’s say settings.xml)
  2. If found, deserialize it and make a Channel out of it
  3. If not found, create your Settings object and make a Channel out of it
  4. When a user clicks a Save button, Serialize your Settings and write them to the settings.xml file
  5. Pass this Channel to your ImGUI editor and to your app
1 Like

sebescudie,thank you, I found a Persistent Node, I will give it a try.

@sebescudie can you provide minimal example of SaveToModelPin?
Still can’t figure out how it works and maybe a minimal example would be helpful

@Ice_snow I don’t think there’s a guaranteed successful way to do it right now. Everyone comes up with their own way. A lot of people are experimenting with Model/Runtime at the moment. I have a project that I usually do my projects with, but it’s a bit advanced.

SaveToModelPin.vl (28.0 KB)

There you go! Sorry for the delay. Hope this helps!

@sebescudie Thanks! Now it’s a lot more clear!

And as far as I understand, we have to manage the saving and loading of this state in exported applications ourselves?

Actually, it’s a pretty interesting concept. It turns out that any editing of the interface changes the patch itself and it has to be saved. In some cases it can be very convenient, and in some cases very inconvenient