JeremyR
I want to lay out some instances row by row so object one occupies vert IDs 1-20, 41-60, 81-100 etc and object 2 occupies the other verts in between.
The obvious logic would be to use else if statements but if there are hundreds of rows this could take some time to write.

Is there a better way to do this?
Quote 0 0
pshipkov
If the point order fallows some pattern then we should be able to come up with math formula that produces the desired results.
Otherwise we can try to transfer attributes from ordered geometry onto the "messy" one before doing the math formula thing.
Quote 0 0
JeremyR
The point order follows a pattern - default polyplane.
Attribute transfer is something I haven't done before, though I dont need that right now.
Quote 0 0
Bruce Lee

for ($i=1;$i<21;$i++){
for($n=0;$n<100;$n++){

if(id == $i+40*n)
return 1;

}

}

You need to loop, I do not know it is wrong, hope can give you inspiration

Quote 0 0
JeremyR
Thanks! Ill try it out and get back to you.
Quote 0 0
rolfcoppter
Hey, I also have a different way of doing this using a mod function in mel. I ran into this problem a while ago and I found this way a bit easier to understand and use.

The mod function (%) basically just counts up on the vert ids from 0 then when it hits vert ID 40 it goes back to 0. Mathematically it just returns the remainder of the division of two numbers. If $ID is 1 then it's 1/40 = 0 with a remainder of 1 so it returns 1, and if the $ID is 41 then it also returns 1 because 41/40 = 1 with a remainder of 1. 

float $modID = $ID % 40;
if ($modID <=19){
    $instanceID = 0;
}
else{
   $instanceID = 1;
}

I normally use this in the Point Node and then pipe the out WeightPP into the copier node index array. But there are many ways to do it as there is with anything.


hope this helped and sorry for the late reply to this old thread.

thanks,
Jordan
Quote 0 0

Add a Website Forum to your website.