Jump to content

haspointattrib VEX function selectively reads attributes ?


Recommended Posts

Hi,

In a dop network, I am using POP Wrangler to read some point attributes using "haspointattrib" VEX function, however, not ALL attributes are read? The point attributes I am interested in are created by SOP Ray node ("hitprim" and "hitprimuv") located in geometry network. However, "haspointattrib" can still read other attributes like P (but not the ones created by Ray node)?! for example:

i@exists = haspointattrib("/obj/crowdsim/ray1", "P"); //returns 1, i.e. P do exists

i@exists = haspointattrib("/obj/crowdsim/ray1", "hitprim"); //returns 0, i.e. hitprim does't exists

I double checked that "hitprim" exists in /obj/crowdsim/ray1, which also contains "P" point attribute.

I am not sure if there are limitation to using "haspointattrib" function (the docs do not say any)? or maybe I should not use in POP Wrangler node? The only thing in POP Wrangler that says this node does not use Local Variable but "hitprim" is an attribute and not a local variable.

https://www.sidefx.com/docs/houdini15.5/vex/functions/haspointattrib

https://www.sidefx.com/docs/houdini15.5/nodes/dop/popwrangle

 

Thanks in advance,

 

 

 

 

Link to comment
Share on other sites

Thanks pusat :) Actually, I did some investigation, I verified they are Point primitives (although their names has "prim" prefix). The problem was from my side :rolleyes: I was writing the SOP path without "op:" so the command failed to retrieve the geometry! i.e. 

i@result = point("/obj/c/ray1", "hitprim", 0); // fails because no op: 

i@result = point("op:/obj/c/ray1", "hitprim", 0); //works!

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...