Summary:
Exposed Nodes copied and pasted in VVVV have an inconsistent state when inspected via the plugin interface compared with values in Herr Inspektor.
Details:
Considering the following simple plugin:
- region usings
using System;
using System.Linq;
using System.ComponentModel.Composition;
using VVVV.PluginInterfaces.V1;
using VVVV.PluginInterfaces.V2;
using VVVV.PluginInterfaces.V2.Graph;
using VVVV.Utils.VColor;
using VVVV.Utils.VMath;
using VVVV.Core.Logging;
- endregion usings
namespace VVVV.Nodes
{
#region PluginInfo
[PluginInfo(Name = "TestNode", Category = "Value", Help = "Basic template with one value in/out", Tags = "", AutoEvaluate = true)](PluginInfo(Name = "TestNode", Category = "Value", Help = "Basic template with one value in/out", Tags = "", AutoEvaluate = true))
#endregion PluginInfo
public class ValueTestNodeNode : IPluginEvaluate, IDisposable
{
#region fields & pins
[Input("Input", DefaultValue = 1.0)](Input("Input", DefaultValue = 1.0))
public ISpread<double> FInput;
[Output("Output")](Output("Output"))
public ISpread<double> FOutput;
[Import()](Import())
public IHDEHost FHost;
[Import()](Import())
public ILogger FLogger;
private bool initialized = false;
#endregion fields & pins
public void Dispose()
{
FHost.ExposedNodeService.NodeAdded -= OnNodeAdded;
}
//called when data for any output pin is requested
public void Evaluate(int SpreadMax)
{
if(!initialized)
{
FHost.ExposedNodeService.NodeAdded += OnNodeAdded;
initialized = true;
}
}
public void OnNodeAdded(INode2 node)
{
node.Pins.ToList().ForEach(p => {
FLogger.Log(LogType.Debug, "Pin Name: " + p.Name + " Pin Slices: " + p.SliceCount + " Pin Spread: " + p.Spread);
});
}
}
}
Observed behavior:
- If I create an IOBox, enter a value in the “Tag” pin in the inspector and expose & copy/paste that IOBox in the patch, the value in “Tag” is not shown in the TTY Renderer as one would expect. The inspector of the copied IOBox however, does show the correct value.
- If I create an IOBox of type Bang, its Behavior appears as “Bang” and its Value Type is “Boolean”. However, when copied/pasted, the resulting IOBox has Behavior “Toggle” and Value Type “Real” (which seems to be the default configuration for IOBoxes of type Value).
Expected behavior:
The INode2 instances passed into the NodeAdded/NodeRemoved callbacks should correspond exactly to their parents (wich the exception of node ID and possibly other attributes) as well as the values shown in the node inspector.
I attached 2 screenshots that demonstrate the problem.