Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
'''
TODO
align strip to the left (shift-s + -lenght)
'''
import bpy
import random
import math
import os, sys
from bpy.props import IntProperty
from bpy.props import FloatProperty
from bpy.props import EnumProperty
from bpy.props import BoolProperty
from bpy.props import StringProperty
from . import functions
from . import exiftool
# Initialization
def initSceneProperties(context, scn):
try:
if context.scene.scene_initialized == True:
return False
except AttributeError:
pass
bpy.types.Scene.default_slide_offset = IntProperty(
name='Offset',
description='Number of frames to slide',
min=-250, max=250,
default=0)
scn.default_slide_offset = 0
bpy.types.Scene.default_fade_duration = IntProperty(
name='Duration',
description='Number of frames to fade',
min=1, max=250,
default=scn.render.fps)
scn.default_fade_duration = scn.render.fps
bpy.types.Scene.default_fade_amount = FloatProperty(
name='Amount',
description='Maximum value of fade',
min=0.0,
max=100.0,
default=1.0)
scn.default_fade_amount = 1.0
bpy.types.Scene.default_distribute_offset = IntProperty(
name='Offset',
description='Number of frames between strip start frames',
min=1,
max=250,
default=2)
scn.default_distribute_offset = 2
bpy.types.Scene.default_distribute_reverse = BoolProperty(
name='Reverse Order',
description='Reverse the order of selected strips',
default=False)
scn.default_distribute_reverse = False
bpy.types.Scene.default_proxy_suffix = StringProperty(
name='default proxy suffix',
description='default proxy filename suffix',
default="-25")
scn.default_proxy_suffix = "-25"
bpy.types.Scene.default_proxy_extension = StringProperty(
name='default proxy extension',
description='default proxy file extension',
default=".mkv")
scn.default_proxy_extension = ".mkv"
bpy.types.Scene.default_proxy_path = StringProperty(
name='default proxy path',
description='default proxy file path (relative to original file)',
default="")
scn.default_proxy_path = ""
bpy.types.Scene.default_build_25 = BoolProperty(
name='default_build_25',
description='default build_25',
default=True)
scn.default_build_25 = True
bpy.types.Scene.default_build_50 = BoolProperty(
name='default_build_50',
description='default build_50',
default=False)
scn.default_build_50 = False
bpy.types.Scene.default_build_75 = BoolProperty(
name='default_build_75',
description='default build_75',
default=False)
scn.default_build_75 = False
bpy.types.Scene.default_build_100 = BoolProperty(
name='default_build_100',
description='default build_100',
default=False)
scn.default_build_100 = False
bpy.types.Scene.default_recursive = BoolProperty(
name='Recursive',
description='Load in recursive folders',
default=False)
scn.default_recursive = False
bpy.types.Scene.default_recursive_proxies = BoolProperty(
name='Recursive proxies',
description='Load in recursive folders + proxies',
default=False)
scn.default_recursive_proxies = False
bpy.types.Scene.default_recursive_select_by_extension = BoolProperty(
name='Recursive ext',
description='Load only clips with selected extension',
default=False)
scn.default_recursive_select_by_extension = False
bpy.types.Scene.default_ext = EnumProperty(
items=functions.movieextdict,
name="ext enum",
default="3")
scn.default_ext = "3"
bpy.types.Scene.scene_initialized = BoolProperty(
name='Init',
default=False)
scn.scene_initialized = True
return True
# TRIM TIMELINE
class Sequencer_Extra_TrimTimeline(bpy.types.Operator):
bl_label = 'Trim to Timeline Content'
bl_idname = 'timeextra.trimtimeline'
bl_description = 'Automatically set start and end frames'
bl_options = {'REGISTER', 'UNDO'}
@classmethod
def poll(self, context):
scn = context.scene
if scn and scn.sequence_editor:
return scn.sequence_editor.sequences
else:
return False
def execute(self, context):
scn = context.scene
seq = scn.sequence_editor
meta_level = len(seq.meta_stack)
if meta_level > 0:
seq = seq.meta_stack[meta_level - 1]
frame_start = 300000
frame_end = -300000
for i in seq.sequences:
try:
if i.frame_final_start < frame_start:
frame_start = i.frame_final_start
if i.frame_final_end > frame_end:
frame_end = i.frame_final_end - 1
except AttributeError:
pass
if frame_start != 300000:
scn.frame_start = frame_start
if frame_end != -300000:
scn.frame_end = frame_end
return {'FINISHED'}
Loading
Loading full blame...