PDA

View Full Version : smoothstep error when run in proc


pfunkifized
03-11-2011, 09:11 PM
Helloooo,

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,
p

ginodauri
03-11-2011, 09:23 PM
Maybe :

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

RobotGilardi
03-12-2011, 03:18 AM
Or perhaps

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

pfunkifized
03-12-2011, 04:15 AM
Thanks for the replies. smoothstep has two different syntaxes:

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

or

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-12-2011, 04: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.