Jump to content

driving a Clip sop with prim attributes


odToad

Recommended Posts

I have some prims that I need to drive through a Clip SOP. Each prim has got its own clipping plane origin and direction, previously computed and stored in prim vector attributes, eg v@clipOrigin and v@clipDirection

I would like to connect these attribute values to the inputs of a Clip SOP: Origin & Direction parameters but cannot figure out how to do it.

I tried (just showing the Origin.x parameter of the Clip here, but the y/z and the Direction.x/y/z would be analogous:

  1. @clipOrigin.x                                              no error, but wrong result (alway zero)
  2. v@clipOrigin.x                                            error: unable to evaluate expression - extra tokens detected in expression
  3. ch("../nodeJustAboveClip/clipOrigin/x")          error (bad parameter reference)
  4. hou.ch("../nodeJustAboveClip/clipOrigin/x")    error (unknown function in expression)
  5. also tried with a spare parameter

I realize the clipOrigin is not a parameter on my nodeJustAboveClip SOP, but rather an attribute on its prim output. So 3-5 are likely just plain wrong. 

Just in case Clip assumes it is running over points rather than prims, I also inserted a Attribute Promote SOP to copy the prim v@clipOrigin to each point.

With version 1 above, the result is the same - no error but always zero.

If you know how to do this, thank you in advance !

This is in Houdini 16.5 Indie

--------

SOLVED: I was using the wrong syntax in the parameter expressions. You can pick up prim or detail attributes in SOP (not just Clip SOP) parameters like this:

  • prim(surface_node, prim_num, attrib_name, attrib_index)
  • detail(surface_node, attrib_name, attrib_index)
  • details(surface_node, attribute)
  • point(surface_node, point_number, attribute, index)

Note these are VEX expression functions used in parameter expression one-liners, not regular VEX functions used in wrangles. The signatures of the functions are slightly different.

Edited by odToad
solution found, updating for future readers
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...