forked from Lancealittlebit4/quick-drop-shadow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path__init__.py
61 lines (42 loc) · 1.95 KB
/
__init__.py
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
bl_info = {
"name": "Add Text Drop Shadow",
"version": (0, 1, 0),
"author": "Ian Letarte",
"blender": (4, 0, 0),
"description": "Add a nice drop shadow to your text strips in the VSE",
"category": "Sequencer",
}
import bpy
class AddTextDropShadowOperator(bpy.types.Operator):
bl_idname = "vse.add_text_drop_shadow"
bl_label = "Add Text Drop Shadow"
def execute(self, context):
# Check if there's a selected strip and if it's a text strip
selected_strip = context.scene.sequence_editor.active_strip
if selected_strip and selected_strip.type == 'TEXT':
# Duplicate the selected text strip and move it down two channels
bpy.ops.sequencer.duplicate_move()
bpy.ops.transform.seq_slide(value=(0, -2))
# Adjust the frame start and end of the duplicate text strip
duplicate_strip = context.active_sequence_strip
duplicate_strip.frame_final_start = selected_strip.frame_final_start
duplicate_strip.frame_final_end = selected_strip.frame_final_end
# Set the color of the duplicate text strip to black
context.active_sequence_strip.color = (0, 0, 0, 1)
#mute duplicate text
bpy.ops.sequencer.mute(unselected=False)
# Add a Gaussian blur effect strip and set its size
bpy.ops.sequencer.effect_strip_add(type='GAUSSIAN_BLUR')
context.active_sequence_strip.size_x = 30
context.active_sequence_strip.size_y = 30
return {'FINISHED'}
def menu_func(self, context):
self.layout.operator("vse.add_text_drop_shadow")
def register():
bpy.utils.register_class(AddTextDropShadowOperator)
bpy.types.SEQUENCER_MT_strip.append(menu_func)
def unregister():
bpy.utils.unregister_class(AddTextDropShadowOperator)
bpy.types.SEQUENCER_MT_strip.remove(menu_func)
if __name__ == "__main__":
register()