mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
add top node validator
This commit is contained in:
parent
8f77e92d6f
commit
76bc7799f1
3 changed files with 53 additions and 2 deletions
|
|
@ -22,8 +22,9 @@ class ExtractUnrealStaticMesh(openpype.api.Extractor):
|
|||
families = ["staticMesh"]
|
||||
|
||||
def process(self, instance):
|
||||
geo = instance.data.get("geometryMembers", [])
|
||||
members = geo + instance.data.get("collisionMembers", [])
|
||||
members = instance.data.get("geometryMembers", [])
|
||||
if instance.data.get("collisionMembers"):
|
||||
members = members + instance.data.get("collisionMembers")
|
||||
|
||||
fbx_exporter = fbx.FBXExtractor(log=self.log)
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<root>
|
||||
<error id="main">
|
||||
<title>Skeletal Mesh Top Node</title>
|
||||
<description>## Skeletal meshes needs common root
|
||||
|
||||
Skeletal meshes and their joints must be under one common root.
|
||||
|
||||
### How to repair?
|
||||
|
||||
Make sure all geometry and joints resides under same root.
|
||||
</description>
|
||||
</error>
|
||||
</root>
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
import pyblish.api
|
||||
import openpype.api
|
||||
from openpype.pipeline import PublishXmlValidationError
|
||||
|
||||
from maya import cmds
|
||||
|
||||
|
||||
class ValidateSkeletalMeshHierarchy(pyblish.api.InstancePlugin):
|
||||
"""Adheres to the content of 'model' family
|
||||
|
||||
- Must have one top group. (configurable)
|
||||
- Must only contain: transforms, meshes and groups
|
||||
|
||||
"""
|
||||
|
||||
order = openpype.api.ValidateContentsOrder
|
||||
hosts = ["maya"]
|
||||
families = ["skeletalMesh"]
|
||||
label = "Skeletal Mesh Top Node"
|
||||
|
||||
def process(self, instance):
|
||||
geo = instance.data.get("geometry")
|
||||
joints = instance.data.get("joints")
|
||||
joints_parents = cmds.ls(joints, long=True)[0].split("|")[1:-1]
|
||||
geo_parents = cmds.ls(geo, long=True)[0].split("|")[1:-1]
|
||||
|
||||
self.log.info(joints_parents)
|
||||
self.log.info(geo_parents)
|
||||
self.log.info(set(joints_parents + geo_parents))
|
||||
|
||||
if len(set(joints_parents + geo_parents)) != 1:
|
||||
raise PublishXmlValidationError(
|
||||
self,
|
||||
"Multiple roots on geometry or joints."
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue