Skip to content

Commit

Permalink
Allow alpha keyframing for nontransforms, hide non-applicable keyfram…
Browse files Browse the repository at this point in the history
…e options
  • Loading branch information
doakey3 committed Mar 28, 2018
1 parent ff607d6 commit e6b0987
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 24 deletions.
2 changes: 1 addition & 1 deletion __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"name": "VSE Transform tool",
"description": "",
"author": "kgeogeo, DoubleZ, doakey3",
"version": (1, 1, 7),
"version": (1, 1, 8),
"blender": (2, 7, 9),
"wiki_url": "",
"tracker_url": "",
Expand Down
4 changes: 4 additions & 0 deletions operators/call_menu/insert_keyframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ def execute(self, context):
seq.input_1.crop.keyframe_insert(
data_path="max_y", frame=cf)

elif seq.select and not seq.type == "SOUND":
seq.keyframe_insert(
data_path="blend_alpha", frame=cf)

# Apparently redrawing is bad...
# bpy.ops.wm.redraw_timer(type='DRAW_WIN_SWAP', iterations=1)
# https://docs.blender.org/api/blender_python_api_2_78_release/info_gotcha.html
Expand Down
53 changes: 30 additions & 23 deletions operators/call_menu/menu_insert_keyframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,47 @@ class MenuInsertKeyframe(bpy.types.Menu):
bl_idname = "VSE_MT_Insert_keyframe_Menu"

def draw(self, context):
types = []
for strip in bpy.context.selected_sequences:
types.append(strip.type)

layout = self.layout

layout.operator("vse_transform_tools.insert_keyframe",
text="Location").ch = (1, 0, 0, 0, 0)
if "TRANSFORM" in types:
layout.operator("vse_transform_tools.insert_keyframe",
text="Location").ch = (1, 0, 0, 0, 0)

layout.operator("vse_transform_tools.insert_keyframe",
text="Rotation").ch = (0, 1, 0, 0, 0)
layout.operator("vse_transform_tools.insert_keyframe",
text="Rotation").ch = (0, 1, 0, 0, 0)

layout.operator("vse_transform_tools.insert_keyframe",
text="Scale").ch = (0, 0, 1, 0, 0)
layout.operator("vse_transform_tools.insert_keyframe",
text="Scale").ch = (0, 0, 1, 0, 0)

layout.operator("vse_transform_tools.insert_keyframe",
text="LocRot").ch = (1, 1, 0, 0, 0)
layout.operator("vse_transform_tools.insert_keyframe",
text="LocRot").ch = (1, 1, 0, 0, 0)

layout.operator("vse_transform_tools.insert_keyframe",
text="LocScale").ch =(1, 0, 1, 0, 0)
layout.operator("vse_transform_tools.insert_keyframe",
text="LocScale").ch =(1, 0, 1, 0, 0)

layout.operator("vse_transform_tools.insert_keyframe",
text="RotScale").ch = (0, 1, 1, 0, 0)
layout.operator("vse_transform_tools.insert_keyframe",
text="RotScale").ch = (0, 1, 1, 0, 0)

layout.operator("vse_transform_tools.insert_keyframe",
text="LocRotScale").ch = (1, 1, 1, 0, 0)
layout.operator("vse_transform_tools.insert_keyframe",
text="LocRotScale").ch = (1, 1, 1, 0, 0)

layout.separator()
layout.separator()

layout.operator("vse_transform_tools.insert_keyframe",
text="Alpha").ch = (0, 0, 0, 1, 0)
layout.operator("vse_transform_tools.insert_keyframe",
text="Crop").ch = (0, 0, 0, 0, 1)

layout.separator()
layout.separator()

layout.operator("vse_transform_tools.insert_keyframe",
text="CropScale").ch = (0, 0, 1, 0, 1)
if not all(elem == "SOUND" for elem in types):
layout.operator("vse_transform_tools.insert_keyframe",
text="Alpha").ch = (0, 0, 0, 1, 0)

layout.separator()
if "TRANSFORM" in types:
layout.separator()

layout.operator("vse_transform_tools.insert_keyframe",
text="All").ch = (1, 1, 1, 1, 1)
layout.operator("vse_transform_tools.insert_keyframe",
text="All").ch = (1, 1, 1, 1, 1)

0 comments on commit e6b0987

Please sign in to comment.