CinnamonMetal Posted July 28, 2019 Share Posted July 28, 2019 I know my code is not right, I'm iterating using a forEach SOP each piece, then within a point wrangler is the code below; I want to iterate over each piece and if the total number of points of each piece is less then a value export it as both a class and arbitrary attribute. Instead I get an attribute which is empty ? I've tried replacing detLoop with a numeric value but that doesn't work either. int detLoop = detail(0,"iteration",0); for(int i=detLoop;i<@numpt;i++){ i@LargeChunk; i@class; } Quote Link to comment Share on other sites More sharing options...
DonRomano Posted July 28, 2019 Share Posted July 28, 2019 Hey, sometimes there is an issue when you try to get a detail attribute from the metadata import node with vex. Try to connect it to the second input of your wrangle, and in the detail just correct it to int detloop = detail(1,"iteration",0); Cheers, Quote Link to comment Share on other sites More sharing options...
CinnamonMetal Posted July 28, 2019 Author Share Posted July 28, 2019 7 hours ago, DonRomano said: Hey, sometimes there is an issue when you try to get a detail attribute from the metadata import node with vex. Try to connect it to the second input of your wrangle, and in the detail just correct it to int detloop = detail(1,"iteration",0); Cheers, I'm still not getting any value for the attributes which I'm trying to write too, especially the attribute @LargeChunk. I did some modification to the code; int detLoop = detail(1,"iteration",0); for(int i=detLoop;i<@numpt;i++){ if(i>1400 && i<2000){ i@LargeChunk; i@class; } } Quote Link to comment Share on other sites More sharing options...
vicvvsh Posted July 28, 2019 Share Posted July 28, 2019 If you want to get value of attribute you have to assign some value to this attribute. Right now you just declare attributes and they equal to 0. And second, if a chunk has less then 1400 points then if condition will never happen. If you'd provide a simple scene, i think it would be more easily to help. 1 Quote Link to comment Share on other sites More sharing options...
CinnamonMetal Posted July 28, 2019 Author Share Posted July 28, 2019 @vicvvsh I see what you mean, I'm now getting a value. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.