[Blender_Kitsu] Publish VSE Edit as Revision on Kitsu #7

Merged
Nick Alberelli merged 28 commits from :feature/upload_render_to_kitsu into master 2023-04-17 19:02:15 +02:00
Showing only changes of commit 5be2785e81 - Show all commits

View File

@ -4,6 +4,37 @@ from blender_kitsu import (
prefs,
)
@contextlib.contextmanager
def override_render_format(self, context):
"""Overrides the render settings for playblast creation"""
rd = context.scene.render
# Format render settings.
percentage = rd.resolution_percentage
file_format = rd.image_settings.file_format
ffmpeg_constant_rate = rd.ffmpeg.constant_rate_factor
ffmpeg_codec = rd.ffmpeg.codec
ffmpeg_format = rd.ffmpeg.format
ffmpeg_audio_codec = rd.ffmpeg.audio_codec
try:
rd.resolution_percentage = 100
rd.image_settings.file_format = "FFMPEG"
rd.ffmpeg.constant_rate_factor = "HIGH"
rd.ffmpeg.codec = "H264"
rd.ffmpeg.format = "MPEG4"
rd.ffmpeg.audio_codec = "AAC"
yield
finally:
rd.resolution_percentage = percentage
rd.image_settings.file_format = file_format
rd.ffmpeg.codec = ffmpeg_codec
rd.ffmpeg.constant_rate_factor = ffmpeg_constant_rate
rd.ffmpeg.format = ffmpeg_format
rd.ffmpeg.audio_codec = ffmpeg_audio_codec
@contextlib.contextmanager
def override_render_path(self, context, render_file_path):
"""Overrides the render settings for playblast creation"""