mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
updating the loader so that the version will work in scene inventory
This commit is contained in:
parent
5895b4f376
commit
b2be8462c4
2 changed files with 30 additions and 2 deletions
|
|
@ -47,8 +47,7 @@ class MaxSceneLoader(load.LoaderPlugin):
|
|||
|
||||
path = get_representation_path(representation)
|
||||
node = rt.getNodeByName(container["instance_node"])
|
||||
|
||||
max_objects = self.get_container_children(node)
|
||||
max_objects = node.Children
|
||||
for max_object in max_objects:
|
||||
max_object.source = path
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
import pyblish.api
|
||||
from openpype.pipeline import PublishValidationError
|
||||
from pymxs import runtime as rt
|
||||
|
||||
|
||||
class ValidateMaxContents(pyblish.api.InstancePlugin):
|
||||
"""Validates Max contents.
|
||||
|
||||
Check if MaxScene container includes any contents underneath.
|
||||
"""
|
||||
|
||||
order = pyblish.api.ValidatorOrder
|
||||
families = ["maxScene"]
|
||||
hosts = ["max"]
|
||||
label = "Max Scene Contents"
|
||||
|
||||
def process(self, instance):
|
||||
invalid = self.get_invalid(instance)
|
||||
if invalid:
|
||||
raise PublishValidationError("No content found in the container")
|
||||
|
||||
def get_invalid(self, instance):
|
||||
invalid = []
|
||||
container = rt.getNodeByName(instance.data["instance_node"])
|
||||
if not container.Children:
|
||||
invalid.append(container)
|
||||
|
||||
return invalid
|
||||
Loading…
Add table
Add a link
Reference in a new issue