1 # SPDX-FileCopyrightText: 2022-2023 Blender Foundation
3 # SPDX-License-Identifier: GPL-2.0-or-later
7 from bpy
.types
import (
12 from .synchro
import get_main_window
, validate_sync
, window_id
15 # ------------------------------------------------------
17 # ------------------------------------------------------
18 # ------------------------------------------------------------------
19 # Define panel class for manual switch parameters.
20 # ------------------------------------------------------------------
21 class STORYPENCIL_PT_Settings(Panel
):
22 bl_idname
= "STORYPENCIL_PT_Settings"
24 bl_space_type
= 'SEQUENCE_EDITOR'
26 bl_category
= 'Storypencil'
29 def poll(cls
, context
):
30 if context
.space_data
.view_type
!= 'SEQUENCER':
35 # ------------------------------
37 # ------------------------------
38 def draw(self
, context
):
40 layout
.use_property_split
= True
41 layout
.use_property_decorate
= False
44 class STORYPENCIL_PT_General(Panel
):
45 bl_idname
= "STORYPENCIL_PT_General"
47 bl_space_type
= 'SEQUENCE_EDITOR'
49 bl_category
= 'Storypencil'
50 bl_options
= {'DEFAULT_CLOSED'}
51 bl_parent_id
= "STORYPENCIL_PT_Settings"
54 def poll(cls
, context
):
55 if context
.space_data
.view_type
!= 'SEQUENCER':
60 # ------------------------------
62 # ------------------------------
63 def draw(self
, context
):
65 layout
.use_property_split
= True
66 layout
.use_property_decorate
= False
69 setup_ready
= scene
.storypencil_main_workspace
is not None
71 row
.alert
= not setup_ready
72 row
.prop(scene
, "storypencil_main_workspace", text
="VSE Workspace")
75 if scene
.storypencil_main_scene
is None:
77 row
.prop(scene
, "storypencil_main_scene", text
="VSE Scene")
82 if scene
.storypencil_main_workspace
and scene
.storypencil_edit_workspace
:
83 if scene
.storypencil_main_workspace
.name
== scene
.storypencil_edit_workspace
.name
:
85 if scene
.storypencil_edit_workspace
is None:
87 row
.prop(scene
, "storypencil_edit_workspace", text
="Drawing Workspace")
90 class STORYPENCIL_PT_RenderPanel(Panel
):
91 bl_label
= "Render Strips"
92 bl_space_type
= 'SEQUENCE_EDITOR'
94 bl_category
= 'Storypencil'
95 bl_parent_id
= "STORYPENCIL_PT_Settings"
98 def poll(cls
, context
):
99 if context
.space_data
.view_type
!= 'SEQUENCER':
104 def draw(self
, context
):
106 layout
.use_property_split
= True
107 layout
.use_property_decorate
= False
109 scene
= context
.scene
110 settings
= scene
.render
.image_settings
112 is_video
= settings
.file_format
in {'FFMPEG', 'AVI_JPEG', 'AVI_RAW'}
114 if scene
.storypencil_render_render_path
is None:
116 row
.prop(scene
, "storypencil_render_render_path")
119 row
.prop(scene
, "storypencil_render_onlyselected")
122 row
.prop(scene
.render
.image_settings
, "file_format")
124 if settings
.file_format
== 'FFMPEG':
126 row
.prop(scene
.render
.ffmpeg
, "format")
129 row
.enabled
= is_video
130 row
.prop(scene
.render
.ffmpeg
, "audio_codec")
133 row
.prop(scene
, "storypencil_add_render_strip")
136 row
.enabled
= scene
.storypencil_add_render_strip
137 row
.prop(scene
, "storypencil_render_channel")
141 row
.prop(scene
, "storypencil_render_step")
144 row
.prop(scene
, "storypencil_render_numbering")
147 row
.prop(scene
, "storypencil_add_render_byfolder")
150 # ------------------------------------------------------------------
151 # Define panel class for new base scene creation.
152 # ------------------------------------------------------------------
153 class STORYPENCIL_PT_SettingsNew(Panel
):
154 bl_idname
= "STORYPENCIL_PT_SettingsNew"
155 bl_label
= "New Scenes"
156 bl_space_type
= 'SEQUENCE_EDITOR'
157 bl_region_type
= 'UI'
158 bl_category
= 'Storypencil'
159 bl_parent_id
= "STORYPENCIL_PT_Settings"
162 def poll(cls
, context
):
163 if context
.space_data
.view_type
!= 'SEQUENCER':
168 # ------------------------------
170 # ------------------------------
171 def draw(self
, context
):
173 layout
.use_property_split
= True
174 layout
.use_property_decorate
= False
175 scene
= context
.scene
177 row
.prop(scene
, "storypencil_name_prefix", text
="Name Prefix")
179 row
.prop(scene
, "storypencil_name_suffix", text
="Name Suffix")
181 row
.prop(scene
, "storypencil_scene_duration", text
="Frames")
184 if scene
.storypencil_base_scene
is None:
186 row
.prop(scene
, "storypencil_base_scene", text
="Template Scene")
189 class STORYPENCIL_PT_ModePanel(Panel
):
190 bl_label
= "Edit Scenes"
191 bl_space_type
= 'SEQUENCE_EDITOR'
192 bl_region_type
= 'UI'
193 bl_category
= 'Storypencil'
194 bl_parent_id
= "STORYPENCIL_PT_Settings"
197 def poll(cls
, context
):
198 if context
.space_data
.view_type
!= 'SEQUENCER':
203 def draw(self
, context
):
205 layout
.use_property_split
= True
206 layout
.use_property_decorate
= False
208 wm
= bpy
.context
.window_manager
209 scene
= context
.scene
210 win_id
= window_id(context
.window
)
212 col
= layout
.column(align
=True)
213 col
.prop(scene
, "storypencil_mode", text
="Mode")
215 col
.prop(wm
.storypencil_settings
,
216 "show_main_strip_range", text
="Show Strip Range")
219 if scene
.storypencil_mode
== 'WINDOW':
220 if not validate_sync(window_manager
=wm
) or win_id
== wm
.storypencil_settings
.main_window_id
:
221 col
.prop(wm
.storypencil_settings
, "active",
222 text
="Timeline Synchronization")
224 if scene
.storypencil_mode
== 'SWITCH':
226 col
= layout
.column(heading
="Audio", align
=True)
227 col
.prop(scene
, "storypencil_copy_sounds", text
="Copy to Scene")
229 subcol
= col
.column(align
=True)
230 subcol
.prop(scene
, 'storypencil_skip_sound_mute')
231 subcol
.enabled
= scene
.storypencil_copy_sounds
is True or scene
.storypencil_mode
== 'WINDOW'