I write this code in blender to update the video strip so as to delete alternate frames from it and leave rest of the frames in video sequence editor but it removes first half of the strip instead of alternate frames. Please let me know where I am doing it wrong.
import bpy
# Set the name of your video strip
video_strip_name = "YourStripName"
# Get the video sequence editor
vse = bpy.context.scene.sequence_editor
# Find the video strip by name
strip = vse.sequences.get(video_strip_name)
if strip:
# Create a new list to store the frames to be removed
frames_to_remove = []
# Iterate through the frames and identify alternate ones
for frame in range(strip.frame_final_start, strip.frame_final_end + 1):
if frame % 2 == 0:
# Add the frame index to the list
frames_to_remove.append(frame)
# Remove the identified frames from the beginning
for frame_index in frames_to_remove:
strip.frame_final_start += 1
else:
print(f"Video strip '{video_strip_name}' not found.")
print("Alternate frames removed successfully from the beginning!")
bpy.types.ImageSequence.elements
? $\endgroup$