Blender Kitsu: Refactor Shot Builder #183

Merged
Nick Alberelli merged 55 commits from TinyNick/blender-studio-pipeline:feature/shot-builder-2 into main 2023-12-21 23:58:21 +01:00
2 changed files with 13 additions and 1 deletions
Showing only changes of commit 6cb6a165c0 - Show all commits

View File

@ -7,6 +7,8 @@ from ..types import (
TaskType,
)
from ..cache import Project
from blender_kitsu import prefs
#################
@ -64,6 +66,14 @@ def remove_other_scenes(keep_scene_name: str) -> None:
bpy.data.scenes.remove(scene)
def set_resolution_and_fps(project: Project, scene: bpy.types.Scene):
scene.render.fps = project.fps # set fps
resolution = project.resolution.split('x')
scene.render.resolution_y = resolution[0]
scene.render.resolution_x = resolution[1]
scene.render.resolution_percentage = 100
def link_and_override_collection(
file_path: str, collection_name: str, scene: bpy.types.Scene
) -> bpy.types.Collection:

View File

@ -8,6 +8,7 @@ from .core import (
link_camera_rig,
task_type_anim_output_collection,
create_scene,
set_resolution_and_fps,
)
active_project = None
@ -133,7 +134,8 @@ class KITSU_OT_build_new_shot(bpy.types.Operator):
# Set Up Scene + Naming
shot_task_name = shot.get_shot_task_name(task_type)
create_scene(shot_task_name)
scene = create_scene(shot_task_name)
set_resolution_and_fps(active_project, scene)
# File Path
# TODO Only run if saving file