1 # SPDX-License-Identifier: GPL-2.0-or-later
5 from bpy
.types
import (
10 from .synchro
import get_main_window
, validate_sync
, window_id
13 # ------------------------------------------------------
15 # ------------------------------------------------------
16 # ------------------------------------------------------------------
17 # Define panel class for manual switch parameters.
18 # ------------------------------------------------------------------
19 class STORYPENCIL_PT_Settings(Panel
):
20 bl_idname
= "STORYPENCIL_PT_Settings"
22 bl_space_type
= 'SEQUENCE_EDITOR'
24 bl_category
= 'Storypencil'
27 def poll(cls
, context
):
28 if context
.space_data
.view_type
!= 'SEQUENCER':
33 # ------------------------------
35 # ------------------------------
36 def draw(self
, context
):
38 layout
.use_property_split
= True
39 layout
.use_property_decorate
= False
42 class STORYPENCIL_PT_General(Panel
):
43 bl_idname
= "STORYPENCIL_PT_General"
45 bl_space_type
= 'SEQUENCE_EDITOR'
47 bl_category
= 'Storypencil'
48 bl_options
= {'DEFAULT_CLOSED'}
49 bl_parent_id
= "STORYPENCIL_PT_Settings"
52 def poll(cls
, context
):
53 if context
.space_data
.view_type
!= 'SEQUENCER':
58 # ------------------------------
60 # ------------------------------
61 def draw(self
, context
):
63 layout
.use_property_split
= True
64 layout
.use_property_decorate
= False
67 setup_ready
= scene
.storypencil_main_workspace
is not None
69 row
.alert
= not setup_ready
70 row
.prop(scene
, "storypencil_main_workspace", text
="VSE Workspace")
73 if scene
.storypencil_main_scene
is None:
75 row
.prop(scene
, "storypencil_main_scene", text
="VSE Scene")
80 if scene
.storypencil_main_workspace
and scene
.storypencil_edit_workspace
:
81 if scene
.storypencil_main_workspace
.name
== scene
.storypencil_edit_workspace
.name
:
83 if scene
.storypencil_edit_workspace
is None:
85 row
.prop(scene
, "storypencil_edit_workspace", text
="Drawing Workspace")
88 class STORYPENCIL_PT_RenderPanel(Panel
):
89 bl_label
= "Render Strips"
90 bl_space_type
= 'SEQUENCE_EDITOR'
92 bl_category
= 'Storypencil'
93 bl_parent_id
= "STORYPENCIL_PT_Settings"
96 def poll(cls
, context
):
97 if context
.space_data
.view_type
!= 'SEQUENCER':
102 def draw(self
, context
):
104 layout
.use_property_split
= True
105 layout
.use_property_decorate
= False
107 scene
= context
.scene
108 settings
= scene
.render
.image_settings
110 is_video
= settings
.file_format
in {'FFMPEG', 'AVI_JPEG', 'AVI_RAW'}
112 if scene
.storypencil_render_render_path
is None:
114 row
.prop(scene
, "storypencil_render_render_path")
117 row
.prop(scene
, "storypencil_render_onlyselected")
120 row
.prop(scene
.render
.image_settings
, "file_format")
122 if settings
.file_format
== 'FFMPEG':
124 row
.prop(scene
.render
.ffmpeg
, "format")
127 row
.enabled
= is_video
128 row
.prop(scene
.render
.ffmpeg
, "audio_codec")
131 row
.prop(scene
, "storypencil_add_render_strip")
134 row
.enabled
= scene
.storypencil_add_render_strip
135 row
.prop(scene
, "storypencil_render_channel")
139 row
.prop(scene
, "storypencil_render_step")
142 row
.prop(scene
, "storypencil_render_numbering")
145 row
.prop(scene
, "storypencil_add_render_byfolder")
148 # ------------------------------------------------------------------
149 # Define panel class for new base scene creation.
150 # ------------------------------------------------------------------
151 class STORYPENCIL_PT_SettingsNew(Panel
):
152 bl_idname
= "STORYPENCIL_PT_SettingsNew"
153 bl_label
= "New Scenes"
154 bl_space_type
= 'SEQUENCE_EDITOR'
155 bl_region_type
= 'UI'
156 bl_category
= 'Storypencil'
157 bl_parent_id
= "STORYPENCIL_PT_Settings"
160 def poll(cls
, context
):
161 if context
.space_data
.view_type
!= 'SEQUENCER':
166 # ------------------------------
168 # ------------------------------
169 def draw(self
, context
):
171 layout
.use_property_split
= True
172 layout
.use_property_decorate
= False
173 scene
= context
.scene
175 row
.prop(scene
, "storypencil_name_prefix", text
="Name Prefix")
177 row
.prop(scene
, "storypencil_name_suffix", text
="Name Suffix")
179 row
.prop(scene
, "storypencil_scene_duration", text
="Frames")
182 if scene
.storypencil_base_scene
is None:
184 row
.prop(scene
, "storypencil_base_scene", text
="Template Scene")
187 class STORYPENCIL_PT_ModePanel(Panel
):
188 bl_label
= "Edit Scenes"
189 bl_space_type
= 'SEQUENCE_EDITOR'
190 bl_region_type
= 'UI'
191 bl_category
= 'Storypencil'
192 bl_parent_id
= "STORYPENCIL_PT_Settings"
195 def poll(cls
, context
):
196 if context
.space_data
.view_type
!= 'SEQUENCER':
201 def draw(self
, context
):
203 layout
.use_property_split
= True
204 layout
.use_property_decorate
= False
206 wm
= bpy
.context
.window_manager
207 scene
= context
.scene
208 win_id
= window_id(context
.window
)
210 col
= layout
.column(align
=True)
211 col
.prop(scene
, "storypencil_mode", text
="Mode")
213 col
.prop(wm
.storypencil_settings
,
214 "show_main_strip_range", text
="Show Strip Range")
217 if scene
.storypencil_mode
== 'WINDOW':
218 if not validate_sync(window_manager
=wm
) or win_id
== wm
.storypencil_settings
.main_window_id
:
219 col
.prop(wm
.storypencil_settings
, "active",
220 text
="Timeline Synchronization")
222 if scene
.storypencil_mode
== 'SWITCH':
224 col
= layout
.column(heading
="Audio", align
=True)
225 col
.prop(scene
, "storypencil_copy_sounds", text
="Copy to Scene")
227 subcol
= col
.column(align
=True)
228 subcol
.prop(scene
, 'storypencil_skip_sound_mute')
229 subcol
.enabled
= scene
.storypencil_copy_sounds
is True or scene
.storypencil_mode
== 'WINDOW'