ai-agent-book 精选快照(<2MB 代码与文档,来自 github.com/bojieli/ai-agent-book)
Build latest book artifacts / build (push) Canceled after 0s
dependency resolution / resolve (3.11) (push) Canceled after 0s
dependency resolution / resolve (3.13) (push) Canceled after 0s
deploy-pages / build (push) Canceled after 0s
deploy-pages / deploy (push) Canceled after 0s
i18n consistency check / check (push) Canceled after 0s
provider adoption tests / test (chapter2/context-compression) (push) Canceled after 0s
provider adoption tests / test (chapter2/prompt-injection) (push) Canceled after 0s
provider adoption tests / test (chapter2/system-hint) (push) Canceled after 0s
provider adoption tests / test (chapter3/log-sanitization) (push) Canceled after 0s
web-search-agent tests / test (push) Canceled after 0s
web-search-agent tests / agentbook (push) Canceled after 0s
Build latest book artifacts / build (push) Canceled after 0s
dependency resolution / resolve (3.11) (push) Canceled after 0s
dependency resolution / resolve (3.13) (push) Canceled after 0s
deploy-pages / build (push) Canceled after 0s
deploy-pages / deploy (push) Canceled after 0s
i18n consistency check / check (push) Canceled after 0s
provider adoption tests / test (chapter2/context-compression) (push) Canceled after 0s
provider adoption tests / test (chapter2/prompt-injection) (push) Canceled after 0s
provider adoption tests / test (chapter2/system-hint) (push) Canceled after 0s
provider adoption tests / test (chapter3/log-sanitization) (push) Canceled after 0s
web-search-agent tests / test (push) Canceled after 0s
web-search-agent tests / agentbook (push) Canceled after 0s
This commit is contained in:
+84
@@ -0,0 +1,84 @@
|
||||
import bpy
|
||||
|
||||
# Clear existing objects to start fresh
|
||||
bpy.ops.object.select_all(action='SELECT')
|
||||
bpy.ops.object.delete()
|
||||
|
||||
# Configuration paths and parameters
|
||||
INPUT_MOVIE = "/Users/boj/book/ai-agent-book/chapter5/video-edit/validation/runs/exp5-6-real-blender-20260730-052206/source.mov"
|
||||
OUTPUT_MP4 = "/Users/boj/book/ai-agent-book/chapter5/video-edit/validation/runs/exp5-6-real-blender-20260730-052206/negative_control.mp4"
|
||||
SOURCE_FPS = 25
|
||||
TRIM_DURATION_SECONDS = 3.0
|
||||
SLOW_FACTOR = 1.5
|
||||
RENDER_RESOLUTION = (854, 480)
|
||||
|
||||
# Calculate frame values
|
||||
trim_frames = int(TRIM_DURATION_SECONDS * SOURCE_FPS)
|
||||
slowed_frames = int(trim_frames * SLOW_FACTOR)
|
||||
scene = bpy.context.scene
|
||||
|
||||
# Create sequence editor
|
||||
seq_ed = scene.sequence_editor_create()
|
||||
|
||||
# Add movie strip with trim
|
||||
movie_strip = seq_ed.sequences.new_movie(
|
||||
name="SourceVideo",
|
||||
filepath=INPUT_MOVIE,
|
||||
channel=1,
|
||||
frame_start=1
|
||||
)
|
||||
movie_strip.frame_offset_start = 0 # Start at beginning of source
|
||||
movie_strip.frame_final_duration = trim_frames # Trim to 3 seconds
|
||||
|
||||
# Locate and trim audio strip (auto-created with movie)
|
||||
sound_strip = None
|
||||
for strip in seq_ed.sequences:
|
||||
if strip.type == 'SOUND' and strip.channel == 2 and strip.frame_start == 1:
|
||||
sound_strip = strip
|
||||
if sound_strip:
|
||||
sound_strip.frame_final_duration = trim_frames # Keep audio at original speed
|
||||
|
||||
# Add speed effect to video (slow motion)
|
||||
speed_strip = seq_ed.sequences.new_effect(
|
||||
name="SlowMotion",
|
||||
type='SPEED',
|
||||
channel=3,
|
||||
frame_start=1,
|
||||
frame_end=1 + slowed_frames - 1,
|
||||
target=movie_strip
|
||||
)
|
||||
speed_strip.speed_control = 'MULTIPLY'
|
||||
speed_strip.speed_factor = 1 / SLOW_FACTOR # 1/1.5 speed factor
|
||||
|
||||
# Add subtitle text strip with background box
|
||||
text_strip = seq_ed.sequences.new_text(
|
||||
name="Subtitle",
|
||||
text="BIG BUNNY",
|
||||
channel=4,
|
||||
frame_start=1,
|
||||
frame_end=1 + slowed_frames - 1
|
||||
)
|
||||
text_strip.align_x = 'CENTER'
|
||||
text_strip.align_y = 'BOTTOM'
|
||||
text_strip.use_box = True
|
||||
text_strip.box_color = (0.0, 0.0, 0.0, 0.6) # Black semi-transparent box
|
||||
text_strip.font_size = 48 # Visible size for 854x480 resolution
|
||||
|
||||
# Configure render settings
|
||||
scene.render.resolution_x = RENDER_RESOLUTION[0]
|
||||
scene.render.resolution_y = RENDER_RESOLUTION[1]
|
||||
scene.render.resolution_percentage = 100
|
||||
scene.render.fps = SOURCE_FPS
|
||||
scene.render.fps_base = 1.0
|
||||
scene.render.image_settings.file_format = 'FFMPEG'
|
||||
scene.render.ffmpeg.format = 'MPEG4'
|
||||
scene.render.ffmpeg.codec = 'H264'
|
||||
scene.render.ffmpeg.audio_codec = 'AAC'
|
||||
scene.render.filepath = OUTPUT_MP4
|
||||
|
||||
# Set render frame range
|
||||
scene.frame_start = 1
|
||||
scene.frame_end = 1 + slowed_frames - 1
|
||||
|
||||
# Execute render
|
||||
bpy.ops.render.render(animation=True)
|
||||
+79
@@ -0,0 +1,79 @@
|
||||
import bpy
|
||||
|
||||
# Clear existing data
|
||||
bpy.ops.wm.read_factory_settings(use_empty=True)
|
||||
scene = bpy.context.scene
|
||||
|
||||
# Scene settings
|
||||
scene.render.resolution_x = 854
|
||||
scene.render.resolution_y = 480
|
||||
scene.render.resolution_percentage = 100
|
||||
scene.render.fps = 25
|
||||
scene.render.fps_base = 1.0
|
||||
|
||||
# Create sequence editor
|
||||
if not scene.sequence_editor:
|
||||
scene.sequence_editor_create()
|
||||
seq_ed = scene.sequence_editor
|
||||
sequences = seq_ed.sequences
|
||||
|
||||
# File paths
|
||||
input_movie = '/Users/boj/book/ai-agent-book/chapter5/video-edit/validation/runs/exp5-6-real-blender-20260730-052206/source.mov'
|
||||
output_mp4 = '/Users/boj/book/ai-agent-book/chapter5/video-edit/validation/runs/exp5-6-real-blender-20260730-052206/negative_control.mp4'
|
||||
|
||||
# Add movie strip (3 seconds = 75 frames at 25fps)
|
||||
mov_strip = sequences.new_movie(
|
||||
name='SourceMovie',
|
||||
filepath=input_movie,
|
||||
frame_start=1,
|
||||
channel=1
|
||||
)
|
||||
mov_strip.frame_offset_start = 0
|
||||
mov_strip.frame_final_duration = 75 # 3s * 25fps
|
||||
|
||||
# Locate and trim sound strip
|
||||
sound_strip = next((s for s in sequences if s.type == 'SOUND' and s.frame_start == mov_strip.frame_start), None)
|
||||
if sound_strip:
|
||||
sound_strip.frame_final_duration = 75 # Keep original audio duration
|
||||
|
||||
# Add speed effect (1.5x slowdown)
|
||||
speed_strip = sequences.new_effect(
|
||||
name='SlowMotion',
|
||||
type='SPEED',
|
||||
frame_start=1,
|
||||
channel=2,
|
||||
input_1=mov_strip
|
||||
)
|
||||
speed_strip.speed_control = 'MULTIPLY'
|
||||
speed_strip.speed_factor = 1 / 1.5
|
||||
|
||||
# Calculate slowed duration (4.5s = 112.5 frames → 113 frames)
|
||||
slowed_frames = int(4.5 * 25) + 1
|
||||
scene.frame_start = 1
|
||||
scene.frame_end = slowed_frames
|
||||
|
||||
# Add subtitle text strip
|
||||
text_strip = sequences.new_effect(
|
||||
name='Subtitle',
|
||||
type='TEXT',
|
||||
frame_start=1,
|
||||
frame_end=scene.frame_end,
|
||||
channel=3
|
||||
)
|
||||
text_strip.text = 'BIG BUNNY'
|
||||
text_strip.align_x = 'CENTER'
|
||||
text_strip.align_y = 'BOTTOM'
|
||||
text_strip.use_box = True
|
||||
text_strip.box_color = (0, 0, 0, 0.6)
|
||||
text_strip.font_size = 48
|
||||
|
||||
# Render settings
|
||||
scene.render.filepath = output_mp4
|
||||
scene.render.image_settings.file_format = 'FFMPEG'
|
||||
scene.render.ffmpeg.format = 'MPEG4'
|
||||
scene.render.ffmpeg.codec = 'H264'
|
||||
scene.render.ffmpeg.audio_codec = 'AAC'
|
||||
scene.render.ffmpeg.constant_rate_factor = 'MEDIUM'
|
||||
|
||||
# Render animation
|
||||
bpy.ops.render.render(animation=True)
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
import bpy
|
||||
import os
|
||||
|
||||
# Clear default objects
|
||||
bpy.ops.object.select_all(action='SELECT')
|
||||
bpy.ops.object.delete()
|
||||
|
||||
# Set up scene
|
||||
scene = bpy.context.scene
|
||||
scene.render.fps = 25
|
||||
scene.render.fps_base = 1.0
|
||||
scene.render.resolution_x = 854
|
||||
scene.render.resolution_y = 480
|
||||
scene.render.resolution_percentage = 100
|
||||
|
||||
# Configure output settings
|
||||
scene.render.image_settings.file_format = 'FFMPEG'
|
||||
scene.render.ffmpeg.format = 'MPEG4'
|
||||
scene.render.ffmpeg.codec = 'H264'
|
||||
scene.render.ffmpeg.audio_codec = 'AAC'
|
||||
scene.render.ffmpeg.audio_bitrate = 192
|
||||
output_path = '/Users/boj/book/ai-agent-book/chapter5/video-edit/validation/runs/exp5-6-real-blender-20260730-052206/negative_control.mp4'
|
||||
scene.render.filepath = output_path
|
||||
|
||||
# Create sequence editor
|
||||
scene.sequence_editor_create()
|
||||
sequences = scene.sequence_editor.sequences
|
||||
|
||||
# Import source movie and sound
|
||||
source_path = '/Users/boj/book/ai-agent-book/chapter5/video-edit/validation/runs/exp5-6-real-blender-20260730-052206/source.mov'
|
||||
movie_strip = sequences.new_movie(name='SourceMovie', filepath=source_path, channel=1, frame_start=0)
|
||||
|
||||
sound_strip = None
|
||||
for strip in sequences:
|
||||
if strip.type == 'SOUND' and strip.name.startswith('SourceMovie'):
|
||||
sound_strip = strip
|
||||
break
|
||||
if not sound_strip:
|
||||
sound_strip = sequences.new_sound(name='SourceAudio', filepath=source_path, channel=2, frame_start=0)
|
||||
|
||||
# Trim to 3-second interval (75 frames at 25fps)
|
||||
trim_frames = 75 # 3.0s * 25fps
|
||||
movie_strip.frame_start = 0
|
||||
movie_strip.frame_final_duration = trim_frames
|
||||
sound_strip.frame_start = 0
|
||||
sound_strip.frame_final_duration = trim_frames
|
||||
|
||||
# Apply speed effect (1.5x slowdown = 4.5s output)
|
||||
speed_strip = sequences.new_effect(
|
||||
name='SpeedControl',
|
||||
type='SPEED',
|
||||
channel=2,
|
||||
frame_start=0,
|
||||
frame_end=113, # 75 frames * 1.5 = 112.5 → 113 frames
|
||||
seq1=movie_strip,
|
||||
seq2=None
|
||||
)
|
||||
speed_strip.speed_control = 'MULTIPLY'
|
||||
speed_strip.speed_factor = 1/1.5
|
||||
|
||||
# Set scene frame range
|
||||
duration_frames = 113 # 4.5s * 25fps = 112.5 → 113 frames
|
||||
scene.frame_start = 0
|
||||
scene.frame_end = duration_frames
|
||||
|
||||
# Add subtitle with background box
|
||||
text_strip = sequences.new_effect(
|
||||
name='Subtitle',
|
||||
type='TEXT',
|
||||
channel=3,
|
||||
frame_start=0,
|
||||
frame_end=duration_frames,
|
||||
seq1=None,
|
||||
seq2=None
|
||||
)
|
||||
text_strip.text = 'BIG BUNNY'
|
||||
text_strip.align_x = 'CENTER'
|
||||
text_strip.align_y = 'BOTTOM'
|
||||
text_strip.use_box = True
|
||||
text_strip.box_color = (0.0, 0.0, 0.0, 0.6)
|
||||
text_strip.font_size = 48
|
||||
|
||||
# Render animation
|
||||
bpy.ops.render.render(animation=True)
|
||||
+90
@@ -0,0 +1,90 @@
|
||||
import bpy
|
||||
import os
|
||||
|
||||
# Clear existing data
|
||||
bpy.ops.wm.read_factory_settings(use_empty=True)
|
||||
|
||||
# Get the current scene
|
||||
scene = bpy.context.scene
|
||||
|
||||
# Set render resolution (854x480 for H.264 even width)
|
||||
scene.render.resolution_x = 854
|
||||
scene.render.resolution_y = 480
|
||||
scene.render.resolution_percentage = 100
|
||||
|
||||
# Set frame rate (25 FPS)
|
||||
scene.render.fps = 25
|
||||
scene.render.fps_base = 1.0
|
||||
|
||||
# Output settings
|
||||
output_path = '/Users/boj/book/ai-agent-book/chapter5/video-edit/validation/runs/exp5-6-real-blender-20260730-052206/negative_control.mp4'
|
||||
scene.render.filepath = output_path
|
||||
scene.render.image_settings.file_format = 'FFMPEG'
|
||||
scene.render.ffmpeg.format = 'MPEG4'
|
||||
scene.render.ffmpeg.codec = 'H.264'
|
||||
scene.render.ffmpeg.audio_codec = 'AAC'
|
||||
scene.render.ffmpeg.audio_mixrate = 44100
|
||||
scene.render.ffmpeg.audio_bitrate = 192
|
||||
scene.render.use_audio = True
|
||||
|
||||
# Create sequence editor
|
||||
scene.sequence_editor_create()
|
||||
seq_ed = scene.sequence_editor
|
||||
|
||||
# Source movie path
|
||||
source_path = '/Users/boj/book/ai-agent-book/chapter5/video-edit/validation/runs/exp5-6-real-blender-20260730-052206/source.mov'
|
||||
|
||||
# Add video strip with trim (0.000-3.000s = 75 frames @25FPS)
|
||||
video_strip = seq_ed.sequences.new_movie(
|
||||
name='Video',
|
||||
filepath=source_path,
|
||||
channel=1,
|
||||
frame_start=1
|
||||
)
|
||||
video_strip.frame_offset_start = 0 # Start at 0s of source
|
||||
video_strip.frame_final_duration = 75 # Trim to 3s (75 frames)
|
||||
|
||||
# Add SPEED effect for slow motion (1.5x duration)
|
||||
speed_effect = seq_ed.sequences.new_effect(
|
||||
name='SpeedControl',
|
||||
type='SPEED',
|
||||
channel=2,
|
||||
frame_start=1,
|
||||
seq1=video_strip
|
||||
)
|
||||
speed_effect.speed_control = 'MULTIPLY'
|
||||
speed_effect.speed_factor = 1/1.5 # Slow playback speed
|
||||
|
||||
# Extend video duration to 1.5x trimmed interval (4.5s = 112.5 frames → 113 frames)
|
||||
video_strip.frame_final_duration = 113
|
||||
|
||||
# Configure audio strip (trim to original 3s duration)
|
||||
sound_strip = None
|
||||
for strip in seq_ed.sequences:
|
||||
if strip.type == 'SOUND' and strip.name.startswith('Audio'):
|
||||
sound_strip = strip
|
||||
if sound_strip:
|
||||
sound_strip.frame_offset_start = 0 # Start at 0s of source audio
|
||||
sound_strip.frame_final_duration = 75 # Keep original 3s duration
|
||||
|
||||
# Add subtitle text strip with background box
|
||||
text_strip = seq_ed.sequences.new_effect(
|
||||
name='Subtitle',
|
||||
type='TEXT',
|
||||
channel=3,
|
||||
frame_start=1,
|
||||
frame_final_duration=113
|
||||
)
|
||||
text_strip.text = 'BIG BUNNY'
|
||||
text_strip.align_x = 'CENTER'
|
||||
text_strip.align_y = 'BOTTOM'
|
||||
text_strip.use_box = True
|
||||
text_strip.box_color = (0, 0, 0, 0.6) # Semi-transparent black box
|
||||
text_strip.font_size = 48
|
||||
|
||||
# Set scene frame range to match slowed video duration
|
||||
scene.frame_start = 1
|
||||
scene.frame_end = 113
|
||||
|
||||
# Render the animation
|
||||
bpy.ops.render.render(animation=True)
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
import bpy
|
||||
|
||||
# Clear existing data
|
||||
bpy.ops.wm.read_factory_settings(use_empty=True)
|
||||
|
||||
# Get the scene
|
||||
scene = bpy.context.scene
|
||||
|
||||
# Set render resolution and FPS
|
||||
scene.render.resolution_x = 854
|
||||
scene.render.resolution_y = 480
|
||||
scene.render.resolution_percentage = 100
|
||||
scene.render.fps = 25
|
||||
scene.render.fps_base = 1.0
|
||||
|
||||
# Set output settings
|
||||
output_path = "/Users/boj/book/ai-agent-book/chapter5/video-edit/validation/runs/exp5-6-real-blender-20260730-052206/negative_control.mp4"
|
||||
scene.render.filepath = output_path
|
||||
scene.render.image_settings.file_format = 'FFMPEG'
|
||||
scene.render.ffmpeg.format = 'MPEG4'
|
||||
scene.render.ffmpeg.codec = 'H264'
|
||||
scene.render.ffmpeg.audio_codec = 'AAC'
|
||||
scene.render.ffmpeg.constant_rate_factor = 'MEDIUM'
|
||||
|
||||
# Create sequence editor
|
||||
seq_ed = scene.sequence_editor_create()
|
||||
|
||||
# Import movie strip
|
||||
movie_path = "/Users/boj/book/ai-agent-book/chapter5/video-edit/validation/runs/exp5-6-real-blender-20260730-052206/source.mov"
|
||||
movie_strip = seq_ed.sequences.new_movie(
|
||||
name="SourceMovie",
|
||||
filepath=movie_path,
|
||||
channel=1,
|
||||
frame_start=0
|
||||
)
|
||||
|
||||
# Trim movie to [0.000, 3.000] seconds (75 frames at 25 FPS)
|
||||
movie_strip.frame_offset_start = 0
|
||||
movie_strip.frame_final_duration = 75
|
||||
|
||||
# Add speed control effect
|
||||
speed_strip = seq_ed.sequences.new_effect(
|
||||
name="SpeedControl",
|
||||
type='SPEED',
|
||||
channel=2,
|
||||
frame_start=0,
|
||||
frame_end=movie_strip.frame_start + movie_strip.frame_final_duration,
|
||||
seq1=movie_strip
|
||||
)
|
||||
speed_strip.speed_control = 'MULTIPLY'
|
||||
speed_strip.speed_factor = 1 / 1.5 # Slow down by 1.5x
|
||||
|
||||
# Find sound strip and trim it
|
||||
sound_strip = None
|
||||
for strip in seq_ed.sequences:
|
||||
if strip.type == 'SOUND' and strip.frame_start == movie_strip.frame_start:
|
||||
sound_strip = strip
|
||||
break
|
||||
if sound_strip:
|
||||
sound_strip.frame_offset_start = 0
|
||||
sound_strip.frame_final_duration = 75 # Keep sound at normal duration
|
||||
|
||||
# Calculate render duration: 3s * 1.5 = 4.5s = 112.5 frames → 113 frames (0-112)
|
||||
scene.frame_start = 0
|
||||
scene.frame_end = 113 # 113 frames total
|
||||
|
||||
# Add subtitle text strip
|
||||
text_strip = seq_ed.sequences.new_effect(
|
||||
name="Subtitle",
|
||||
type='TEXT',
|
||||
channel=3,
|
||||
frame_start=0,
|
||||
frame_end=scene.frame_end
|
||||
)
|
||||
text_strip.text = "BIG BUNNY"
|
||||
text_strip.align_x = 'CENTER'
|
||||
text_strip.align_y = 'BOTTOM'
|
||||
text_strip.font_size = 48
|
||||
text_strip.color = (1, 1, 1, 1) # White text
|
||||
text_strip.use_box = True
|
||||
text_strip.box_color = (0, 0, 0, 0.6) # Dark semi-transparent box
|
||||
|
||||
# Render animation
|
||||
scene.render.engine = 'BLENDER_EEVEE'
|
||||
bpy.ops.render.render(animation=True)
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
import bpy
|
||||
import math
|
||||
|
||||
# Clear existing objects
|
||||
bpy.ops.object.select_all(action='SELECT')
|
||||
bpy.ops.object.delete()
|
||||
|
||||
# File paths
|
||||
input_path = '/Users/boj/book/ai-agent-book/chapter5/video-edit/validation/runs/exp5-6-real-blender-20260730-052206/source.mov'
|
||||
output_path = '/Users/boj/book/ai-agent-book/chapter5/video-edit/validation/runs/exp5-6-real-blender-20260730-052206/negative_control.mp4'
|
||||
|
||||
# Scene setup
|
||||
scene = bpy.context.scene
|
||||
|
||||
# Render settings
|
||||
scene.render.fps = 25
|
||||
scene.render.fps_base = 1.0
|
||||
scene.render.resolution_x = 854
|
||||
scene.render.resolution_y = 480
|
||||
scene.render.resolution_percentage = 100
|
||||
|
||||
# Output format settings
|
||||
scene.render.image_settings.file_format = 'MPEG4'
|
||||
scene.render.ffmpeg.format = 'MPEG4'
|
||||
scene.render.ffmpeg.codec = 'H264'
|
||||
scene.render.ffmpeg.audio_codec = 'AAC'
|
||||
scene.render.filepath = output_path
|
||||
|
||||
# VSE setup
|
||||
scene.sequence_editor_create()
|
||||
seq_ed = scene.sequence_editor
|
||||
|
||||
# Add video strip
|
||||
video_strip = seq_ed.sequences.new_movie(
|
||||
name='Video',
|
||||
filepath=input_path,
|
||||
frame_start=0,
|
||||
channel=1
|
||||
)
|
||||
video_strip.frame_final_duration = 75 # 3s * 25fps
|
||||
|
||||
# Add speed effect (1.5x slowdown)
|
||||
original_duration = 75
|
||||
new_duration = math.ceil(original_duration * 1.5) # 113 frames (4.52s)
|
||||
speed_strip = seq_ed.sequences.new_effect(
|
||||
name='SpeedControl',
|
||||
type='SPEED',
|
||||
channel=2,
|
||||
frame_start=0,
|
||||
frame_end=new_duration,
|
||||
seq1=video_strip
|
||||
)
|
||||
speed_strip.speed_control = 'MULTIPLY'
|
||||
speed_strip.speed_factor = 1/1.5
|
||||
|
||||
# Add audio strip
|
||||
audio_strip = seq_ed.sequences.new_sound(
|
||||
name='Audio',
|
||||
filepath=input_path,
|
||||
frame_start=0,
|
||||
channel=3
|
||||
)
|
||||
audio_strip.frame_final_duration = 75 # Keep original audio duration
|
||||
|
||||
# Add subtitle text strip
|
||||
text_strip = seq_ed.sequences.new_effect(
|
||||
name='Subtitle',
|
||||
type='TEXT',
|
||||
channel=4,
|
||||
frame_start=0,
|
||||
frame_end=new_duration
|
||||
)
|
||||
text_strip.text = 'BIG BUNNY'
|
||||
text_strip.align_x = 'CENTER'
|
||||
text_strip.align_y = 'BOTTOM'
|
||||
text_strip.font_size = 48
|
||||
text_strip.use_box = True
|
||||
text_strip.box_color = (0, 0, 0, 0.6) # Semi-transparent black box
|
||||
|
||||
# Set render frame range
|
||||
scene.frame_start = 1
|
||||
scene.frame_end = new_duration
|
||||
|
||||
# Render animation
|
||||
bpy.ops.render.render(animation=True)
|
||||
Reference in New Issue
Block a user