[Blender_Kitsu] Playblast shot with user viewport settings #11
@ -1,3 +1,6 @@
|
|||||||
|
import bpy
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
import contextlib
|
import contextlib
|
||||||
|
|
||||||
from blender_kitsu import (
|
from blender_kitsu import (
|
||||||
@ -197,3 +200,41 @@ def override_viewport_shading(self, context):
|
|||||||
sps.show_cavity = show_cavity
|
sps.show_cavity = show_cavity
|
||||||
sps.show_object_outline = show_object_outline
|
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
|
||||||
|
Loading…
Reference in New Issue
Block a user