NodeEditorWinforms icon indicating copy to clipboard operation
NodeEditorWinforms copied to clipboard

output string parameter

Open arqtiq opened this issue 7 years ago • 3 comments

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 :)

arqtiq avatar Sep 04 '18 13:09 arqtiq

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

zhenyuan0502 avatar Apr 17 '19 11:04 zhenyuan0502

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

You will not run into issues like this anymore.

BlizzCrafter avatar Apr 17 '19 20:04 BlizzCrafter

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

komorra avatar Feb 06 '21 13:02 komorra