Skip to content

Commit

Permalink
fix for "minor conservative plugin interface improvements:"
Browse files Browse the repository at this point in the history
This fix partly reverts commit 421c2e132b9a61f983d0512b8266efa2c8d64a46.
  • Loading branch information
gregsn committed Apr 13, 2017
1 parent 39c649e commit b3e6bfc
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions vvvv45/src/core/PluginInterfaces/V2/PluginHostExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ public static INodeIn CreateNodeInput(this IPluginHost host, InputAttribute attr
INodeIn result = null;
host.CreateNodeInput(attribute.Name, (TSliceMode) attribute.SliceMode, (TPinVisibility) attribute.Visibility, out result);
if (type != null)
result.SetSubType2(type, new Guid[] { GenerateGUIDHack(type) }, type.GetCSharpName());
result.SetSubType2(type, new Guid[] { type.GUID }, type.GetCSharpName());
else
result.SetSubType(new Guid[] { }, "Variant");
SetInputProperties(result, attribute);
Expand Down Expand Up @@ -393,27 +393,11 @@ public static INodeOut CreateNodeOutput(this IPluginHost host, OutputAttribute a

private static void RegisterID(IPluginHost host, List<Guid> guids, Type t)
{
Guid id = GenerateGUIDHack(t);
Guid id = t.GUID;
guids.Add(id);
host.RegisterType(id, t.GetCSharpName());
}

static Guid GenerateGUIDHack(Type type)
{
if (type.IsGenericType)
{
var result = type.GUID.ToByteArray();
foreach (var argument in type.GenericTypeArguments)
{
var a = argument.GUID.ToByteArray();
for (int i = 0; i < result.Length; i++)
result[i] ^= a[i];
}
return new Guid(result);
}
return type.GUID;
}

public static IRawIn CreateRawInput(this IPluginHost host, InputAttribute attribute)
{
IRawIn result = null;
Expand Down

0 comments on commit b3e6bfc

Please sign in to comment.