ayon-core/pype/plugins/maya/load/load_alembic.py
2019-01-28 21:27:58 +01:00

33 lines
969 B
Python

import pype.maya.plugin
class AbcLoader(pype.maya.plugin.ReferenceLoader):
"""Specific loader of Alembic for the pype.animation family"""
families = ["animation",
"pointcache"]
label = "Reference animation"
representations = ["abc"]
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)