Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2068 from davidlatwe/feature/PYPE-1395_Validate-s…
Browse files Browse the repository at this point in the history
…etdress-top-group
  • Loading branch information
mkolar authored Sep 24, 2021
2 parents bbc546a + 5b4991f commit 82fcb58
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
5 changes: 5 additions & 0 deletions openpype/hosts/maya/plugins/create/create_setdress.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,8 @@ class CreateSetDress(plugin.Creator):
family = "setdress"
icon = "cubes"
defaults = ["Main", "Anim"]

def __init__(self, *args, **kwargs):
super(CreateSetDress, self).__init__(*args, **kwargs)

self.data["exactSetMembersOnly"] = True
25 changes: 25 additions & 0 deletions openpype/hosts/maya/plugins/publish/validate_setdress_root.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

import pyblish.api
import openpype.api


class ValidateSetdressRoot(pyblish.api.InstancePlugin):
"""
"""

order = openpype.api.ValidateContentsOrder
label = "SetDress Root"
hosts = ["maya"]
families = ["setdress"]

def process(self, instance):
from maya import cmds

if instance.data.get("exactSetMembersOnly"):
return

set_member = instance.data["setMembers"]
root = cmds.ls(set_member, assemblies=True, long=True)

if not root or root[0] not in set_member:
raise Exception("Setdress top root node is not being published.")

0 comments on commit 82fcb58

Please sign in to comment.