PluginInterface: Set Pin Values saving behaviour needs improvement

If you set the value of a pin via the plugininterface, and the pin information didnt exist in the patch xml, that value is not being saved.

E.g: The Tag pin of an IOBox is not automatically filled and created in the patch XML when you create that node. Now if you set the Tag pin value via the Plugininterface, for example the Pinserver (not via SetPatch), the value is set correctly. It even shows up in the patch xml you get through getPatch. But when you save that patch, the information is lost. You have to create the field first either manually or via setPatch to be able to save the data that is held in there.

a simple dynamic plugin demonstrating this would help.

This one is based on the Server (vvvv) helppatch.
Instead of writing to the value field, it writes to the Tag pin.
The value written there is not being saved, unless you set the Tag field manually once.

SetPinValueSavingBug.v4p (22.2 kB)

ah right,

we have to distinguish:

  • setting a pins value
  • changing a patchs source-code

Server (VVVV) (by design) only sets pinvalues and does not change the patchs xml description. that is not to say that it would not be possible to write your own version of the “server” that does change a patchs source. for this you’d use: pluginspecs/html/M_VVVV_PluginInterfaces_V2_IHDEHost_SendXMLSnippet.htm

But if you getPatch on the Patch in which you changed the Pin Values only, the Values still do appear in the PatchXML description. This is misleading then.
And as we know setting PinValues via SetPatch was possible before, just much slower …

hm…that is not true for me. if in your patch i set the green ioboxes tag via the server it is not visible in the xml (only after i saved a manual change once, as you pointed out. which is strange).

right, and it still is, vis SetPatch as well as via SendXMLSnippet(). or am i missing something?