From c8cfc53f11e52324072c7cd5b4566dffbd8a3d7d Mon Sep 17 00:00:00 2001 From: aardschok Date: Fri, 21 Jul 2017 14:20:26 +0200 Subject: [PATCH] removed unsupported flag from extract alembic call, added cbId to attr flag --- .../plugins/maya/publish/extract_alembic.py | 2 ++ .../plugins/maya/publish/extract_animation.py | 27 ++++++++++--------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/colorbleed/plugins/maya/publish/extract_alembic.py b/colorbleed/plugins/maya/publish/extract_alembic.py index 83a87e7a6b..c3abe59244 100644 --- a/colorbleed/plugins/maya/publish/extract_alembic.py +++ b/colorbleed/plugins/maya/publish/extract_alembic.py @@ -33,6 +33,8 @@ class ExtractAlembic(colorbleed.api.Extractor): # force elect items to ensure all items get exported by Alembic members = instance.data("setMembers") + print members + cmds.select(members) with avalon.maya.suspended_refresh(): with avalon.maya.maintained_selection(): diff --git a/colorbleed/plugins/maya/publish/extract_animation.py b/colorbleed/plugins/maya/publish/extract_animation.py index 48cb4711dc..f0241a79b4 100644 --- a/colorbleed/plugins/maya/publish/extract_animation.py +++ b/colorbleed/plugins/maya/publish/extract_animation.py @@ -1,4 +1,10 @@ +import os + +from maya import cmds + +import avalon.maya import colorbleed.api +from colorbleed.maya.lib import extract_alembic class ExtractColorbleedAnimation(colorbleed.api.Extractor): @@ -14,10 +20,6 @@ class ExtractColorbleedAnimation(colorbleed.api.Extractor): families = ["colorbleed.animation"] def process(self, instance): - import os - from maya import cmds - import avalon.maya - from colorbleed.maya.lib import extract_alembic # Collect the out set nodes out_sets = [node for node in instance if node.endswith("out_SET")] @@ -27,11 +29,13 @@ class ExtractColorbleedAnimation(colorbleed.api.Extractor): out_set = out_sets[0] nodes = cmds.sets(out_set, query=True) - # Include all descendents + # Include all descendants nodes += cmds.listRelatives(nodes, allDescendents=True, fullPath=True) or [] + print("Exporting {} as alembic".format(nodes)) + # Collect the start and end including handles start = instance.data["startFrame"] end = instance.data["endFrame"] @@ -52,13 +56,10 @@ class ExtractColorbleedAnimation(colorbleed.api.Extractor): with avalon.maya.suspended_refresh(): with avalon.maya.maintained_selection(): cmds.select(nodes, noExpand=True) - extract_alembic(file=path, **{ - "selection": True, - "frameRange": (start, end), - "writeVisibility": True, - "writeUV": True, - "step": instance.data.get("step", 1.0), - "attributePrefix": ("mb",) - }) + extract_alembic(file=path, + startFrame=start, + endFrame=end, + **{"step": instance.data.get("step", 1.0), + "attr": ["cbId"]}) self.log.info("Extracted {} to {}".format(instance, dirname))