Notifications
Clear all
[Closed] Random strings
Mar 27, 2021 5:35 am
Hi,
Im trying to do create a function that replace material from a defined selection inside a material library
similar to this
red = random “grey” “black” “blue”
The random function works great when using integers m[i] = matLib[index] -> matlib[random 1 10] but when replacing the integers with strings it doesnt work. Is there a smart way to randomize the strings?
index = "plastic.grey"
for m in material do(
for i = 1 to m.numsubs do(
m[i] = matLib[index]
)
)
2 Replies
Mar 27, 2021 5:35 am
like this?
random_mtl = mtl_lib[ strings_array[ random 1 strings_array.Count ] ]