mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
Merge pull request #213 from BigRoy/PLN-205
Exclude parent hierarchy by default for pointcaches
This commit is contained in:
commit
5df5c59609
7 changed files with 35 additions and 12 deletions
|
|
@ -29,3 +29,6 @@ class CreateAnimation(avalon.maya.Creator):
|
||||||
# Include only nodes that are visible at least once during the
|
# Include only nodes that are visible at least once during the
|
||||||
# frame range.
|
# frame range.
|
||||||
self.data["visibleOnly"] = False
|
self.data["visibleOnly"] = False
|
||||||
|
|
||||||
|
# Include the groups above the out_SET content
|
||||||
|
self.data["includeParentHierarchy"] = False # Include parent groups
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
from collections import OrderedDict
|
|
||||||
|
|
||||||
import avalon.maya
|
import avalon.maya
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -14,8 +12,12 @@ class CreateModel(avalon.maya.Creator):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(CreateModel, self).__init__(*args, **kwargs)
|
super(CreateModel, self).__init__(*args, **kwargs)
|
||||||
|
|
||||||
data = {"writeColorSets": False, # Vertex colors with the geometry.
|
# Vertex colors with the geometry
|
||||||
"attr": "", # Add options for custom attributes
|
self.data["writeColorSets"] = False
|
||||||
"attrPrefix": ""}
|
|
||||||
|
|
||||||
self.data.update(data)
|
# Include attributes by attribute name or prefix
|
||||||
|
self.data["attr"] = ""
|
||||||
|
self.data["attrPrefix"] = ""
|
||||||
|
|
||||||
|
# Whether to include parent hierarchy of nodes in the instance
|
||||||
|
self.data["includeParentHierarchy"] = False
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ class CreatePointCache(avalon.maya.Creator):
|
||||||
self.data["writeColorSets"] = False # Vertex colors with the geometry.
|
self.data["writeColorSets"] = False # Vertex colors with the geometry.
|
||||||
self.data["renderableOnly"] = False # Only renderable visible shapes
|
self.data["renderableOnly"] = False # Only renderable visible shapes
|
||||||
self.data["visibleOnly"] = False # only nodes that are visible
|
self.data["visibleOnly"] = False # only nodes that are visible
|
||||||
|
self.data["includeParentHierarchy"] = False # Include parent groups
|
||||||
|
|
||||||
# Add options for custom attributes
|
# Add options for custom attributes
|
||||||
self.data["attr"] = ""
|
self.data["attr"] = ""
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,11 @@ class CollectInstances(pyblish.api.ContextPlugin):
|
||||||
fullPath=True) or []
|
fullPath=True) or []
|
||||||
children = cmds.ls(children, noIntermediate=True, long=True)
|
children = cmds.ls(children, noIntermediate=True, long=True)
|
||||||
|
|
||||||
parents = self.get_all_parents(members)
|
parents = []
|
||||||
|
if data.get("includeParentHierarchy", True):
|
||||||
|
# If `includeParentHierarchy` then include the parents
|
||||||
|
# so they will also be picked up in the instance by validators
|
||||||
|
parents = self.get_all_parents(members)
|
||||||
members_hierarchy = list(set(members + children + parents))
|
members_hierarchy = list(set(members + children + parents))
|
||||||
|
|
||||||
# Create the instance
|
# Create the instance
|
||||||
|
|
|
||||||
|
|
@ -27,12 +27,12 @@ class ExtractColorbleedAnimation(colorbleed.api.Extractor):
|
||||||
raise RuntimeError("Couldn't find exactly one out_SET: "
|
raise RuntimeError("Couldn't find exactly one out_SET: "
|
||||||
"{0}".format(out_sets))
|
"{0}".format(out_sets))
|
||||||
out_set = out_sets[0]
|
out_set = out_sets[0]
|
||||||
nodes = cmds.sets(out_set, query=True)
|
roots = cmds.sets(out_set, query=True)
|
||||||
|
|
||||||
# Include all descendants
|
# Include all descendants
|
||||||
nodes += cmds.listRelatives(nodes,
|
nodes = roots + cmds.listRelatives(roots,
|
||||||
allDescendents=True,
|
allDescendents=True,
|
||||||
fullPath=True) or []
|
fullPath=True) or []
|
||||||
|
|
||||||
# Collect the start and end including handles
|
# Collect the start and end including handles
|
||||||
start = instance.data["startFrame"]
|
start = instance.data["startFrame"]
|
||||||
|
|
@ -58,6 +58,12 @@ class ExtractColorbleedAnimation(colorbleed.api.Extractor):
|
||||||
"selection": True
|
"selection": True
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if not instance.data.get("includeParentHierarchy", True):
|
||||||
|
# Set the root nodes if we don't want to include parents
|
||||||
|
# The roots are to be considered the ones that are the actual
|
||||||
|
# direct members of the set
|
||||||
|
options["root"] = roots
|
||||||
|
|
||||||
if int(cmds.about(version=True)) >= 2017:
|
if int(cmds.about(version=True)) >= 2017:
|
||||||
# Since Maya 2017 alembic supports multiple uv sets - write them.
|
# Since Maya 2017 alembic supports multiple uv sets - write them.
|
||||||
options["writeUVSets"] = True
|
options["writeUVSets"] = True
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,12 @@ class ExtractColorbleedAlembic(colorbleed.api.Extractor):
|
||||||
"selection": True
|
"selection": True
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if not instance.data.get("includeParentHierarchy", True):
|
||||||
|
# Set the root nodes if we don't want to include parents
|
||||||
|
# The roots are to be considered the ones that are the actual
|
||||||
|
# direct members of the set
|
||||||
|
options["root"] = instance.data.get("setMembers")
|
||||||
|
|
||||||
if int(cmds.about(version=True)) >= 2017:
|
if int(cmds.about(version=True)) >= 2017:
|
||||||
# Since Maya 2017 alembic supports multiple uv sets - write them.
|
# Since Maya 2017 alembic supports multiple uv sets - write them.
|
||||||
options["writeUVSets"] = True
|
options["writeUVSets"] = True
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,8 @@ class ValidateModelContent(pyblish.api.InstancePlugin):
|
||||||
cls.log.error("Must have exactly one top group")
|
cls.log.error("Must have exactly one top group")
|
||||||
if len(assemblies) == 0:
|
if len(assemblies) == 0:
|
||||||
cls.log.warning("No top group found. "
|
cls.log.warning("No top group found. "
|
||||||
"(Are there objects in the instance?)")
|
"(Are there objects in the instance?"
|
||||||
|
" Or is it parented in another group?)")
|
||||||
return assemblies or True
|
return assemblies or True
|
||||||
|
|
||||||
def _is_visible(node):
|
def _is_visible(node):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue