diff --git a/colorbleed/plugins/maya/load/load_animation.py b/colorbleed/plugins/maya/load/load_animation.py index 6660468484..cbbbc1ff4b 100644 --- a/colorbleed/plugins/maya/load/load_animation.py +++ b/colorbleed/plugins/maya/load/load_animation.py @@ -7,6 +7,11 @@ class AbcLoader(api.Loader): families = ["colorbleed.animation", "colorbleed.camera"] representations = ["abc"] + label = "Reference animation" + order = -10 + icon = "code-fork" + color = "orange" + def process(self, name, namespace, context): from maya import cmds @@ -31,6 +36,10 @@ class CurvesLoader(api.Loader): families = ["colorbleed.animation"] representations = ["curves"] + label = "Import curves" + order = -1 + icon = "question" + def process(self, name, namespace, context): from maya import cmds from avalon import maya diff --git a/colorbleed/plugins/maya/load/load_historylook.py b/colorbleed/plugins/maya/load/load_historylook.py index e4c49685cb..7ff0557de6 100644 --- a/colorbleed/plugins/maya/load/load_historylook.py +++ b/colorbleed/plugins/maya/load/load_historylook.py @@ -8,6 +8,11 @@ class HistoryLookLoader(api.Loader): families = ["colorbleed.historyLookdev"] representations = ["ma"] + label = "Reference look history" + order = -10 + icon = "code-fork" + color = "orange" + def process(self, name, namespace, context): from avalon import maya with maya.maintained_selection(): diff --git a/colorbleed/plugins/maya/load/load_look.py b/colorbleed/plugins/maya/load/load_look.py index eae0a5b5a2..442b780978 100644 --- a/colorbleed/plugins/maya/load/load_look.py +++ b/colorbleed/plugins/maya/load/load_look.py @@ -11,6 +11,11 @@ class LookLoader(api.Loader): families = ["colorbleed.lookdev"] representations = ["ma"] + label = "Reference look" + order = -10 + icon = "code-fork" + color = "orange" + def process(self, name, namespace, context): from avalon import maya try: diff --git a/colorbleed/plugins/maya/load/load_model.py b/colorbleed/plugins/maya/load/load_model.py index 65dd3e2fd0..b608bc2a80 100644 --- a/colorbleed/plugins/maya/load/load_model.py +++ b/colorbleed/plugins/maya/load/load_model.py @@ -3,15 +3,16 @@ from avalon import api class ModelLoader(api.Loader): - """Load models - - Stores the imported asset in a container named after the asset. - - """ + """Load the model""" families = ["colorbleed.model"] representations = ["ma"] + label = "Reference model" + order = -10 + icon = "code-fork" + color = "orange" + def process(self, name, namespace, context): from avalon import maya with maya.maintained_selection(): @@ -29,3 +30,46 @@ class ModelLoader(api.Loader): cmds.sets(meshes, forceElement="initialShadingGroup") self[:] = nodes + + +class ModelGPUCacheLoader(api.Loader): + """Import a GPU Cache""" + + families = ["colorbleed.model"] + representations = ["abc"] + + label = "Import GPU Cache" + order = -1 + icon = "download" + + def process(self, name, namespace, context): + + from maya import cmds + + # todo: This will likely not be entirely safe with "containerize" + # also this cannot work in the manager because it only works + # on references at the moment! + # especially in cases of duplicating the gpu cache node this will + # mess up the "containered" workflow in the avalon core for maya + print("WARNING: Importing gpuCaches isn't fully tested yet") + + path = self.fname + + cmds.loadPlugin("gpuCache", quiet=True) + + # Create transform with shape + transform = cmds.createNode("transform", + name=name) + cache = cmds.createNode("gpuCache", + parent=transform, + name="{0}Shape".format(name)) + + # Set the cache filepath + cmds.setAttr(cache + '.cacheFileName', path, type="string") + cmds.setAttr(cache + '.cacheGeomPath', "|", type="string") # root + + # Select the transform + cmds.select(transform, r=1) + + # Store the created nodes + self[:] = [transform, cache] diff --git a/colorbleed/plugins/maya/load/load_rig.py b/colorbleed/plugins/maya/load/load_rig.py index 2198c4dbd5..ab9863ee28 100644 --- a/colorbleed/plugins/maya/load/load_rig.py +++ b/colorbleed/plugins/maya/load/load_rig.py @@ -12,6 +12,11 @@ class RigLoader(api.Loader): families = ["colorbleed.rig"] representations = ["ma"] + label = "Reference rig" + order = -10 + icon = "code-fork" + color = "orange" + def process(self, name, namespace, context): nodes = cmds.file(self.fname, namespace=namespace,