# 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!