mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Merge pull request #3028 from pypeclub/bugfix/fix_get_repre_context_import
General: Fix import after movements
This commit is contained in:
commit
d3a8f9cc28
5 changed files with 8 additions and 7 deletions
|
|
@ -4,7 +4,6 @@ from bson.objectid import ObjectId
|
|||
from openpype.pipeline import (
|
||||
InventoryAction,
|
||||
get_representation_context,
|
||||
get_representation_path_from_context,
|
||||
)
|
||||
from openpype.hosts.maya.api.lib import (
|
||||
maintained_selection,
|
||||
|
|
@ -80,10 +79,10 @@ class ImportModelRender(InventoryAction):
|
|||
})
|
||||
|
||||
context = get_representation_context(look_repr["_id"])
|
||||
maya_file = get_representation_path_from_context(context)
|
||||
maya_file = self.filepath_from_context(context)
|
||||
|
||||
context = get_representation_context(json_repr["_id"])
|
||||
json_file = get_representation_path_from_context(context)
|
||||
json_file = self.filepath_from_context(context)
|
||||
|
||||
# Import the look file
|
||||
with maintained_selection():
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ import os
|
|||
|
||||
import qargparse
|
||||
|
||||
from openpype.pipeline import get_representation_path_from_context
|
||||
from openpype.hosts.photoshop import api as photoshop
|
||||
from openpype.hosts.photoshop.api import get_unique_layer_name
|
||||
|
||||
|
|
@ -63,7 +62,7 @@ class ImageFromSequenceLoader(photoshop.PhotoshopLoader):
|
|||
"""
|
||||
files = []
|
||||
for context in repre_contexts:
|
||||
fname = get_representation_path_from_context(context)
|
||||
fname = cls.filepath_from_context(context)
|
||||
_, file_extension = os.path.splitext(fname)
|
||||
|
||||
for file_name in os.listdir(os.path.dirname(fname)):
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import collections
|
||||
import qargparse
|
||||
from avalon.pipeline import get_representation_context
|
||||
from openpype.pipeline import get_representation_context
|
||||
from openpype.hosts.tvpaint.api import lib, pipeline, plugin
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ from .load import (
|
|||
|
||||
loaders_from_representation,
|
||||
get_representation_path,
|
||||
get_representation_context,
|
||||
get_repres_contexts,
|
||||
)
|
||||
|
||||
|
|
@ -113,6 +114,7 @@ __all__ = (
|
|||
|
||||
"loaders_from_representation",
|
||||
"get_representation_path",
|
||||
"get_representation_context",
|
||||
"get_repres_contexts",
|
||||
|
||||
# --- Publish ---
|
||||
|
|
|
|||
|
|
@ -41,7 +41,8 @@ class LoaderPlugin(list):
|
|||
def get_representations(cls):
|
||||
return cls.representations
|
||||
|
||||
def filepath_from_context(self, context):
|
||||
@classmethod
|
||||
def filepath_from_context(cls, context):
|
||||
return get_representation_path_from_context(context)
|
||||
|
||||
def load(self, context, name=None, namespace=None, options=None):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue