int primAmt= nprimitives(geoself()); vector currentN = 0; // = prim(0,"PrimN",0); vector uniqueN[]; for(int i =0; i<primAmt;i++){ currentN = prim(0,"PrimN",i); int noN = find(uniqueN,currentN); if(noN<0){ append(uniqueN,currentN); }
I don't see why this shouldn't work, but it doesn't. Can somebody clear things up for me?
The geo spreadsheet shows what I start with, and the console shows the results I get from the script.
Thanks in advance
EDIT:
Ok I found it's due to floating point inconsistencies. I wish there was a simple solution to just round to a certain decimal place with a function. If this is a common problem in Houdini there should be some integrated method to deal with it.
EDIT 2:
I solved the issue by multiplying my values by 1000000, truncating them, and dividing by 1000000 again.