// IntSplit.osl, by Jayden Morris shader IntSplit [[ string help = "Splits input integer into 3 digits", string label= "IntSplit", string category = "Values" ]] ( int Input = 0 [[ string label = "Input" ]], output int I0 = 0, output int I1 = 0, output int I2 = 0, ) { int i = Input; int d[3] = {0,0,0}; int a = 0; while (i > 0) { int val = i % 10; d[a] = val; i = i / 10; a++; } I0 = d[0]; I1 = d[1]; I2 = d[2]; }