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

nks cut reference videos #23

Merged
merged 35 commits into from
May 20, 2020
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
0e61a2d
feat(nks): colecting timecodes with otio
Dec 4, 2019
89e5e72
feat(nks): adding media/clip duration to collect frame ranges
Dec 4, 2019
cf01f44
feat(nks): collect review identify if mediaSource needs to be trimed
Dec 4, 2019
128719a
feat(nks): improving calculation of fps
Dec 4, 2019
eff28c1
Merge branch 'develop' into bugfix/ffmpeg_path_burnin_fix
Jan 22, 2020
f394b67
Merge branch 'feature/ffmpeg-devide-long-videos' into feature/PYPE-65…
Jan 22, 2020
aa3bfa6
Merge branch 'feature/nuke_studio_publish_review_cut_ffmpeg' into fea…
Jan 22, 2020
7884097
Merge branch 'develop' into feature/PYPE-654-nks-cut-reference-videos
Mar 19, 2020
bda292a
feat(global): review workflow accepting nks host
Mar 20, 2020
b149388
feat(nks): adding plugin for cutting video parts
Mar 20, 2020
55b3b41
feat(nks): adjusting collect review for cutting
Mar 20, 2020
18f6acc
clean(nks): old way of representation data
Mar 20, 2020
ac9a20c
fix(nks): improving data
Mar 20, 2020
31a7c44
fix(nks): duration method was wrong
Mar 20, 2020
b503870
fix(global): original repre tags are included to preset tags
Mar 20, 2020
06fbbd6
Merge branch 'develop' into feature/PYPE-654-nks-cut-reference-videos
jakubjezek001 May 6, 2020
eba14f8
clean(nks): Hound recomendations
jakubjezek001 May 6, 2020
fdbb6a3
fix(nks): duplicity in hierarchy tag and not matching names clips
jakubjezek001 May 7, 2020
7ac7600
Merge branch 'bugfix/129-nks_coupe_small_fixes' into feature/PYPE-654…
jakubjezek001 May 7, 2020
d4899b6
feat(nks): adding empty black frames at handle start if missing
jakubjezek001 May 11, 2020
a270c55
fix(nks): collect timecodes not used
jakubjezek001 May 12, 2020
7d689cf
feat(nks): reediting shorter or longer clips with empty frames
jakubjezek001 May 12, 2020
8f3f3a4
feat(nks): PR comments
jakubjezek001 May 12, 2020
4342db7
feat(nks): adding comment making more clear the process
jakubjezek001 May 12, 2020
0d7ed78
feat(nks): resolving PR comment
jakubjezek001 May 12, 2020
eb28198
Merge branch 'develop' into feature/PYPE-654-nks-cut-reference-videos
jakubjezek001 May 13, 2020
77d3611
feat(nks): processing PR comments - better readability
jakubjezek001 May 13, 2020
aa0ae99
fix(nks): plugin should be in extract order.. previous was for testing
jakubjezek001 May 13, 2020
cb12a83
feat(nks): only copy codec if source should be shortened
jakubjezek001 May 13, 2020
1581536
fix(global): integrate didn't understand new Anatomy
jakubjezek001 May 13, 2020
f1dd4fc
fix(global): integrate swap order of padding request from anatomy
jakubjezek001 May 13, 2020
59c5f36
fix(nks): frame start was not correctly calculated
jakubjezek001 May 13, 2020
cb42c78
fix(nks): cutting videos added to own folder `cuts`
jakubjezek001 May 13, 2020
5bfafb2
fix(nks): don't add copy codec if -filter_complex added into cmd
jakubjezek001 May 15, 2020
0c5b7b7
Merge branch 'develop' into feature/PYPE-654-nks-cut-reference-videos
jakubjezek001 May 15, 2020
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
4 changes: 2 additions & 2 deletions pype/plugins/global/publish/extract_burnin.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class ExtractBurnin(pype.api.Extractor):
label = "Extract burnins"
order = pyblish.api.ExtractorOrder + 0.03
families = ["review", "burnin"]
hosts = ["nuke", "maya", "shell", "premiere"]
hosts = ["nuke", "maya", "shell", "nukestudio", "premiere"]
optional = True

def process(self, instance):
Expand Down Expand Up @@ -193,7 +193,7 @@ def process(self, instance):
self.log.debug("Output: {}".format(output))

repre_update = {
"anatomy_template": "render",
"anatomy_template": repre.get("anatomy_template", "render"),
"files": movieFileBurnin,
"name": repre["name"],
"tags": [x for x in repre["tags"] if x != "delete"]
Expand Down
13 changes: 10 additions & 3 deletions pype/plugins/global/publish/extract_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ class ExtractReview(pyblish.api.InstancePlugin):
label = "Extract Review"
order = pyblish.api.ExtractorOrder + 0.02
families = ["review"]
hosts = ["nuke", "maya", "shell", "premiere"]
hosts = ["nuke", "maya", "shell", "nukestudio", "premiere"]

outputs = {}
ext_filter = []
to_width = 1920
to_height = 1080

def process(self, instance):

def process(self, instance):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'ExtractReview.process' is too complex (40)
too many blank lines (2)

jakubjezek001 marked this conversation as resolved.
Show resolved Hide resolved
output_profiles = self.outputs or {}

inst_data = instance.data
Expand Down Expand Up @@ -82,6 +82,12 @@ def process(self, instance):
repre_new = repre.copy()
ext = profile.get("ext", None)
p_tags = profile.get('tags', [])

# append repre tags into profile tags
for t in tags:
if t not in p_tags:
p_tags.append(t)
iLLiCiTiT marked this conversation as resolved.
Show resolved Hide resolved

self.log.info("p_tags: `{}`".format(p_tags))

# adding control for presets to be sequence
Expand Down Expand Up @@ -175,7 +181,8 @@ def process(self, instance):
frame_start_handle = frame_start - handle_start
frame_end_handle = frame_end + handle_end
if isinstance(repre["files"], list):
if frame_start_handle != repre.get("detectedStart", frame_start_handle):
if frame_start_handle != repre.get(
"detectedStart", frame_start_handle):
frame_start_handle = repre.get("detectedStart")

# exclude handle if no handles defined
Expand Down
21 changes: 21 additions & 0 deletions pype/plugins/nukestudio/publish/collect_clip_resolution.py
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
})
77 changes: 50 additions & 27 deletions pype/plugins/nukestudio/publish/collect_clips.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,32 @@ def process(self, context):
track = item.parent()
source = item.source().mediaSource()
source_path = source.firstpath()
clip_in = int(item.timelineIn())
clip_out = int(item.timelineOut())
file_head = source.filenameHead()
file_info = next((f for f in source.fileinfos()), None)
source_first_frame = file_info.startFrame()
is_sequence = False

self.log.debug(
"__ assets_shared: {}".format(context.data["assetsShared"]))
match_range = next(
(k for k, v in context.data["assetsShared"].items()
if (v.get("_clipIn", 0) == clip_in)
and (v.get("_clipOut", 0) == clip_out)
), False)

if asset in str(match_range):
match_range = False

assert (not match_range), (
"matching clip: {asset}"
" timeline range ({clip_in}:{clip_out})"
" conflicting with {match_range}"
" >> rename any of clips to be the same as the other <<"
).format(
**locals())

if not source.singleFile():
self.log.info("Single file")
is_sequence = True
Expand Down Expand Up @@ -89,40 +110,42 @@ def process(self, context):
)

data.update({
"name": "{0}_{1}".format(track.name(), item.name()),
"item": item,
"source": source,
"timecodeStart": str(source.timecodeStart()),
"timelineTimecodeStart": str(sequence.timecodeStart()),
"sourcePath": source_path,
"sourceFileHead": file_head,
"isSequence": is_sequence,
"track": track.name(),
"trackIndex": track_index,
"sourceFirst": source_first_frame,
"effects": effects,
"sourceIn": int(item.sourceIn()),
"sourceOut": int(item.sourceOut()),
"mediaDuration": (int(item.sourceOut()) -
int(item.sourceIn())) + 1,
"clipIn": int(item.timelineIn()),
"clipOut": int(item.timelineOut()),
"clipDuration": (
int(item.timelineOut()) - int(
item.timelineIn())) + 1,
"asset": asset,
"family": "clip",
"families": [],
"handleStart": projectdata.get("handleStart", 0),
"handleEnd": projectdata.get("handleEnd", 0)})
"name": "{0}_{1}".format(track.name(), item.name()),
"item": item,
"source": source,
"timecodeStart": str(source.timecodeStart()),
"timelineTimecodeStart": str(sequence.timecodeStart()),
"sourcePath": source_path,
"sourceFileHead": file_head,
"isSequence": is_sequence,
"track": track.name(),
"trackIndex": track_index,
"sourceFirst": source_first_frame,
"effects": effects,
"sourceIn": int(item.sourceIn()),
"sourceOut": int(item.sourceOut()),
"mediaDuration": int(source.duration()),
"clipIn": clip_in,
"clipOut": clip_out,
"clipDuration": (
int(item.timelineOut()) - int(
item.timelineIn())) + 1,
"asset": asset,
"family": "clip",
"families": [],
"handleStart": projectdata.get("handleStart", 0),
"handleEnd": projectdata.get("handleEnd", 0)})

instance = context.create_instance(**data)

self.log.info("Created instance: {}".format(instance))
self.log.info("Created instance.data: {}".format(instance.data))
self.log.debug(">> effects: {}".format(instance.data["effects"]))

context.data["assetsShared"][asset] = dict()
context.data["assetsShared"][asset] = {
"_clipIn": clip_in,
"_clipOut": clip_out
}

# from now we are collecting only subtrackitems on
# track with no video items
Expand Down
18 changes: 10 additions & 8 deletions pype/plugins/nukestudio/publish/collect_frame_ranges.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,16 @@ def process(self, instance):

frame_end = frame_start + (timeline_out - timeline_in)

data.update(
{
"sourceInH": source_in_h,
"sourceOutH": source_out_h,
"frameStart": frame_start,
"frameEnd": frame_end,
"clipInH": timeline_in_h,
"clipOutH": timeline_out_h
data.update({
"sourceFirst": source_in_h,
"sourceInH": source_in_h,
"sourceOutH": source_out_h,
"frameStart": frame_start,
"frameEnd": frame_end,
"clipInH": timeline_in_h,
"clipOutH": timeline_out_h,
"clipDurationH": instance.data.get(
"clipDuration") + handle_start + handle_end
}
)
self.log.debug("__ data: {}".format(data))
Expand Down
12 changes: 11 additions & 1 deletion pype/plugins/nukestudio/publish/collect_framerate.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from pyblish import api


class CollectFramerate(api.ContextPlugin):
"""Collect framerate from selected sequence."""

Expand All @@ -9,4 +10,13 @@ class CollectFramerate(api.ContextPlugin):

def process(self, context):
sequence = context.data["activeSequence"]
context.data["fps"] = sequence.framerate().toFloat()
context.data["fps"] = self.get_rate(sequence)

def get_rate(self, sequence):
num, den = sequence.framerate().toRational()
rate = float(num) / float(den)

if rate.is_integer():
return rate

return round(rate, 3)
47 changes: 36 additions & 11 deletions pype/plugins/nukestudio/publish/collect_hierarchy_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@ def process(self, context):
assets_shared = context.data.get("assetsShared")
tags = instance.data.get("tags", None)
clip = instance.data["item"]
asset = instance.data.get("asset")
asset = instance.data["asset"]
sequence = context.data['activeSequence']
width = int(sequence.format().width())
height = int(sequence.format().height())
pixel_aspect = sequence.format().pixelAspect()
resolution_width = instance.data["resolutionWidth"]
resolution_height = instance.data["resolutionHeight"]
pixel_aspect = instance.data["pixelAspect"]
clip_in = instance.data["clipIn"]
clip_out = instance.data["clipOut"]
fps = context.data["fps"]

# build data for inner nukestudio project property
Expand Down Expand Up @@ -72,6 +74,24 @@ def process(self, context):

# and finding only hierarchical tag
if "hierarchy" in t_type.lower():
match = next(
(k for k, v in assets_shared.items()
if (v["_clipIn"] == clip_in)
and (v["_clipOut"] == clip_out)
), False)
jakubjezek001 marked this conversation as resolved.
Show resolved Hide resolved
self.log.warning("Clip matching name: {}".format(match))
self.log.debug(
"__ assets_shared[match]: {}".format(
assets_shared[match]))
# check if hierarchy key is in match
if not assets_shared[match].get("hierarchy"):
match = False
assert not match, (
"Two clips above each other with"
" hierarchy tag are not allowed"
" >> keep hierarchy tag only in one of them <<"
)

d_metadata = dict()
parents = list()

Expand All @@ -82,7 +102,8 @@ def process(self, context):
if "shot" in template.lower():
instance.data["asset"] = [
t for t in template.split('/')][-1]
template = "/".join([t for t in template.split('/')][0:-1])
template = "/".join(
[t for t in template.split('/')][0:-1])

# take template from Tag.note and break it into parts
template_split = template.split("/")
Expand Down Expand Up @@ -149,8 +170,12 @@ def process(self, context):
instance.data["hierarchy"] = hierarchy
instance.data["parents"] = parents

self.log.info(
"clip: {asset}[{clip_in}:{clip_out}]".format(
**locals()))
# adding to asset shared dict
self.log.debug("__ assets_shared: {}".format(assets_shared))
self.log.debug(
"__ assets_shared: {}".format(assets_shared))
if assets_shared.get(asset):
self.log.debug("Adding to shared assets: `{}`".format(
asset))
Expand All @@ -162,11 +187,11 @@ def process(self, context):
"asset": asset,
"hierarchy": hierarchy,
"parents": parents,
"resolutionWidth": width,
"resolutionHeight": height,
"resolutionWidth": resolution_width,
"resolutionHeight": resolution_height,
"pixelAspect": pixel_aspect,
"fps": fps,
"tasks": instance.data["tasks"]
"tasks": instance.data["tasks"]
})

# adding frame start if any on instance
Expand All @@ -175,8 +200,8 @@ def process(self, context):
asset_shared.update({
"startingFrame": start_frame
})


self.log.debug(
"assets_shared: {assets_shared}".format(**locals()))

class CollectHierarchyContext(pyblish.api.ContextPlugin):
'''Collecting Hierarchy from instaces and building
Expand Down
13 changes: 6 additions & 7 deletions pype/plugins/nukestudio/publish/collect_plates.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ def process(self, instance):
# adding SourceResolution if Tag was present
if instance.data.get("sourceResolution") and instance.data.get("main"):
item = instance.data["item"]
width = int(item.source().mediaSource().width())
height = int(item.source().mediaSource().height())
resolution_width = int(item.source().mediaSource().width())
resolution_height = int(item.source().mediaSource().height())
pixel_aspect = int(item.source().mediaSource().pixelAspect())

self.log.info("Source Width and Height are: `{0} x {1} : {2}`".format(
width, height, pixel_aspect))
resolution_width, resolution_height, pixel_aspect))
data.update({
"width": width,
"height": height,
"resolutionWidth": resolution_width,
"resolutionHeight": resolution_height,
"pixelAspect": pixel_aspect
})

Expand Down Expand Up @@ -185,8 +185,7 @@ def process(self, instance):
"frameEnd": instance.data["sourceOut"] - instance.data["sourceIn"] + 1,
'step': 1,
'fps': instance.context.data["fps"],
'preview': True,
'thumbnail': False,
'tags': ["preview"],
'name': "preview",
'ext': "mov",
}
Expand Down
Loading