If expression in font sop

   2868   2   1
User Avatar
Member
2 posts
Joined: Nov. 2018
Offline
I'm quite new to houdini and get around using “if” expression in font sop.
I want to change the value (L or R) in font SOP by the value(hand: 0 or 1) in controller.
This is what I write, but it could not work.
if(`chs(“../CONTROLLER/hand”)` == 1){`L`}

Is it possible to use “if” in font SOP?

Attachments:
if_in_font.PNG (55.9 KB)

User Avatar
Member
402 posts
Joined: April 2017
Offline
if you're using hscript expressions and you want to return a string from an if statement, use ifs() instead.

additionally, you're using VEX syntax for that if() statement. you can't use VEX in a parameter expression like that. the expression version looks like this:

ifs(condition, “string if true”, “string if false”)
Edited by toadstorm - Feb. 5, 2019 13:52:49
MOPs (Motion Operators for Houdini): http://www.motionoperators.com [www.motionoperators.com]
User Avatar
Member
2 posts
Joined: Nov. 2018
Offline
Thank you, toadstorm.
I can solve the problem.
The correct code is
`ifs(ch(“../CONTROLLER/hand”)==0,“L”,“R”)`
  • Quick Links