From 8f22636b04dbccdeea127c97afc2d0a3c4269c6c Mon Sep 17 00:00:00 2001 From: aardschok Date: Thu, 26 Oct 2017 15:29:22 +0200 Subject: [PATCH 1/2] added if __name__ to ensure python consoles can run the script --- colorbleed/scripts/publish_imagesequence.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/colorbleed/scripts/publish_imagesequence.py b/colorbleed/scripts/publish_imagesequence.py index df0c566b76..426f2e4c61 100644 --- a/colorbleed/scripts/publish_imagesequence.py +++ b/colorbleed/scripts/publish_imagesequence.py @@ -88,3 +88,8 @@ def __main__(): "stored in a .JSON file") publish_data(filepath) + + +# this is needed to ensure Deadline can run the script +if __name__ == '__main__': + __main__() From e415b55030b6eb7c97a91610483daaa18a2d4e0c Mon Sep 17 00:00:00 2001 From: aardschok Date: Thu, 26 Oct 2017 16:32:00 +0200 Subject: [PATCH 2/2] inserted deepcopy of metadata to ensure unique data for all instances --- colorbleed/plugins/publish/collect_imagesequences.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/colorbleed/plugins/publish/collect_imagesequences.py b/colorbleed/plugins/publish/collect_imagesequences.py index e1e3707ecc..244f054a67 100644 --- a/colorbleed/plugins/publish/collect_imagesequences.py +++ b/colorbleed/plugins/publish/collect_imagesequences.py @@ -1,4 +1,5 @@ import pyblish.api +import copy class CollectMindbenderImageSequences(pyblish.api.ContextPlugin): @@ -44,11 +45,17 @@ class CollectMindbenderImageSequences(pyblish.api.ContextPlugin): raise Exception("%s was not published correctly " "(missing metadata)" % renderlayer) + metadat_instance = metadata['instance'] + # For now ensure this data is ignored for collection in collections: instance = context.create_instance(str(collection)) self.log.info("Collection: %s" % list(collection)) - data = dict(metadata["instance"], **{ + # Ensure each instance gets its own unique reference to + # the source data + instance_metadata = copy.deepcopy(metadat_instance) + + data = dict(instance_metadata, **{ "name": instance.name, "family": "Image Sequences", "families": ["colorbleed.imagesequence"],