mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 00:44:52 +01:00
Improve speed of logging for when its validating a node with many prims.
This commit is contained in:
parent
cd756ba215
commit
d9c67a0bd5
1 changed files with 14 additions and 4 deletions
|
|
@ -2,6 +2,7 @@
|
|||
import pyblish.api
|
||||
import hou
|
||||
from openpype.pipeline import PublishValidationError
|
||||
import clique
|
||||
|
||||
|
||||
class ValidateVDBOutputNode(pyblish.api.InstancePlugin):
|
||||
|
|
@ -56,12 +57,21 @@ class ValidateVDBOutputNode(pyblish.api.InstancePlugin):
|
|||
nr_of_prims = len(prims)
|
||||
|
||||
# All primitives must be hou.VDB
|
||||
invalid_prim = False
|
||||
invalid_prims = []
|
||||
for prim in prims:
|
||||
if not isinstance(prim, hou.VDB):
|
||||
cls.log.error("Found non-VDB primitive: %s" % prim)
|
||||
invalid_prim = True
|
||||
if invalid_prim:
|
||||
invalid_prims.append(prim)
|
||||
if invalid_prims:
|
||||
# Log all invalid primitives in a short readable way, like 0-5
|
||||
collections, remainder = clique.assemble(
|
||||
str(prim.number()) for prim in invalid_prims
|
||||
)
|
||||
collection = collections[0]
|
||||
cls.log.error("Found non-VDB primitives for '{}', "
|
||||
"primitive indices: {}".format(
|
||||
node.path(),
|
||||
collection.format("{ranges}")
|
||||
))
|
||||
return [instance]
|
||||
|
||||
nr_of_points = len(geometry.points())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue