View Full Version : smoothstep error when run in proc

03 March 2011, 10:11 PM

I have a script that I want to turn into a tool, but when I put it inside of a proc I keep getting an error message saying :

// Error: Invalid call to "smoothstep". Check number and types of arguments expected by the procedure. //

The original code works fine, so I was wondering if anyone has run into this before. Here's the bit of code it's freezing up on.

$res = the resolution of the fluid container I'm emitting into

if ($y <= (($res[1]) / 2)) {
$normY = smoothstep ( 0 , (($res[1]) / 2), ($y) );

Thanks for checkin it out,

03 March 2011, 10:23 PM
Maybe :

$normY =` smoothstep ( 0 , (($res[1]) / 2), ($y) )`;

03 March 2011, 04:18 AM
Or perhaps

$val = (($res[1])/2);
if ($y<=$val){...
$normY = `smoothstep(0,$val,$y)`;

03 March 2011, 05:15 AM
Thanks for the replies. smoothstep has two different syntaxes:

1) smoothstep (0,1,.5); <--- separated by commas with parenthesis


2) `smoothstep 0 1 .5`; <----- back ticks and no parenthesis

Syntax wasn't the problem, but when I was querying the resolution, the value returned was a float array that the smoothstep function didn't seem to like. I just added a line :

float $yRes = res[1];

and replaced the variable and everything works fine now. Thankeeee

CGTalk Moderation
03 March 2011, 05:15 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.