komorra / NodeEditorWinforms

Node based user control / editor for Windows Forms
MIT License
507 stars 142 forks source link

output string parameter #10

Open arqtiq opened 6 years ago

arqtiq commented 6 years ago

Hello, thanks for the work this is great !

I encountered an issue when trying to create a simple "String Value" node, based on the MathSample :

[Node("String Value", "Input", "Basic", "Allows to output a simple string value.", false)]
public void InputStringValue(string inValue, out string outValue)
{
    outValue = inValue;
}

When creating the node, I have this exception :

System.MissingMethodException: 'Constructor on type 'System.String' not found.'

This breaks into NodeVisual.cs line 193, because the tested out type is not 'String' but 'String&'.

I worked around it by replacing the test this way :

var p = output.ParameterType.Name.TrimEnd('&').ToLower() == "string"

I thought this would require your attention for a proper fix :)

zhenyuan0502 commented 5 years ago

@komorra I got the same problem, do you still maintain this project?

BlizzCrafter commented 5 years ago

Just create your own custom nodes like this: https://gist.github.com/sqrMin1/ee7fab1a584c6c63e8c32c90f7be7dc4

You will not run into issues like this anymore.

komorra commented 3 years ago

Hi, this has been fixed now, in 01dcc2903ce1718b9296f09b9a513dfd2d761ca3 , now it is possible to use string types directly as node input and output parameters.