mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 00:44:52 +01:00
raise PublishXmlValidationError in validate workfile metadata
This commit is contained in:
parent
df9e30eb7f
commit
4c11ae83ee
2 changed files with 26 additions and 2 deletions
|
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<root>
|
||||
<error id="main">
|
||||
<title>Missing metadata</title>
|
||||
<description>## Your scene miss context metadata
|
||||
|
||||
Your scene does not contain metadata about {missing_metadata}.
|
||||
|
||||
### How to repair?
|
||||
|
||||
Resave the scene using Workfiles tool or hit the "Repair" button on the right.
|
||||
</description>
|
||||
<detail>
|
||||
### How this could happend?
|
||||
|
||||
You're using scene file that was not created using Workfiles tool.
|
||||
</detail>
|
||||
</error>
|
||||
</root>
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
import pyblish.api
|
||||
from avalon.tvpaint import save_file
|
||||
from openpype.pipeline import PublishXmlValidationError
|
||||
|
||||
|
||||
class ValidateWorkfileMetadataRepair(pyblish.api.Action):
|
||||
|
|
@ -42,8 +43,12 @@ class ValidateWorkfileMetadata(pyblish.api.ContextPlugin):
|
|||
missing_keys.append(key)
|
||||
|
||||
if missing_keys:
|
||||
raise AssertionError(
|
||||
raise PublishXmlValidationError(
|
||||
self,
|
||||
"Current workfile is missing metadata about {}.".format(
|
||||
", ".join(missing_keys)
|
||||
)
|
||||
),
|
||||
formatting_data={
|
||||
"missing_metadata": ", ".join(missing_keys)
|
||||
}
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue