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

Commit

Permalink
Merge pull request #1904 from pypeclub/bugfix/hiero-load-clip-colorspace
Browse files Browse the repository at this point in the history
Hiero: loaded clip was not set colorspace from version data
  • Loading branch information
jakubjezek001 authored Aug 10, 2021
2 parents 26bb7d9 + 9e8e8ec commit af4237d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
16 changes: 13 additions & 3 deletions openpype/hosts/hiero/plugins/load/load_clip.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ def load(self, context, name, namespace, options):
object_name = self.clip_name_template.format(
**context["representation"]["context"])

# set colorspace
if colorspace:
track_item.source().setSourceMediaColourTransform(colorspace)

# add additional metadata from the version to imprint Avalon knob
add_keys = [
"frameStart", "frameEnd", "source", "author",
Expand Down Expand Up @@ -109,9 +113,14 @@ def update(self, container, representation):
colorspace = version_data.get("colorspace", None)
object_name = "{}_{}".format(name, namespace)
file = api.get_representation_path(representation).replace("\\", "/")
clip = track_item.source()

# reconnect media to new path
track_item.source().reconnectMedia(file)
clip.reconnectMedia(file)

# set colorspace
if colorspace:
clip.setSourceMediaColourTransform(colorspace)

# add additional metadata from the version to imprint Avalon knob
add_keys = [
Expand Down Expand Up @@ -160,6 +169,7 @@ def multiselection(cls, track_item):
@classmethod
def set_item_color(cls, track_item, version):

clip = track_item.source()
# define version name
version_name = version.get("name", None)
# get all versions in list
Expand All @@ -172,6 +182,6 @@ def set_item_color(cls, track_item, version):

# set clip colour
if version_name == max_version:
track_item.source().binItem().setColor(cls.clip_color_last)
clip.binItem().setColor(cls.clip_color_last)
else:
track_item.source().binItem().setColor(cls.clip_color)
clip.binItem().setColor(cls.clip_color)
14 changes: 7 additions & 7 deletions openpype/hosts/hiero/plugins/publish/precollect_instances.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@ def process(self, context):
# create instance
instance = context.create_instance(**data)

# add colorspace data
instance.data.update({
"versionData": {
"colorspace": track_item.sourceMediaColourTransform(),
}
})

# create shot instance for shot attributes create/update
self.create_shot_instance(context, **data)

Expand All @@ -133,13 +140,6 @@ def process(self, context):
# create audio subset instance
self.create_audio_instance(context, **data)

# add colorspace data
instance.data.update({
"versionData": {
"colorspace": track_item.sourceMediaColourTransform(),
}
})

# add audioReview attribute to plate instance data
# if reviewTrack is on
if tag_data.get("reviewTrack") is not None:
Expand Down

0 comments on commit af4237d

Please sign in to comment.