mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 00:44:52 +01:00
implemented load method of multiverse usd loader
This commit is contained in:
parent
9f83eec324
commit
2adbe78122
1 changed files with 22 additions and 4 deletions
|
|
@ -1,5 +1,9 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from avalon import api
|
||||
|
||||
import maya.cmds as cmds
|
||||
|
||||
|
||||
class MultiverseUsdLoader(api.Loader):
|
||||
"""Load the USD by Multiverse"""
|
||||
|
||||
|
|
@ -10,10 +14,9 @@ class MultiverseUsdLoader(api.Loader):
|
|||
order = -10
|
||||
icon = "code-fork"
|
||||
color = "orange"
|
||||
|
||||
|
||||
def load(self, context, name=None, namespace=None, options=None):
|
||||
|
||||
import maya.cmds as cmds
|
||||
from openpype.hosts.maya.api.pipeline import containerise
|
||||
from openpype.hosts.maya.api.lib import unique_namespace
|
||||
|
||||
|
|
@ -36,10 +39,25 @@ class MultiverseUsdLoader(api.Loader):
|
|||
cmds.parent(shape, root)
|
||||
|
||||
def update(self, container, representation):
|
||||
pass
|
||||
|
||||
path = api.get_representation_path(representation)
|
||||
|
||||
# Update the shape
|
||||
members = cmds.sets(container['objectName'], query=True)
|
||||
shapes = cmds.ls(members, type="mvUsdPackedShape", long=True)
|
||||
|
||||
assert len(shapes) == 1, "This is a bug"
|
||||
|
||||
import multiverse
|
||||
for shape in shapes:
|
||||
multiverse.SetUsdCompoundAssetPaths(shape, [path])
|
||||
|
||||
cmds.setAttr(container["objectName"] + ".representation",
|
||||
str(representation["_id"]),
|
||||
type="string")
|
||||
|
||||
def switch(self, container, representation):
|
||||
self.update(container, representation)
|
||||
|
||||
def remove(self, container):
|
||||
pass
|
||||
pass
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue