Skip to content

Commit e6b0987

Browse files
committed
Allow alpha keyframing for nontransforms, hide non-applicable keyframe options
1 parent ff607d6 commit e6b0987

File tree

3 files changed

+35
-24
lines changed

3 files changed

+35
-24
lines changed

__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"name": "VSE Transform tool",
1515
"description": "",
1616
"author": "kgeogeo, DoubleZ, doakey3",
17-
"version": (1, 1, 7),
17+
"version": (1, 1, 8),
1818
"blender": (2, 7, 9),
1919
"wiki_url": "",
2020
"tracker_url": "",

operators/call_menu/insert_keyframe.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ def execute(self, context):
5454
seq.input_1.crop.keyframe_insert(
5555
data_path="max_y", frame=cf)
5656

57+
elif seq.select and not seq.type == "SOUND":
58+
seq.keyframe_insert(
59+
data_path="blend_alpha", frame=cf)
60+
5761
# Apparently redrawing is bad...
5862
# bpy.ops.wm.redraw_timer(type='DRAW_WIN_SWAP', iterations=1)
5963
# https://docs.blender.org/api/blender_python_api_2_78_release/info_gotcha.html

operators/call_menu/menu_insert_keyframe.py

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,40 +6,47 @@ class MenuInsertKeyframe(bpy.types.Menu):
66
bl_idname = "VSE_MT_Insert_keyframe_Menu"
77

88
def draw(self, context):
9+
types = []
10+
for strip in bpy.context.selected_sequences:
11+
types.append(strip.type)
12+
913
layout = self.layout
1014

11-
layout.operator("vse_transform_tools.insert_keyframe",
12-
text="Location").ch = (1, 0, 0, 0, 0)
15+
if "TRANSFORM" in types:
16+
layout.operator("vse_transform_tools.insert_keyframe",
17+
text="Location").ch = (1, 0, 0, 0, 0)
1318

14-
layout.operator("vse_transform_tools.insert_keyframe",
15-
text="Rotation").ch = (0, 1, 0, 0, 0)
19+
layout.operator("vse_transform_tools.insert_keyframe",
20+
text="Rotation").ch = (0, 1, 0, 0, 0)
1621

17-
layout.operator("vse_transform_tools.insert_keyframe",
18-
text="Scale").ch = (0, 0, 1, 0, 0)
22+
layout.operator("vse_transform_tools.insert_keyframe",
23+
text="Scale").ch = (0, 0, 1, 0, 0)
1924

20-
layout.operator("vse_transform_tools.insert_keyframe",
21-
text="LocRot").ch = (1, 1, 0, 0, 0)
25+
layout.operator("vse_transform_tools.insert_keyframe",
26+
text="LocRot").ch = (1, 1, 0, 0, 0)
2227

23-
layout.operator("vse_transform_tools.insert_keyframe",
24-
text="LocScale").ch =(1, 0, 1, 0, 0)
28+
layout.operator("vse_transform_tools.insert_keyframe",
29+
text="LocScale").ch =(1, 0, 1, 0, 0)
2530

26-
layout.operator("vse_transform_tools.insert_keyframe",
27-
text="RotScale").ch = (0, 1, 1, 0, 0)
31+
layout.operator("vse_transform_tools.insert_keyframe",
32+
text="RotScale").ch = (0, 1, 1, 0, 0)
2833

29-
layout.operator("vse_transform_tools.insert_keyframe",
30-
text="LocRotScale").ch = (1, 1, 1, 0, 0)
34+
layout.operator("vse_transform_tools.insert_keyframe",
35+
text="LocRotScale").ch = (1, 1, 1, 0, 0)
3136

32-
layout.separator()
37+
layout.separator()
3338

34-
layout.operator("vse_transform_tools.insert_keyframe",
35-
text="Alpha").ch = (0, 0, 0, 1, 0)
39+
layout.operator("vse_transform_tools.insert_keyframe",
40+
text="Crop").ch = (0, 0, 0, 0, 1)
3641

37-
layout.separator()
42+
layout.separator()
3843

39-
layout.operator("vse_transform_tools.insert_keyframe",
40-
text="CropScale").ch = (0, 0, 1, 0, 1)
44+
if not all(elem == "SOUND" for elem in types):
45+
layout.operator("vse_transform_tools.insert_keyframe",
46+
text="Alpha").ch = (0, 0, 0, 1, 0)
4147

42-
layout.separator()
48+
if "TRANSFORM" in types:
49+
layout.separator()
4350

44-
layout.operator("vse_transform_tools.insert_keyframe",
45-
text="All").ch = (1, 1, 1, 1, 1)
51+
layout.operator("vse_transform_tools.insert_keyframe",
52+
text="All").ch = (1, 1, 1, 1, 1)

0 commit comments

Comments
 (0)