mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 13:24:54 +01:00
(feat) add maya burnins to all reviews
This commit is contained in:
parent
569272c02a
commit
f75a156405
3 changed files with 31 additions and 28 deletions
|
|
@ -281,7 +281,7 @@ def collect_animation_data():
|
|||
data = OrderedDict()
|
||||
data["startFrame"] = start
|
||||
data["endFrame"] = end
|
||||
data["handles"] = 1
|
||||
data["handles"] = 0
|
||||
data["step"] = 1.0
|
||||
data["fps"] = fps
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
import os
|
||||
import subprocess
|
||||
import contextlib
|
||||
|
||||
import json
|
||||
import capture_gui
|
||||
import clique
|
||||
|
||||
import pype.maya.lib as lib
|
||||
reload(lib)
|
||||
import pype.api
|
||||
import avalon.maya
|
||||
|
||||
|
|
@ -109,9 +108,10 @@ class ExtractQuicktime(pype.api.Extractor):
|
|||
self.log.info("input {}".format(input_path))
|
||||
|
||||
movieFile = filename + ".mov"
|
||||
# movieFileBurnin = filename + "Burn" + ".mov"
|
||||
movieFileBurnin = filename + "Burn" + ".mov"
|
||||
|
||||
full_movie_path = os.path.join(stagingdir, movieFile)
|
||||
full_burnin_path = os.path.join(stagingdir, movieFileBurnin)
|
||||
self.log.info("output {}".format(full_movie_path))
|
||||
with avalon.maya.suspended_refresh():
|
||||
try:
|
||||
|
|
@ -128,14 +128,27 @@ class ExtractQuicktime(pype.api.Extractor):
|
|||
self.log.error(ffmpeg_error)
|
||||
raise RuntimeError(ffmpeg_error)
|
||||
|
||||
# burnin_data = {
|
||||
# "username": 'milan.kolar',
|
||||
# "shot": 'sh010',
|
||||
# "task": 'layout'
|
||||
# }
|
||||
#
|
||||
# full_burnin_path = os.path.join(stagingdir, movieFileBurnin)
|
||||
# otio_burnin.burnins_from_data(full_movie_path, full_burnin_path, burnin_data)
|
||||
version = instance.context.data['version']
|
||||
|
||||
burnin_data = {
|
||||
"input": full_movie_path.replace("\\", "/"),
|
||||
"output": full_burnin_path.replace("\\", "/"),
|
||||
"burnin_data": {
|
||||
"username": instance.context.data['user'],
|
||||
"asset": os.environ['AVALON_ASSET'],
|
||||
"task": os.environ['AVALON_TASK'],
|
||||
"start_frame": int(instance.data['startFrame']),
|
||||
"version": "v" + str(version)
|
||||
}
|
||||
}
|
||||
|
||||
json_data = json.dumps(burnin_data)
|
||||
scriptpath = os.path.join(os.environ['PYPE_MODULE_ROOT'], "pype", "scripts", "otio_burnin.py")
|
||||
|
||||
p = subprocess.Popen(
|
||||
['python', scriptpath, json_data]
|
||||
)
|
||||
p.wait()
|
||||
|
||||
if "representations" not in instance.data:
|
||||
instance.data["representations"] = []
|
||||
|
|
@ -143,7 +156,7 @@ class ExtractQuicktime(pype.api.Extractor):
|
|||
representation = {
|
||||
'name': 'mov',
|
||||
'ext': 'mov',
|
||||
'files': movieFile,
|
||||
'files': movieFileBurnin,
|
||||
"stagingDir": stagingdir,
|
||||
'startFrame': start,
|
||||
'endFrame': end,
|
||||
|
|
|
|||
|
|
@ -321,18 +321,8 @@ def burnins_from_data(input_path, output_path, data, overwrite=True):
|
|||
burnin.render(output_path, overwrite=overwrite)
|
||||
|
||||
|
||||
'''
|
||||
# TODO: implement image sequence
|
||||
# Changes so OpenTimelineIo burnins is possible to render from image sequence.
|
||||
#
|
||||
# before input:
|
||||
# # -start_number is number of first frame / -r is fps
|
||||
# -start_number 375 -r 25
|
||||
# before output:
|
||||
# # -c: set output codec (h264, ...)
|
||||
# -c:v libx264
|
||||
#
|
||||
#
|
||||
# ffmpeg -loglevel panic -i image_sequence -vf "drawtext=text='Test':x=w/2-tw/2:y=0:fontcolor=white@1.0:fontsize=42:fontfile='C\:\\\WINDOWS\\\Fonts\\\arial.ttf':box=1:boxborderw=5:boxcolor=black@0.5,drawtext=text='%{eif\:n+1001\:d}':x=0:y=0:fontcolor=white@1.0:fontsize=42:fontfile='C\:\\\WINDOWS\\\Fonts\\\arial.ttf':box=1:boxborderw=5:boxcolor=black@0.5" C:\Users\jakub.trllo\Desktop\Tests\files\mov\render\test_output.mov'
|
||||
# ffmpeg -loglevel panic -start_number 375 -r 25 -i "C:\Users\jakub.trllo\Desktop\Tests\files\exr\int_c022_lighting_v001_main_AO.%04d.exr" -vf "drawtext=text='Test':x=w/2-tw/2:y=0:fontcolor=white@1.0:fontsize=42:fontfile='C\:\\\WINDOWS\\\Fonts\\\arial.ttf':box=1:boxborderw=5:boxcolor=black@0.5,drawtext=text='%{eif\:n+1001\:d}':x=0:y=0:fontcolor=white@1.0:fontsize=42:fontfile='C\:\\\WINDOWS\\\Fonts\\\arial.ttf':box=1:boxborderw=5:boxcolor=black@0.5,colormatrix=bt601:bt709" -c:v libx264 "output_path.mov"
|
||||
'''
|
||||
if __name__ == '__main__':
|
||||
import sys
|
||||
import json
|
||||
data = json.loads(sys.argv[-1])
|
||||
burnins_from_data(data['input'], data['output'], data['burnin_data'])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue