remove colorbleed traces

This commit is contained in:
Milan Kolar 2018-11-12 01:06:04 +01:00
parent b582953552
commit c6d34a5c15
13 changed files with 81 additions and 108 deletions

View file

@ -123,3 +123,34 @@ class GpuCacheLoader(api.Loader):
deleteNamespaceContent=True)
except RuntimeError:
pass
class AbcModelLoader(pype.maya.plugin.ReferenceLoader):
"""Specific loader of Alembic for the studio.animation family"""
families = ["model"]
representations = ["abc"]
label = "Reference Model"
order = -10
icon = "code-fork"
color = "orange"
def process_reference(self, context, name, namespace, data):
import maya.cmds as cmds
cmds.loadPlugin("AbcImport.mll", quiet=True)
nodes = cmds.file(self.fname,
namespace=namespace,
sharedReferenceFile=False,
groupReference=True,
groupName="{}:{}".format(namespace, name),
reference=True,
returnNewNodes=True)
self[:] = nodes
return nodes
def switch(self, container, representation):
self.update(container, representation)

View file

@ -43,7 +43,11 @@ class CollectAnimationOutputGeometry(pyblish.api.InstancePlugin):
descendants = cmds.ls(descendants, noIntermediate=True, long=True)
# Add members and descendants together for a complete overview
hierarchy = members + descendants
# hierarchy = members + descendants
hierarchy = members
self.log.info(members)
self.log.info(hierarchy)
# Ignore certain node types (e.g. constraints)
ignore = cmds.ls(hierarchy, type=self.ignore_type, long=True)
@ -53,4 +57,3 @@ class CollectAnimationOutputGeometry(pyblish.api.InstancePlugin):
# Store data in the instance for the validator
instance.data["out_hierarchy"] = hierarchy

View file

@ -7,7 +7,7 @@ import pype.api
from pype.maya.lib import extract_alembic
class ExtractColorbleedAnimation(pype.api.Extractor):
class ExtractAnimation(pype.api.Extractor):
"""Produce an alembic of just point positions and normals.
Positions and normals, uvs, creases are preserved, but nothing more,
@ -29,10 +29,12 @@ class ExtractColorbleedAnimation(pype.api.Extractor):
out_set = out_sets[0]
nodes = cmds.sets(out_set, query=True)
self.log.info('nodes to export: {}'.format(str(nodes)))
# Include all descendants
nodes += cmds.listRelatives(nodes,
allDescendents=True,
fullPath=True) or []
# nodes += cmds.listRelatives(nodes,
# allDescendents=True,
# fullPath=True) or []
# Collect the start and end including handles
start = instance.data["startFrame"]
@ -55,7 +57,8 @@ class ExtractColorbleedAnimation(pype.api.Extractor):
"writeVisibility": True,
"writeCreases": True,
"uvWrite": True,
"selection": True
"selection": False,
"root": nodes
}
if int(cmds.about(version=True)) >= 2017:
@ -63,12 +66,12 @@ class ExtractColorbleedAnimation(pype.api.Extractor):
options["writeUVSets"] = True
with avalon.maya.suspended_refresh():
with avalon.maya.maintained_selection():
cmds.select(nodes, noExpand=True)
extract_alembic(file=path,
startFrame=start,
endFrame=end,
**options)
# with avalon.maya.maintained_selection():
cmds.select(nodes, noExpand=True)
extract_alembic(file=path,
startFrame=start,
endFrame=end,
**options)
if "files" not in instance.data:
instance.data["files"] = list()

View file

@ -7,7 +7,7 @@ import pype.api
from pype.maya.lib import extract_alembic
class ExtractColorbleedAlembic(pype.api.Extractor):
class ExtractAlembic(pype.api.Extractor):
"""Produce an alembic of just point positions and normals.
Positions and normals, uvs, creases are preserved, but nothing more,

View file

@ -6,7 +6,7 @@ import avalon.maya
import pype.api
class ExtractColorbleedRig(pype.api.Extractor):
class ExtractRig(pype.api.Extractor):
"""Extract rig as Maya Ascii"""
label = "Extract Rig (Maya ASCII)"

View file

@ -33,7 +33,7 @@ class ExtractSetDress(pype.api.Extractor):
json.dump(instance.data["scenedata"], filepath, ensure_ascii=False)
self.log.info("Extracting point cache ..")
cmds.select(instance.data["hierarchy"])
cmds.select(instance.data["\"])
# Run basic alembic exporter
extract_alembic(file=hierarchy_path,

View file

@ -9,9 +9,9 @@ def get_file_rule(rule):
return mel.eval('workspace -query -fileRuleEntry "{}"'.format(rule))
class ValidateRenderImageRule(pyblish.api.ContextPlugin):
class ValidateRenderImageRule(pyblish.api.InstancePlugin):
"""Validates "images" file rule is set to "renders/"
"""
order = pype.api.ValidateContentsOrder
@ -19,7 +19,7 @@ class ValidateRenderImageRule(pyblish.api.ContextPlugin):
hosts = ["maya"]
families = ["renderlayer"]
def process(self, context):
def process(self, instance):
assert get_file_rule("images") == "renders", (
"Workspace's `images` file rule must be set to: renders"

View file

@ -5,9 +5,9 @@ import pype.api
class ValidateSingleAssembly(pyblish.api.InstancePlugin):
"""Ensure the content of the instance is grouped in a single hierarchy
The instance must have a single root node containing all the content.
The instance must have a single root node containing all the content.
This root node *must* be a top group in the outliner.
Example outliner:
root_GRP
-- geometry_GRP
@ -19,7 +19,7 @@ class ValidateSingleAssembly(pyblish.api.InstancePlugin):
order = pype.api.ValidateContentsOrder
hosts = ['maya']
families = ["rig', 'studio.animation']
families = ['rig', 'studio.animation']
label = 'Single Assembly'
def process(self, instance):