3x repeat the random integer row - question

Hello this is the simplified case. In original I need to repeat the random instance index three times in a row (max is domain size -1). So far no succes - anybody can help please? THANKS!

hum, to get a consistent random value you need to plug a custom ID in the random node , in the ID socket… and that ID need to be similar for each groups of tree points…
basically the problem is more about how to create that custom ID, probably something that would use a modulo 3 function on point’s index, and a accumulate field node… I don’t have blender currently so I can’t test that for you sadly…

Good luck !

thanks Sozap, this is just simplification of the more complex tree using the IDs.I think its about index switch and modulo 3 equal 0, 1 and 2 to switch every 1st, 2nd and 3rd integer. Just lost so far to get the previous values to the switch positions.

Instead of Modulo, you should use Divide…

when using the modulo, the sequence will always be:
0 > 0
1 > 1
2 > 2
3 > 0
4 > 1
…

But with a Divide (note that the ID input truncates/floors the float input):
0 > 0 (0.0)
1 > 0 (0.33)
2 > 0 (0.66)
3 > 1 (1.0)
4 > 1 (1.33)
…

3 Likes

Thanks Secrop, the original case looks like this, random value is given, can be sequence or manual custom index row, I need to alter the integer after.

That’s highly convoluted… Why calculate a random number and then discard the 2/3 of them later?
You can overwrite the value with the value of some other index… but it’s not efficient at all!

1 Like

2/3 of them are just placeholders for named attribute gap left gap right, later is accumulate filed used where I need these values in a row. 01GL-01instanceX-01GR-02GL-02instanceX-02GR… The reason for 3x repeat is it works far better for sampling curves in arc parts than just accumulating instX+GL+GR as single values… not sure but hope it gives sense.

Can’t you calculate GL and GR in the same moment you do for instX? Or just insert the GL and GR later, when you have values for them?
I mean… whatever works, right!? just find it odd.

There is maybe far simpler solution, this is just only one I was able to find so far. If there is a way to accumulate 3 values from single instance in all instance row on index spline domain…
You can check my more complex testing file:
z-pack-curve-02.blend (651.4 KB)

Uff… it’s hard to see what’s going on there…
Where are the random values? Where do you want to repeat them?

Forget it, you helped me a lot - big thanks Secrop!
added your first reply solution to the arch feeder node group…
z-pack-curve-02.blend (453.8 KB)

Ahh! inside the arch feeder…!!
Anyway… does it works now as you want?

(I can’t really see the difference, but I’m missing the whole context)

Just the custom feeder mode needs to be tweaked. I need to stop now, will get to this later - thanks.