mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
use new settings structure in ShotMetadataSolver
This commit is contained in:
parent
197d3d6786
commit
0669ef30c8
1 changed files with 13 additions and 11 deletions
|
|
@ -92,7 +92,9 @@ class ShotMetadataSolver:
|
|||
|
||||
search_text = parent_name + clip_name
|
||||
|
||||
for token_key, pattern in self.clip_name_tokenizer.items():
|
||||
for clip_name_item in self.clip_name_tokenizer:
|
||||
token_key = clip_name_item["name"]
|
||||
pattern = clip_name_item["regex"]
|
||||
p = re.compile(pattern)
|
||||
match = p.findall(search_text)
|
||||
if not match:
|
||||
|
|
@ -143,11 +145,11 @@ class ShotMetadataSolver:
|
|||
))
|
||||
|
||||
_parent_tokens_type = {
|
||||
parent_token["name"]: parent_token["type"]
|
||||
parent_token["name"]: parent_token["parent_type"]
|
||||
for parent_token in hierarchy_parents
|
||||
}
|
||||
for _index, _parent in enumerate(
|
||||
shot_hierarchy["parents_path"].split("/")
|
||||
shot_hierarchy["parents_path"].split("/")
|
||||
):
|
||||
# format parent token with value which is formatted
|
||||
try:
|
||||
|
|
@ -268,22 +270,22 @@ class ShotMetadataSolver:
|
|||
"""
|
||||
tasks_to_add = {}
|
||||
|
||||
project_tasks = project_doc["config"]["tasks"]
|
||||
for task_name, task_data in self.shot_add_tasks.items():
|
||||
_task_data = deepcopy(task_data)
|
||||
project_task_types = project_doc["config"]["tasks"]
|
||||
for task_item in self.shot_add_tasks:
|
||||
task_name = task_item["name"]
|
||||
task_type = task_item["task_type"]
|
||||
|
||||
# check if task type in project task types
|
||||
if _task_data["type"] in project_tasks.keys():
|
||||
tasks_to_add[task_name] = _task_data
|
||||
else:
|
||||
if task_type not in project_task_types.keys():
|
||||
raise KeyError(
|
||||
"Missing task type `{}` for `{}` is not"
|
||||
" existing in `{}``".format(
|
||||
_task_data["type"],
|
||||
task_type,
|
||||
task_name,
|
||||
list(project_tasks.keys())
|
||||
list(project_task_types.keys())
|
||||
)
|
||||
)
|
||||
tasks_to_add[task_name] = {"type": task_type}
|
||||
|
||||
return tasks_to_add
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue