Asset Pipeline v2 #145
@ -26,9 +26,11 @@ from .utils import get_storage_of_id
|
||||
|
||||
DELIMITER = "."
|
||||
|
||||
def get_asset_basename(name):
|
||||
return DELIMITER.join(name.split(DELIMITER)[:-1])
|
||||
|
||||
def remove_suffix_from_hierarchy(
|
||||
collection: bpy.types.Collection, delimiter: str = DELIMITER
|
||||
collection: bpy.types.Collection
|
||||
):
|
||||
"""Removes the suffix after a set delimiter from all datablocks
|
||||
referenced by a collection, itself included"""
|
||||
@ -41,7 +43,7 @@ def remove_suffix_from_hierarchy(
|
||||
# Don't rename linked datablocks.
|
||||
continue
|
||||
try:
|
||||
db.name = delimiter.join(db.name.split(delimiter)[:-1])
|
||||
db.name = get_asset_basename(db.name)
|
||||
except:
|
||||
pass
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user