mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 21:32:15 +01:00
40 lines
958 B
Python
40 lines
958 B
Python
import pype.maya.plugin
|
|
|
|
|
|
class LookLoader(pype.maya.plugin.ReferenceLoader):
|
|
"""Specific loader for lookdev"""
|
|
|
|
families = ["look"]
|
|
representations = ["ma"]
|
|
|
|
label = "Reference look"
|
|
order = -10
|
|
icon = "code-fork"
|
|
color = "orange"
|
|
|
|
def process_reference(self, context, name, namespace, data):
|
|
"""
|
|
Load and try to ssign Lookdev to nodes based on relationship data
|
|
Args:
|
|
name:
|
|
namespace:
|
|
context:
|
|
data:
|
|
|
|
Returns:
|
|
|
|
"""
|
|
|
|
import maya.cmds as cmds
|
|
from avalon import maya
|
|
|
|
with maya.maintained_selection():
|
|
nodes = cmds.file(self.fname,
|
|
namespace=namespace,
|
|
reference=True,
|
|
returnNewNodes=True)
|
|
|
|
self[:] = nodes
|
|
|
|
def switch(self, container, representation):
|
|
self.update(container, representation)
|