hasprim expression

   3927   4   0
User Avatar
Member
201 posts
Joined: July 2005
Offline
H9.1.179

Having trouble using the hasprim expression with a switch SOP. In the Select Input field I have 'hasprim(“group_name”,“node_path”,0)' however nothing happens - keeps evaluating to zero (see attached image). Am I using this incorrectly?

As a side note, leading up to this I'm using surfsect SOP … is there anyway to figure out when the two inputs intersect? some sort of trigger?

Thanks in advance.

Rob

Attachments:
Capture.JPG (37.8 KB)

Cheers,
Rob
Digital Supervisor | Stargate Studios Toronto
User Avatar
Member
7732 posts
Joined: July 2005
Offline
Offhand, it looks like there's extra quotes around the expression.
User Avatar
Member
201 posts
Joined: July 2005
Offline
edward
Offhand, it looks like there's extra quotes around the expression.

If I don't have the quotes (either forward or back) I get an error saying can't evaluate and hasprim is not defined?!
Cheers,
Rob
Digital Supervisor | Stargate Studios Toronto
User Avatar
Member
1908 posts
Joined: Nov. 2006
Offline
hasprim is an Hscript Expression function and your node language is set to use Python, which is why it says it's not defined when you remove the quotes. Right now, with the quotes, it's returning that string expression which is useless in the context of the parm and returning 0. Either changing the expression/node to Hscript, or wrapping it in a hou.hscriptExpression() should make it work.
Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
201 posts
Joined: July 2005
Offline
graham
hasprim is an Hscript Expression function and your node language is set to use Python, which is why it says it's not defined when you remove the quotes. Right now, with the quotes, it's returning that string expression which is useless in the context of the parm and returning 0. Either changing the expression/node to Hscript, or wrapping it in a hou.hscriptExpression() should make it work.

Thanks graham, that was the problem.
Cheers,
Rob
Digital Supervisor | Stargate Studios Toronto
  • Quick Links