Skip to content

Potential conflict collecting and publishing image sequences #12

Description

@aardschok

Issue

When collecting image sequences through Avalon to publish, the data which is parsed to the new instance is not unique and might create conflicting data.

Example

The render has multiple AOVs or Render Elements per layer. This results in :

  • TECH.normal.####.ext
  • TECH.zdepth.####.ext
  • CHARS.objectId.####.ext
  • CHARS.materialID.####.ext
  • CHARS.beauty.####.ext

The collector will create an instance for each of those, perfect ... but! The data being parsed is exactly the same from layer metadata. When the mutable data needs to be altered post-instance-creation this can result in TECH.zdepth getting information which should only be on TECH.normal. The same goes for all other AOVs/Render Elements for each layer.

Original code

https://github.com/mindbender-studio/config/blob/master/polly/plugins/publish/collect_imagesequences.py#L47

Solution

To ensure all instances have the correct metadata we suggest to use copy.deepcopy(metadata["instance"]).

The code would then look something link this:

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))

    # 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"],
        "subset": collection.head[:-1],
        "stagingDir": os.path.join(workspace, renderlayer),
        "files": [list(collection)],
        "metadata": metadata
    })

    instance.data.update(data)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions