vex expression if syntax?

   6239   2   1
User Avatar
Member
48 posts
Joined: Dec. 2015
Offline
Hi there

So I'm trying to alter gravity in a dop based on the frame number. I've got it key framed at the mo but I'd rather be able to use the expression.

I thought the correct syntax would be
(if($F>=30),9,0) entered into the gravity y field

meaning if I'm at frame 30 or above gravity is 9 else it's 0.
but this doesn't work?

Can someone please give me the correct syntax?

thanks
Nigel.
User Avatar
Member
459 posts
Joined: Oct. 2011
Offline
Hi
The pattern is: “if(expression, true_value, false_value)”. You have misplaced one parenthesis after the expression statement.
So it needs to look like this: (if($F>=30,9,0))

http://www.sidefx.com/docs/houdini15.0/expressions/if [sidefx.com]

-b
http://www.racecar.no [www.racecar.no]
User Avatar
Member
48 posts
Joined: Dec. 2015
Offline
thanks, much appreciated.
  • Quick Links