mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-27 14:22:37 +01:00
Add nice new report
This commit is contained in:
parent
d4a9e1cd3e
commit
aae89c42e4
2 changed files with 41 additions and 3 deletions
|
|
@ -0,0 +1,29 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<root>
|
||||
<error id="main">
|
||||
<title>Missing node ids</title>
|
||||
<description>## Nodes found with missing `cbId`
|
||||
|
||||
Nodes were detected in your scene which are missing required `cbId`
|
||||
attributes for identification further in the pipeline.
|
||||
|
||||
### How to repair?
|
||||
|
||||
The node ids are auto-generated on scene save, and thus the easiest fix is to
|
||||
save your scene again.
|
||||
|
||||
After that restart publishing with Reload button.
|
||||
</description>
|
||||
<detail>
|
||||
### Invalid nodes
|
||||
|
||||
{nodes}
|
||||
|
||||
|
||||
### How could this happen?
|
||||
|
||||
This often happens if you've generated new nodes but haven't saved your scene
|
||||
after creating the new nodes.
|
||||
</detail>
|
||||
</error>
|
||||
</root>
|
||||
|
|
@ -1,6 +1,9 @@
|
|||
import pyblish.api
|
||||
|
||||
from openpype.pipeline.publish import ValidatePipelineOrder
|
||||
from openpype.pipeline.publish import (
|
||||
ValidatePipelineOrder,
|
||||
PublishXmlValidationError
|
||||
)
|
||||
import openpype.hosts.maya.api.action
|
||||
from openpype.hosts.maya.api import lib
|
||||
|
||||
|
|
@ -34,8 +37,14 @@ class ValidateNodeIDs(pyblish.api.InstancePlugin):
|
|||
# Ensure all nodes have a cbId
|
||||
invalid = self.get_invalid(instance)
|
||||
if invalid:
|
||||
raise RuntimeError("Nodes found without "
|
||||
"IDs: {0}".format(invalid))
|
||||
names = "\n".join(
|
||||
"- {}".format(node) for node in invalid
|
||||
)
|
||||
raise PublishXmlValidationError(
|
||||
plugin=self,
|
||||
message="Nodes found without IDs: {}".format(invalid),
|
||||
formatting_data={"nodes": names}
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def get_invalid(cls, instance):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue