Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

convert_to_usd_friendly_node_name - fix #188

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Source/_gltf2usd/gltf2usdUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ def convert_to_usd_friendly_node_name(name):
Returns:
str -- USD friendly name
"""
name = re.sub(r'\.|\b \b|-\b|:|\(|\)|[ \t]|-|\[|\]|\{|\}|#', '_', name) # replace '.',' ','-',':','/','\','(',')', '{', '}', '#' and ':' with '_'
name = re.sub(r'^([\d]+)',r'm\1',name)
name = re.sub(r'[^\w]', '_', name) # replace any non-word characters with '_'
name = re.sub(r'^([\d]+)',r'name_\1',name) #prepend with "name_" if string starts with digit
name = re.sub('//', '/', name)
if name.isdigit(): #if only digits, prepend a string
name = 'name_{}'.format(name)
Expand Down