Jump to content

Working with primintrinsics in VEX


HundredsofBears

Recommended Posts

Hey all,

I'm attempting to find the number of unique values across the intrinsic:typename attribute for incoming geometry, but I'm having no luck in getting the uniquevals() function to detect any intrinsics. Originally I assumed that this was just a limitation of the function, but I then realized that the docs explicitly state that you're able to provide the name of 'any attribute (or intrinsic) to read.'

For context, let's say I've got a polygonal box and a NURBs curve, which both have unique values for their typename. 

image.png.3f7ba1d618d07b398bf8398f89a6f228.png

If I try and access those values in a wrangle, I just get an empty array. 

image.png.b68930e667caed93b317ee5ad1f3a101.png

I've tried setting the attribute class to 'primintrinsic' instead of 'prim', I've tried removing the 'intrinsic:' prefix from the attribute name, and any number of other gotchas that come to mind. I get the same results when trying to use nuniqueval() and uniqueval() as well. It isn't the end of the world since there are ways to do something similar in python, but if anyone's got some secret sauce to get these VEX  functions in particular to play nicely with intrinsics, I'd appreciate the help.

 

Thanks in advance.

Link to comment
Share on other sites

I don't know why it doesnt work but you could just write the intrinsic to a string/int attribute before and then use the uniquevals function after. That's probably still more convenient and faster than using python.

Also typename is a string, so declaring your foo array as an int would, if the function would work with intrinsics, result in an array with a bunch of -1s I think.

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