mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
move custom naming logic outside the for loop since it is not dynamic
This commit is contained in:
parent
92a35bc7d2
commit
6ecaa7dd05
1 changed files with 25 additions and 25 deletions
|
|
@ -148,36 +148,36 @@ class ReferenceLoader(Loader):
|
|||
custom_naming = settings['maya']['load']['reference_loader']['naming']
|
||||
loaded_containers = []
|
||||
|
||||
if ':' not in custom_naming:
|
||||
raise ValueError(
|
||||
"Wrong format for namespace, missing ':' separator"
|
||||
)
|
||||
elif custom_naming.strip()[0] == ':':
|
||||
raise ValueError(
|
||||
"Wrong format for namespace, missing content before ':' "
|
||||
"separator"
|
||||
)
|
||||
elif custom_naming.strip()[-1] == ':':
|
||||
raise ValueError(
|
||||
"Wrong format for namespace, missing content after ':' "
|
||||
"separator"
|
||||
)
|
||||
|
||||
custom_naming = custom_naming.format(
|
||||
asset_name=asset['name'],
|
||||
asset_type=asset['type'],
|
||||
subset=subset['name'],
|
||||
family=(
|
||||
subset['data'].get('family') or
|
||||
subset['data']['families'][0]
|
||||
)
|
||||
)
|
||||
|
||||
count = options.get("count") or 1
|
||||
|
||||
for c in range(0, count):
|
||||
group_name = None
|
||||
|
||||
if ':' not in custom_naming:
|
||||
raise ValueError(
|
||||
"Wrong format for namespace, missing ':' separator"
|
||||
)
|
||||
elif custom_naming.strip()[0] == ':':
|
||||
raise ValueError(
|
||||
"Wrong format for namespace, missing content before ':' "
|
||||
"separator"
|
||||
)
|
||||
elif custom_naming.strip()[-1] == ':':
|
||||
raise ValueError(
|
||||
"Wrong format for namespace, missing content after ':' "
|
||||
"separator"
|
||||
)
|
||||
|
||||
custom_naming = custom_naming.format(
|
||||
asset_name=asset['name'],
|
||||
asset_type=asset['type'],
|
||||
subset=subset['name'],
|
||||
family=(
|
||||
subset['data'].get('family') or
|
||||
subset['data']['families'][0]
|
||||
)
|
||||
)
|
||||
|
||||
namespace = custom_naming.split(':')[0]
|
||||
namespace = lib.unique_namespace(
|
||||
namespace,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue