This repository has been archived by the owner on Sep 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from pypeclub/feature/PYPE-654-nks-cut-referen…
…ce-videos nks cut reference videos
- Loading branch information
Showing
12 changed files
with
541 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
import pyblish.api | ||
import opentimelineio.opentime as otio_ot | ||
|
||
|
||
class CollectClipTimecodes(pyblish.api.InstancePlugin): | ||
"""Collect time with OpenTimelineIO: | ||
source_h(In,Out)[timecode, sec] | ||
timeline(In,Out)[timecode, sec] | ||
""" | ||
|
||
order = pyblish.api.CollectorOrder + 0.101 | ||
label = "Collect Timecodes" | ||
hosts = ["nukestudio"] | ||
|
||
def process(self, instance): | ||
|
||
data = dict() | ||
self.log.debug("__ instance.data: {}".format(instance.data)) | ||
# Timeline data. | ||
handle_start = instance.data["handleStart"] | ||
handle_end = instance.data["handleEnd"] | ||
|
||
source_in_h = instance.data("sourceInH", | ||
instance.data("sourceIn") - handle_start) | ||
source_out_h = instance.data("sourceOutH", | ||
instance.data("sourceOut") + handle_end) | ||
|
||
timeline_in = instance.data["clipIn"] | ||
timeline_out = instance.data["clipOut"] | ||
|
||
# set frame start with tag or take it from timeline | ||
frame_start = instance.data.get("startingFrame") | ||
|
||
if not frame_start: | ||
frame_start = timeline_in | ||
|
||
source = instance.data.get("source") | ||
|
||
otio_data = dict() | ||
self.log.debug("__ source: `{}`".format(source)) | ||
|
||
rate_fps = instance.context.data["fps"] | ||
|
||
otio_in_h_ratio = otio_ot.RationalTime( | ||
value=(source.timecodeStart() + ( | ||
source_in_h + (source_out_h - source_in_h))), | ||
rate=rate_fps) | ||
|
||
otio_out_h_ratio = otio_ot.RationalTime( | ||
value=(source.timecodeStart() + source_in_h), | ||
rate=rate_fps) | ||
|
||
otio_timeline_in_ratio = otio_ot.RationalTime( | ||
value=int( | ||
instance.data.get("timelineTimecodeStart", 0)) + timeline_in, | ||
rate=rate_fps) | ||
|
||
otio_timeline_out_ratio = otio_ot.RationalTime( | ||
value=int( | ||
instance.data.get("timelineTimecodeStart", 0)) + timeline_out, | ||
rate=rate_fps) | ||
|
||
otio_data.update({ | ||
|
||
"otioClipInHTimecode": otio_ot.to_timecode(otio_in_h_ratio), | ||
|
||
"otioClipOutHTimecode": otio_ot.to_timecode(otio_out_h_ratio), | ||
|
||
"otioClipInHSec": otio_ot.to_seconds(otio_in_h_ratio), | ||
|
||
"otioClipOutHSec": otio_ot.to_seconds(otio_out_h_ratio), | ||
|
||
"otioTimelineInTimecode": otio_ot.to_timecode( | ||
otio_timeline_in_ratio), | ||
|
||
"otioTimelineOutTimecode": otio_ot.to_timecode( | ||
otio_timeline_out_ratio), | ||
|
||
"otioTimelineInSec": otio_ot.to_seconds(otio_timeline_in_ratio), | ||
|
||
"otioTimelineOutSec": otio_ot.to_seconds(otio_timeline_out_ratio) | ||
}) | ||
|
||
data.update({ | ||
"otioData": otio_data, | ||
"sourceTimecodeIn": otio_ot.to_timecode(otio_in_h_ratio), | ||
"sourceTimecodeOut": otio_ot.to_timecode(otio_out_h_ratio) | ||
}) | ||
instance.data.update(data) | ||
self.log.debug("data: {}".format(instance.data)) |
21 changes: 21 additions & 0 deletions
21
pype/plugins/nukestudio/publish/collect_clip_resolution.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import pyblish.api | ||
|
||
|
||
class CollectClipResolution(pyblish.api.InstancePlugin): | ||
"""Collect clip geometry resolution""" | ||
|
||
order = pyblish.api.CollectorOrder + 0.101 | ||
label = "Collect Clip Resoluton" | ||
hosts = ["nukestudio"] | ||
|
||
def process(self, instance): | ||
sequence = instance.context.data['activeSequence'] | ||
resolution_width = int(sequence.format().width()) | ||
resolution_height = int(sequence.format().height()) | ||
pixel_aspect = sequence.format().pixelAspect() | ||
|
||
instance.data.update({ | ||
"resolutionWidth": resolution_width, | ||
"resolutionHeight": resolution_height, | ||
"pixelAspect": pixel_aspect | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.