[Blender_Kitsu] Playblast shot with user viewport settings #11

Merged
Nick Alberelli merged 4 commits from :feature/playblast-shot-user-settings into master 2023-04-18 15:41:34 +02:00
Showing only changes of commit b5cd25485b - Show all commits

View File

@ -1,3 +1,6 @@
import bpy
from pathlib import Path
import contextlib
from blender_kitsu import (
@ -196,4 +199,42 @@ def override_viewport_shading(self, context):
sps.show_shadows = show_shadows
sps.show_cavity = show_cavity
sps.show_object_outline = show_object_outline
sps.show_specular_highlight = show_specular_highlight
sps.show_specular_highlight = show_specular_highlight
def playblast_with_shading_settings(self, context, file_path):
# Render and save playblast
with override_render_path(self, context, file_path):
with override_render_format(self, context,):
with override_metadata_stamp_settings(self, context):
with override_hide_viewport_gizmos(self, context):
with override_viewport_shading(self, context):
# Get output path.
output_path = Path(file_path)
# Ensure folder exists.
Path(context.scene.kitsu.playblast_dir).mkdir(
parents=True, exist_ok=True)
# Make opengl render.
bpy.ops.render.opengl(animation=True)
return output_path
def playblast_user_shading_settings(self, context, file_path):
# Render and save playblast
with override_render_path(self, context, file_path):
with override_render_format(self, context,):
with override_metadata_stamp_settings(self, context):
with override_hide_viewport_gizmos(self, context):
# Get output path.
output_path = Path(file_path)
# Ensure folder exists.
Path(context.scene.kitsu.playblast_dir).mkdir(
parents=True, exist_ok=True)
# Make opengl render.
bpy.ops.render.opengl(animation=True)
return output_path