Skip to content

Instantly share code, notes, and snippets.

@scott-wilson
Created April 14, 2019 04:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scott-wilson/aeec017e55602fd6d64decc8fa81d422 to your computer and use it in GitHub Desktop.
Save scott-wilson/aeec017e55602fd6d64decc8fa81d422 to your computer and use it in GitHub Desktop.
import random
from maya import cmds
def get_new_name(prefix, suffixes):
names = []
rand_value = random.randrange(10000, 20000)
for suffix in suffixes:
names.append("{}_{}_{}".format(prefix, rand_value, suffix))
return names
result1 = get_new_name("FFS", ["high", "low"])
result2 = get_new_name("FFS", ["high", "low"])
result3 = get_new_name("abc", ["high", "mid", "low"])
print result1
print result2
print result3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment