Skip to content

Commit a9a0ee1

Browse files
committed
Colors were out due to recent API change.
1 parent 4913f44 commit a9a0ee1

File tree

6 files changed

+107
-30
lines changed

6 files changed

+107
-30
lines changed

__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
}
1111

1212
"""
13-
1413
RegEx Classname
1514
===============
1615
[A-Z][A-Z0-9_]*_{ABBREV}_[A-Za-z0-9_]+
@@ -42,6 +41,11 @@ def draw_callback_px_2d_cursor(self, context):
4241
v2 = [c2d[0] + 5, c2d[1]]
4342

4443
draw_line(v1, v2, 2, (1, 0, 0, 1))
44+
45+
v1 = [c2d[0], c2d[1] - 5]
46+
v2 = [c2d[0], c2d[1] + 5]
47+
48+
draw_line(v1, v2, 2, (1, 0, 0, 1))
4549

4650

4751
def Add_Icon_Pivot_Point(self, context):

operators/autocrop/autocrop.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,29 +37,29 @@ def execute(self, context):
3737

3838
group_box = get_group_box(strips)
3939

40-
all_strips = scene.sequence_editor.sequences_all
41-
inputs = []
42-
for strip in all_strips:
43-
if hasattr(strip, "input_1"):
44-
inputs.append(strip.input_1)
45-
if hasattr(strip, "input_2"):
46-
inputs.append(strip.input_2)
47-
48-
parents = []
49-
for strip in all_strips:
50-
if not strip in inputs and not strip.type == "SOUND":
51-
parents.append(strip)
40+
#all_strips = scene.sequence_editor.sequences_all
41+
#inputs = []
42+
#for strip in all_strips:
43+
# if hasattr(strip, "input_1"):
44+
# inputs.append(strip.input_1)
45+
# if hasattr(strip, "input_2"):
46+
# inputs.append(strip.input_2)
47+
48+
#parents = []
49+
#for strip in all_strips:
50+
# if not strip in inputs and not strip.type == "SOUND":
51+
# parents.append(strip)
5252

5353
min_left, max_right, min_bottom, max_top = group_box
5454

5555
total_width = max_right - min_left
5656
total_height = max_top - min_bottom
5757

58-
nontransforms = get_nontransforms(parents)
58+
nontransforms = get_nontransforms(strips)
5959
for strip in nontransforms:
6060
reposition_strip(strip, group_box)
6161

62-
transforms = get_transforms(parents)
62+
transforms = get_transforms(strips)
6363
for strip in transforms:
6464
reposition_transform_strip(strip, group_box)
6565

operators/select/select.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,32 @@
1515
from ..utils.draw import draw_line
1616

1717
def draw_select(self, context):
18-
theme = context.user_preferences.themes['Default']
19-
active_color = theme.view_3d.object_active
20-
select_color = theme.view_3d.object_selected
18+
#theme = context.user_preferences.themes['Default']
19+
#active_color = theme.view_3d.object_active
20+
#select_color = theme.view_3d.object_selected
21+
22+
active_color = (1.0, 0.5, 0, 1.0)
23+
select_color = (1.0, 0.25, 0, 1.0)
24+
2125
opacity = 0.9 - (self.seconds / self.fadeout_duration)
2226

2327
active_strip = context.scene.sequence_editor.active_strip
24-
28+
2529
offset_x, offset_y, fac, preview_zoom = get_preview_offset()
26-
30+
2731
for strip in context.selected_sequences:
2832
if strip == active_strip:
2933
color = (active_color[0], active_color[1], active_color[2], opacity)
3034
else:
3135
color = (select_color[0], select_color[1], select_color[2], opacity)
32-
36+
3337
corners = get_strip_corners(strip)
3438
vertices = []
3539
for corner in corners:
3640
corner_x = int(corner[0] * preview_zoom * fac) + offset_x
3741
corner_y = int(corner[1] * preview_zoom * fac) + offset_y
3842
vertices.append([corner_x, corner_y])
39-
43+
4044
draw_line(vertices[0], vertices[1], 2, color)
4145
draw_line(vertices[1], vertices[2], 2, color)
4246
draw_line(vertices[2], vertices[3], 2, color)

operators/utils/draw/draw_px_point.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@ def draw_px_point(self, context):
66
"""
77
Draws the handle seen when rotating or scaling
88
"""
9-
theme = context.user_preferences.themes['Default']
10-
active_color = theme.view_3d.object_active
11-
12-
color = (active_color[0], active_color[1], active_color[2], 1.0)
13-
9+
# Stopped working after API change --> theme = context.user_preferences.themes['Default']
10+
#active_color = theme.view_3d.object_active
11+
12+
#color = (active_color[0], active_color[1], active_color[2], 1.0)
13+
14+
color = (1.0, 0.5, 0, 1.0)
15+
1416
v1 = [self.center_area.x, self.center_area.y]
1517
v2 = [self.mouse_pos.x, self.mouse_pos.y]
16-
18+
1719
if self.mouse_pos != Vector([-1, -1]):
1820
draw_stippled_line(v1, v2, 2, 10, color)
1921
if hasattr(self, 'rot_prev'):

operators/utils/geometry/reposition_strip.py

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import bpy
2-
2+
from .get_strip_box import get_strip_box
33

44
def reposition_strip(strip, group_box):
55
"""
@@ -31,7 +31,74 @@ def reposition_strip(strip, group_box):
3131
if strip.use_translation:
3232
strip.transform.offset_x -= min_left
3333
strip.transform.offset_y -= min_bottom
34+
35+
# While this part works, it makes the strip blurry. Users shouldn't use this technique.
36+
"""
37+
if strip.type == "META":
38+
left, right, bottom, top = get_strip_box(strip)
39+
width = right - left
40+
height = top - bottom
41+
42+
fac_x = width / res_x
43+
fac_y = height / res_y
44+
45+
new_crop_left = int(strip.crop.min_x * fac_x)
46+
new_crop_right = int(strip.crop.max_x * fac_x)
47+
new_crop_top = int(strip.crop.max_y * fac_y)
48+
new_crop_bottom = int(strip.crop.min_y * fac_y)
49+
50+
strip.crop.min_x = new_crop_left
51+
strip.crop.max_x = new_crop_right
52+
strip.crop.min_y = new_crop_bottom
53+
strip.crop.max_y = new_crop_top
54+
55+
strip.use_float = True
56+
57+
bpy.ops.sequencer.select_all(action='DESELECT')
58+
scene.sequence_editor.active_strip = strip
59+
bpy.ops.sequencer.effect_strip_add(type="TRANSFORM")
60+
61+
transform_strip = bpy.context.scene.sequence_editor.active_strip
62+
transform_strip.name = "[TR]-%s" % strip.name
63+
64+
transform_strip.blend_type = 'ALPHA_OVER'
65+
transform_strip.blend_alpha = strip.blend_alpha
66+
67+
strip.mute = True
68+
69+
if strip.use_translation:
70+
transform_strip.scale_start_x = 1.0
71+
transform_strip.scale_start_y = 1.0
72+
73+
offset_x = strip.transform.offset_x
74+
offset_y = strip.transform.offset_y
3475
76+
flip_x = 1
77+
if strip.use_flip_x:
78+
flip_x = -1
79+
80+
flip_y = 1
81+
if strip.use_flip_y:
82+
flip_y = -1
83+
84+
delta_x = ((width / 2) / fac_x) - (width / 2)
85+
pos_x = offset_x + (width / 2) - (res_x / 2) + delta_x
86+
pos_x *= flip_x
87+
88+
delta_y = ((height / 2) / fac_y) - (height / 2)
89+
pos_y = offset_y + (height / 2) - (res_y / 2) + delta_y
90+
pos_y *= flip_y
91+
92+
if transform_strip.translation_unit == 'PERCENT':
93+
pos_x = (pos_x / res_x) * 100
94+
pos_y = (pos_y / res_y) * 100
95+
96+
transform_strip.translate_start_x = pos_x
97+
transform_strip.translate_start_y = pos_y
98+
99+
strip.use_translation = False
100+
"""
101+
35102
if not hasattr(strip, 'elements') and strip.use_crop:
36103
if strip.crop.min_x < available_width:
37104
available_width -= strip.crop.min_x

operators/utils/selection/get_visible_strips.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def get_visible_strips():
1212
sequence_editor = scene.sequence_editor
1313

1414
if len(scene.sequence_editor.meta_stack) > 0:
15-
strips = list(sequence_editor.meta_stack[-1].sequences)
15+
strips = list(sequence_editor.meta_stack[-1].sequences)
1616
else:
1717
strips = list(scene.sequence_editor.sequences)
1818

0 commit comments

Comments
 (0)