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

Hiero: publish with retiming #1545

Merged
merged 34 commits into from
Jun 2, 2021
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
fb45010
Create draft PR for #1377
May 20, 2021
4d93fd7
Merge branch 'feature/1376-hiero-publish-color-and-transformation-sof…
jakubjezek001 May 20, 2021
4f0e02e
hiero: remove old code
jakubjezek001 May 20, 2021
ab6a3dd
hiero: old workflow plugins reorganisation
jakubjezek001 May 20, 2021
1bb8834
Hiero: add exception for TimeWarp effect
jakubjezek001 May 20, 2021
a4f69b4
Hiero: refactory precollect retime
jakubjezek001 May 20, 2021
ac8ca2e
Nuke: refactory loaders for retime
jakubjezek001 May 20, 2021
3b0f914
Global: updating version data
jakubjezek001 May 20, 2021
6002a19
Hiero: version data update
jakubjezek001 May 20, 2021
731676a
hound: suggestions
jakubjezek001 May 20, 2021
7c58036
Hiero: otio speed added to duration
jakubjezek001 May 26, 2021
6b420df
Hiero: accepting of retime speed
jakubjezek001 May 26, 2021
9041df9
Hiero: identifying otio clip with speed on duration
jakubjezek001 May 26, 2021
0eeeb19
Merge branch 'develop' into feature/1377-hiero-publish-with-retiming
jakubjezek001 May 27, 2021
a13d37c
Hiero: moving review to shot instance
jakubjezek001 Jun 1, 2021
9efdf2c
Nuke: fixing loaders retime offset
jakubjezek001 Jun 1, 2021
82cd169
Hiero: fixing retime so resources are fully coppied
jakubjezek001 Jun 1, 2021
5521115
Hiero: otio time effects implementation
jakubjezek001 Jun 1, 2021
5ec54c9
hound: suggestions
jakubjezek001 Jun 2, 2021
09b8cd5
Hiero: select only clip related time effect
jakubjezek001 Jun 2, 2021
bc0df1c
Hiero: new retime and old retime to archived effects
jakubjezek001 Jun 2, 2021
fe77ba1
Lib: adding editorial function for retime recalculate media range
jakubjezek001 Jun 2, 2021
57f742d
Global: refactory subset resources from otio with retimes
jakubjezek001 Jun 2, 2021
d2eeb31
Global: brushing code
jakubjezek001 Jun 2, 2021
6d41804
Global, Hiero: reverse previous commit `plate` to `shot` family swap
jakubjezek001 Jun 2, 2021
1beb6c8
Hiero: ignoring TimeWarp effect on collection
jakubjezek001 Jun 2, 2021
3354668
Hiero: clear retime family from collection
jakubjezek001 Jun 2, 2021
ceeee8c
global: make it nicer and readable
jakubjezek001 Jun 2, 2021
11db9f6
Global: version data with re-time data to published version
jakubjezek001 Jun 2, 2021
411db5b
Lib: editorial retime data to version data
jakubjezek001 Jun 2, 2021
68ee9ec
Hound: suggestions
jakubjezek001 Jun 2, 2021
d1aea56
Nuke: loaders with new retime settings
jakubjezek001 Jun 2, 2021
b53e345
Hiero: removing dev plugin
jakubjezek001 Jun 2, 2021
2bb4733
Hiero: fix only video track item with subtrack items
jakubjezek001 Jun 2, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 79 additions & 2 deletions openpype/hosts/hiero/otio/hiero_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,76 @@ def _get_metadata(item):
return {}


def create_time_effects(otio_clip, track_item):
# get all subtrack items
subTrackItems = flatten(track_item.parent().subTrackItems())
speed = track_item.playbackSpeed()

otio_effect = None
# retime on track item
if speed != 1.:
# make effect
otio_effect = otio.schema.LinearTimeWarp()
otio_effect.name = "Speed"
otio_effect.time_scalar = speed
otio_effect.metadata = {}

# freeze frame effect
if speed == 0.:
otio_effect = otio.schema.FreezeFrame()
otio_effect.name = "FreezeFrame"
otio_effect.metadata = {}

if otio_effect:
# add otio effect to clip effects
otio_clip.effects.append(otio_effect)

# loop trought and get all Timewarps
for effect in subTrackItems:
if ((track_item not in effect.linkedItems())
and (len(effect.linkedItems()) > 0)):
continue
# avoid all effect which are not TimeWarp and disabled
if "TimeWarp" not in effect.name():
continue

if not effect.isEnabled():
continue

node = effect.node()
name = node["name"].value()

# solve effect class as effect name
_name = effect.name()
if "_" in _name:
effect_name = re.sub(r"(?:_)[_0-9]+", "", _name) # more numbers
else:
effect_name = re.sub(r"\d+", "", _name) # one number

metadata = {}
# add knob to metadata
for knob in ["lookup", "length"]:
value = node[knob].value()
animated = node[knob].isAnimated()
if animated:
value = [
((node[knob].getValueAt(i)) - i)
for i in range(
track_item.timelineIn(), track_item.timelineOut() + 1)
]

metadata[knob] = value

# make effect
otio_effect = otio.schema.TimeEffect()
otio_effect.name = name
otio_effect.effect_name = effect_name
otio_effect.metadata = metadata

# add otio effect to clip effects
otio_clip.effects.append(otio_effect)


def create_otio_reference(clip):
metadata = _get_metadata(clip)
media_source = clip.mediaSource()
Expand Down Expand Up @@ -197,8 +267,12 @@ def create_otio_markers(otio_item, item):

def create_otio_clip(track_item):
clip = track_item.source()
source_in = track_item.sourceIn()
duration = track_item.sourceDuration()
speed = track_item.playbackSpeed()
# flip if speed is in minus
source_in = track_item.sourceIn() if speed > 0 else track_item.sourceOut()

duration = int(track_item.duration())

fps = utils.get_rate(track_item) or self.project_fps
name = track_item.name()

Expand All @@ -220,6 +294,9 @@ def create_otio_clip(track_item):
create_otio_markers(otio_clip, track_item)
create_otio_markers(otio_clip, track_item.source())

# Add effects to clips
create_time_effects(otio_clip, track_item)

return otio_clip


Expand Down
121 changes: 0 additions & 121 deletions openpype/hosts/hiero/plugins/_publish/collect_calculate_retime.py

This file was deleted.

23 changes: 0 additions & 23 deletions openpype/hosts/hiero/plugins/_publish/collect_framerate.py

This file was deleted.

30 changes: 0 additions & 30 deletions openpype/hosts/hiero/plugins/_publish/collect_metadata.py

This file was deleted.

90 changes: 0 additions & 90 deletions openpype/hosts/hiero/plugins/_publish/collect_timecodes.py

This file was deleted.

Loading