In the rigify add-on, when you generate a rig, it gives the rig a random string as it’s ID. How is this generated? I have been trying to do some things and they would need something similar to this. I have been tearing apart the rigify scripts, but I can’t find it anywhere.
import random, string
#charset=string.printable
charset=string.ascii_letters+string.digits
def rand_str(length=8):
max=len(charset)
s=""
for i in range(length):
s+=str(charset[random.randint(0,max)])
return s
print(rand_str())
Thanks, rarebit!!
For some reason, the part from the end of utils.py is not working properly for me (it has some charactars that I did not specify), but yours works perfect! thanks both of you!