sd-sex icon indicating copy to clipboard operation
sd-sex copied to clipboard

Unable to declare negative numbers

Open FlashFight opened this issue 3 years ago • 5 comments

float(-1.0), int(-1), etc. all return ERROR: float() takes only const arguments ERROR: int() takes only const arguments etc. I presume this is due to "-" being used for negation.

FlashFight avatar Sep 03 '21 01:09 FlashFight

thanks for the report! yeah, that's annoying (has to be -float(1.0), not the best solution)

I'll fix that in the upcoming update among other stuff

igor-elovikov avatar Oct 12 '21 11:10 igor-elovikov

Was this ever fixed? :) I just found out that doing something like this is not possible right now either :( float3(0.8, 0.4, -0.2)

PS. Great tool btw! Love it!

Faranell avatar Mar 27 '23 21:03 Faranell

yeah, it's fixed in dev branch among other things (for example declaring consts are much easier).

f3: float3 = {1.0, 2.0, 3.0}
f2: float3 = 1.0 # implicitly become {1.0, 1.0, 1.0}
f: float = 1.0
v: float4 = {f, f, f, 1.0}

etc

also more sane loops and much better support for parameters it's just not very stable atm

I'm actually waiting for the new designer update where loops should be natively supported by function graphs and I add this to plugin. Then I merge new version to main

igor-elovikov avatar Mar 28 '23 07:03 igor-elovikov

Oww that sounds amazing <3

Seeing theres some new syntax, will it also support x += y or do we still need to do x = x + y?

Faranell avatar Mar 28 '23 21:03 Faranell

yep, "augmented assigns" ie += -= *= is supported in the new branch

igor-elovikov avatar Mar 29 '23 07:03 igor-elovikov