mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Merged in fature/PYPE-685_better_anatomy (pull request #460)
Fature/PYPE-685 better anatomy Approved-by: Milan Kolar <milan@orbi.tools>
This commit is contained in:
commit
64d4b60f17
3 changed files with 31 additions and 31 deletions
|
|
@ -312,42 +312,32 @@ class Delivery(BaseAction):
|
|||
anatomy_data = copy.deepcopy(repre["context"])
|
||||
anatomy_data["root"] = location_path
|
||||
|
||||
anatomy_filled = anatomy.format(anatomy_data)
|
||||
test_path = (
|
||||
anatomy_filled
|
||||
.get("delivery", {})
|
||||
.get(anatomy_name)
|
||||
)
|
||||
anatomy_filled = anatomy.format_all(anatomy_data)
|
||||
test_path = anatomy_filled["delivery"][anatomy_name]
|
||||
|
||||
if not test_path:
|
||||
if not test_path.solved:
|
||||
msg = (
|
||||
"Missing keys in Representation's context"
|
||||
" for anatomy template \"{}\"."
|
||||
).format(anatomy_name)
|
||||
|
||||
all_anatomies = anatomy.format_all(anatomy_data)
|
||||
result = None
|
||||
for anatomies in all_anatomies.values():
|
||||
for key, temp in anatomies.get("delivery", {}).items():
|
||||
if key != anatomy_name:
|
||||
continue
|
||||
if test_path.missing_keys:
|
||||
keys = ", ".join(test_path.missing_keys)
|
||||
sub_msg = (
|
||||
"Representation: {}<br>- Missing keys: \"{}\"<br>"
|
||||
).format(str(repre["_id"]), keys)
|
||||
|
||||
result = temp
|
||||
break
|
||||
if test_path.invalid_types:
|
||||
items = []
|
||||
for key, value in test_path.invalid_types.items():
|
||||
items.append("\"{}\" {}".format(key, str(value)))
|
||||
|
||||
# TODO log error! - missing keys in anatomy
|
||||
if result:
|
||||
missing_keys = [
|
||||
key[1] for key in string.Formatter().parse(result)
|
||||
if key[1] is not None
|
||||
]
|
||||
else:
|
||||
missing_keys = ["unknown"]
|
||||
keys = ", ".join(items)
|
||||
sub_msg = (
|
||||
"Representation: {}<br>"
|
||||
"- Invalid value DataType: \"{}\"<br>"
|
||||
).format(str(repre["_id"]), keys)
|
||||
|
||||
keys = ", ".join(missing_keys)
|
||||
sub_msg = (
|
||||
"Representation: {}<br>- Missing keys: \"{}\"<br>"
|
||||
).format(str(repre["_id"]), keys)
|
||||
self.report_items[msg].append(sub_msg)
|
||||
self.log.warning(
|
||||
"{} Representation: \"{}\" Filled: <{}>".format(
|
||||
|
|
|
|||
|
|
@ -207,7 +207,12 @@ class UserAssigmentEvent(BaseEvent):
|
|||
# formatting work dir is easiest part as we can use whole path
|
||||
work_dir = anatomy.format(data)['avalon']['work']
|
||||
# we also need publish but not whole
|
||||
publish = anatomy.format_all(data)['partial']['avalon']['publish']
|
||||
filled_all = anatomy.format_all(data)
|
||||
if "partial" not in filled_all:
|
||||
publish = filled_all['avalon']['publish']
|
||||
else:
|
||||
# Backwards compatibility
|
||||
publish = filled_all["partial"]['avalon']['publish']
|
||||
# now find path to {asset}
|
||||
m = re.search("(^.+?{})".format(data['asset']),
|
||||
publish)
|
||||
|
|
|
|||
|
|
@ -95,9 +95,14 @@ class ExtractBurnin(pype.api.Extractor):
|
|||
# create copy of prep_data for anatomy formatting
|
||||
_prep_data = copy.deepcopy(prep_data)
|
||||
_prep_data["representation"] = repre["name"]
|
||||
_prep_data["anatomy"] = (
|
||||
anatomy.format_all(_prep_data).get("solved") or {}
|
||||
)
|
||||
filled_anatomy = anatomy.format_all(_prep_data)
|
||||
if hasattr(filled_anatomy, "get_solved"):
|
||||
_filled_anatomy = filled_anatomy.get_solved()
|
||||
else:
|
||||
# Backwards compatibility
|
||||
_filled_anatomy = filled_anatomy.get("solved")
|
||||
_prep_data["anatomy"] = _filled_anatomy or {}
|
||||
|
||||
burnin_data = {
|
||||
"input": full_movie_path.replace("\\", "/"),
|
||||
"codec": repre.get("codec", []),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue