generated from stilobique/BlenderTemplate
Write a basic operator to generate the thumbnail
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import bpy
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
class ConfigRendering(bpy.types.Operator):
|
||||
"""Setup camera and rendering config"""
|
||||
bl_idname = 'graou_config.rendering_thumbnail'
|
||||
bl_label = 'Setup the blend file to be ready'
|
||||
|
||||
def __init__(self):
|
||||
self.scene = bpy.data.scenes['Scene']
|
||||
|
||||
def execute(self, context):
|
||||
self.set_camera_used()
|
||||
self.set_rendering_panel()
|
||||
self.set_output_file()
|
||||
|
||||
return {'FINISHED'}
|
||||
|
||||
def set_rendering_panel(self):
|
||||
self.scene.render.engine = 'BLENDER_EEVEE'
|
||||
self.scene.eevee.use_gtao = True
|
||||
self.scene.eevee.use_ssr = True
|
||||
self.scene.render.use_high_quality_normals = True
|
||||
self.scene.render.film_transparent = True
|
||||
|
||||
def set_output_file(self):
|
||||
self.scene.render.resolution_x = self.scene.render.resolution_y = 512
|
||||
self.scene.render.filepath = Path()
|
||||
|
||||
def set_camera_used(self):
|
||||
"""Find the best camera position"""
|
||||
pass
|
||||
Reference in New Issue
Block a user