bigfug / Fugio

An open visual programming system designed for fast development and long-term preservation of digital art and creative exploration
http://www.bigfug.com/software/fugio/
GNU Lesser General Public License v3.0
151 stars 22 forks source link

ADD nodes "Edit Default" values are behaving as strings #38

Closed nickdiacre closed 6 years ago

nickdiacre commented 6 years ago

These nodes add 1 + 2 and return 12, parsing as strings rather than int/float.

Expectation would be that they were floats.

Many thanks,

Nick

bigfug commented 6 years ago

I'm thinking to put this into the 'feature' category... The Add (and Sub/Mul/Div/etc) take the type of the first input pin to define the output type. The default value is always a string, but may be interpreted on other nodes as another type if that input pin is expecting a float or int, for instance.

In the case of nodes which have a variable output type, we would have to add special cases to say 'does this input look like a number, if it does then treat it as a float (or int, or double, etc)', which might work a lot of the time (and I agree is probably the more expected behaviour) but what about if you wanted to add the strings '1' and '2' together - it would override your types and treat them as numbers, with no work around.