From 1a15dc78ce8dc41a8bd886e03bab29b91b73cbfe Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Sun, 28 Jun 2020 16:23:05 +0100 Subject: [PATCH] Convert imageseuqnece loader --- pype/hosts/harmony/__init__.py | 4 +++- pype/plugins/harmony/load/load_imagesequence.py | 12 +++++++----- pype/plugins/harmony/load/load_palette.py | 2 -- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/pype/hosts/harmony/__init__.py b/pype/hosts/harmony/__init__.py index 4dc06cdf84..3345c3134a 100644 --- a/pype/hosts/harmony/__init__.py +++ b/pype/hosts/harmony/__init__.py @@ -124,7 +124,9 @@ def check_inventory(): outdated_nodes = [] for container in outdated_containers: if container["loader"] == "ImageSequenceLoader": - outdated_nodes.append(container["name"]) + outdated_nodes.append( + harmony.find_node_by_name(container["name"]), "READ" + ) harmony.send({"function": func, "args": [outdated_nodes]}) # Warn about outdated containers. diff --git a/pype/plugins/harmony/load/load_imagesequence.py b/pype/plugins/harmony/load/load_imagesequence.py index 615188572e..f81018d0fb 100644 --- a/pype/plugins/harmony/load/load_imagesequence.py +++ b/pype/plugins/harmony/load/load_imagesequence.py @@ -1,4 +1,5 @@ import os +import uuid import clique @@ -252,15 +253,15 @@ class ImageSequenceLoader(api.Loader): ).replace("\\", "/") ) + name = context["subset"]["name"] + name += "_{}".format(uuid.uuid4()) read_node = harmony.send( { "function": copy_files + import_files, - "args": ["Top", files, context["subset"]["name"], 1] + "args": ["Top", files, name, 1] } )["result"] - self[:] = [read_node] - return harmony.containerise( name, namespace, @@ -270,7 +271,7 @@ class ImageSequenceLoader(api.Loader): ) def update(self, container, representation): - node = container.pop("node") + node = harmony.find_node_by_name(container["name"], "READ") path = api.get_representation_path(representation) collections, remainder = clique.assemble( @@ -324,7 +325,8 @@ class ImageSequenceLoader(api.Loader): ) def remove(self, container): - node = container.pop("node") + node = harmony.find_node_by_name(container["name"], "READ") + func = """function deleteNode(_node) { node.deleteNode(_node, true, true); diff --git a/pype/plugins/harmony/load/load_palette.py b/pype/plugins/harmony/load/load_palette.py index cfb88ac841..44aaf76aa5 100644 --- a/pype/plugins/harmony/load/load_palette.py +++ b/pype/plugins/harmony/load/load_palette.py @@ -2,8 +2,6 @@ import os import shutil import uuid -from bson.objectid import ObjectId - from avalon import api, harmony