Jump to content

Store value of points in attribute


CinnamonMetal

Recommended Posts

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;
    }

 

Link to comment
Share on other sites

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,

Link to comment
Share on other sites

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;
        }
    }

 

Link to comment
Share on other sites

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.

  • Like 1
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...