Jump to content
Sign in to follow this  
HundredsofBears

Working with primintrinsics in VEX

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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×