removed pointcach family from plugin, create new entry in instance.data for out hierarchy

This commit is contained in:
aardschok 2017-11-01 10:40:26 +01:00
parent efc8cef45c
commit 2b91896dae

View file

@ -3,12 +3,12 @@ import pyblish.api
import maya.cmds as cmds
class CollectLook(pyblish.api.InstancePlugin):
class CollectAnimationOutputGeometry(pyblish.api.InstancePlugin):
"""Collect out hierarchy data for instance.
Collect all hierarchy nodes which reside in the out_SET of the animation
instance or poitncache instance. This is to unify the logic of retrieving
that specifc data. This eliminates the need to write two separate pieces
instance or point cache instance. This is to unify the logic of retrieving
that specific data. This eliminates the need to write two separate pieces
of logic to fetch all hierarchy nodes.
Results in a list of nodes from the content of the instances
@ -16,8 +16,8 @@ class CollectLook(pyblish.api.InstancePlugin):
"""
order = pyblish.api.CollectorOrder + 0.4
families = ["colorbleed.animation", "colorbleed.pointcache"]
label = "Collect Animation"
families = ["colorbleed.animation"]
label = "Collect Animation Output Geometry"
hosts = ["maya"]
ignore_type = ["constraints"]
@ -26,15 +26,12 @@ class CollectLook(pyblish.api.InstancePlugin):
"""Collect the hierarchy nodes"""
family = instance.data["family"]
if family == "colorbleed.animation":
out_set = next((i for i in instance.data["setMembers"] if
i.endswith("out_SET")), None)
out_set = next((i for i in instance.data["setMembers"] if
i.endswith("out_SET")), None)
assert out_set, ("Expecting out_SET for instance of family"
"'%s'" % family)
members = cmds.ls(cmds.sets(out_set, query=True), long=True)
else:
members = cmds.ls(instance, long=True)
assert out_set, ("Expecting out_SET for instance of family"
" '%s'" % family)
members = cmds.ls(cmds.sets(out_set, query=True), long=True)
# Get all the relatives of the members
descendants = cmds.listRelatives(members,
@ -51,7 +48,6 @@ class CollectLook(pyblish.api.InstancePlugin):
ignore = set(ignore)
hierarchy = [node for node in hierarchy if node not in ignore]
return hierarchy
# Store data in the instance for the validator
instance.data["pointcache_data"] = hierarchy
instance.data["out_hierarchy"] = hierarchy