Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

General: Fix import after movements #3028

Merged
merged 2 commits into from
Apr 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions openpype/hosts/maya/plugins/inventory/import_modelrender.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from openpype.pipeline import (
InventoryAction,
get_representation_context,
get_representation_path_from_context,
)
from openpype.hosts.maya.api.lib import (
maintained_selection,
Expand Down Expand Up @@ -80,10 +79,10 @@ def assign_model_render_by_version(self, nodes, version_id):
})

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():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

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

Expand Down Expand Up @@ -63,7 +62,7 @@ def get_options(cls, repre_contexts):
"""
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)):
Expand Down
Original file line number Diff line number Diff line change
@@ -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


Expand Down
2 changes: 2 additions & 0 deletions openpype/pipeline/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@

loaders_from_representation,
get_representation_path,
get_representation_context,
get_repres_contexts,
)

Expand Down Expand Up @@ -113,6 +114,7 @@

"loaders_from_representation",
"get_representation_path",
"get_representation_context",
"get_repres_contexts",

# --- Publish ---
Expand Down
3 changes: 2 additions & 1 deletion openpype/pipeline/load/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ def __init__(self, context):
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):
Expand Down