mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
'is_latest' moved to pipeline as 'is_representation_from_latest'
This commit is contained in:
parent
95eb83d8e0
commit
c8d18dafa1
5 changed files with 25 additions and 26 deletions
|
|
@ -5,8 +5,8 @@ from openpype.pipeline import (
|
|||
load,
|
||||
get_representation_path,
|
||||
)
|
||||
from openpype.pipeline.context_tools import is_representation_from_latest
|
||||
import openpype.hosts.harmony.api as harmony
|
||||
import openpype.lib
|
||||
|
||||
|
||||
copy_files = """function copyFile(srcFilename, dstFilename)
|
||||
|
|
@ -280,9 +280,7 @@ class BackgroundLoader(load.LoaderPlugin):
|
|||
)
|
||||
|
||||
def update(self, container, representation):
|
||||
|
||||
path = get_representation_path(representation)
|
||||
|
||||
with open(path) as json_file:
|
||||
data = json.load(json_file)
|
||||
|
||||
|
|
@ -300,10 +298,9 @@ class BackgroundLoader(load.LoaderPlugin):
|
|||
|
||||
bg_folder = os.path.dirname(path)
|
||||
|
||||
path = get_representation_path(representation)
|
||||
|
||||
print(container)
|
||||
|
||||
is_latest = is_representation_from_latest(representation["parent"])
|
||||
for layer in sorted(layers):
|
||||
file_to_import = [
|
||||
os.path.join(bg_folder, layer).replace("\\", "/")
|
||||
|
|
@ -347,7 +344,7 @@ class BackgroundLoader(load.LoaderPlugin):
|
|||
}
|
||||
%s
|
||||
""" % (sig, sig)
|
||||
if openpype.lib.is_latest(representation):
|
||||
if is_latest:
|
||||
harmony.send({"function": func, "args": [node, "green"]})
|
||||
else:
|
||||
harmony.send({"function": func, "args": [node, "red"]})
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@ from openpype.pipeline import (
|
|||
load,
|
||||
get_representation_path,
|
||||
)
|
||||
from openpype.pipeline.context_tools import is_representation_from_latest
|
||||
import openpype.hosts.harmony.api as harmony
|
||||
import openpype.lib
|
||||
|
||||
|
||||
class ImageSequenceLoader(load.LoaderPlugin):
|
||||
|
|
@ -109,7 +109,7 @@ class ImageSequenceLoader(load.LoaderPlugin):
|
|||
)
|
||||
|
||||
# Colour node.
|
||||
if openpype.lib.is_latest(representation):
|
||||
if is_representation_from_latest(representation["parent"]):
|
||||
harmony.send(
|
||||
{
|
||||
"function": "PypeHarmony.setColor",
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@ from openpype.pipeline import (
|
|||
load,
|
||||
get_representation_path,
|
||||
)
|
||||
from openpype.pipeline.context_tools import is_representation_from_latest
|
||||
import openpype.hosts.harmony.api as harmony
|
||||
import openpype.lib
|
||||
|
||||
|
||||
class TemplateLoader(load.LoaderPlugin):
|
||||
|
|
@ -83,7 +83,7 @@ class TemplateLoader(load.LoaderPlugin):
|
|||
self_name = self.__class__.__name__
|
||||
|
||||
update_and_replace = False
|
||||
if openpype.lib.is_latest(representation):
|
||||
if is_representation_from_latest(representation["parent"]):
|
||||
self._set_green(node)
|
||||
else:
|
||||
self._set_red(node)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue