From f73f2541810010c987b976f5333771fed65ac71b Mon Sep 17 00:00:00 2001 From: aardschok Date: Mon, 9 Oct 2017 14:46:47 +0200 Subject: [PATCH] added new creator class for setdress --- .../maya/create/colorbleed_setdress.py | 9 ++++++ colorbleed/plugins/maya/load/load_setdress.py | 32 +++++++++++++++++++ .../maya/load/load_setdress_rebuild.py | 0 .../plugins/maya/publish/collect_setdress.py | 0 .../plugins/maya/publish/extract_setdress.py | 0 5 files changed, 41 insertions(+) create mode 100644 colorbleed/plugins/maya/create/colorbleed_setdress.py create mode 100644 colorbleed/plugins/maya/load/load_setdress.py create mode 100644 colorbleed/plugins/maya/load/load_setdress_rebuild.py create mode 100644 colorbleed/plugins/maya/publish/collect_setdress.py create mode 100644 colorbleed/plugins/maya/publish/extract_setdress.py diff --git a/colorbleed/plugins/maya/create/colorbleed_setdress.py b/colorbleed/plugins/maya/create/colorbleed_setdress.py new file mode 100644 index 0000000000..fe0c64dd40 --- /dev/null +++ b/colorbleed/plugins/maya/create/colorbleed_setdress.py @@ -0,0 +1,9 @@ +import avalon.maya + + +class CreateSetDress(avalon.maya.Creator): + """THe animated objects in the scene""" + + name = "setdress" + label = "Set Dress" + family = "colorbleed.setdress" diff --git a/colorbleed/plugins/maya/load/load_setdress.py b/colorbleed/plugins/maya/load/load_setdress.py new file mode 100644 index 0000000000..aaf6834f2f --- /dev/null +++ b/colorbleed/plugins/maya/load/load_setdress.py @@ -0,0 +1,32 @@ +from avalon import api + + +class SetDressAlembicLoader(api.Loader): + """Load the setdress as alembic""" + + families = ["colorbleed.setdress"] + representations = ["abc"] + + label = "Load Alembic" + order = -10 + icon = "code-fork" + color = "orange" + + def process(self, name, namespace, context, data): + + import maya.cmds as cmds + from avalon import maya + + namespace = maya.unique_namespace("{}_".format(name), + format="%03d", + suffix="_abc") + + with maya.maintained_selection(): + nodes = cmds.file(self.fname, + namespace=namespace, + reference=True, + returnNewNodes=True, + groupReference=True, + groupName="{}:{}".format(namespace, name)) + + self[:] = nodes diff --git a/colorbleed/plugins/maya/load/load_setdress_rebuild.py b/colorbleed/plugins/maya/load/load_setdress_rebuild.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/colorbleed/plugins/maya/publish/collect_setdress.py b/colorbleed/plugins/maya/publish/collect_setdress.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/colorbleed/plugins/maya/publish/extract_setdress.py b/colorbleed/plugins/maya/publish/extract_setdress.py new file mode 100644 index 0000000000..e69de29bb2