h, w, l = frames[0].shape fourcc = cv2.VideoWriter_fourcc(*'mp4v') video = cv2.VideoWriter(f'{pl}.mp4', fourcc, 15, (w, h)) for f in frames: video.write(f)
# give Python access to Blender's functionality import bpy # extend Python's math functionality import math
# add a cube into the scene bpy.ops.mesh.primitive_cube_add() # get a reference to the currently active object cube = bpy.context.active_object
# insert keyframe at frame one cube.keyframe_insert("rotation_euler", frame=1) # change the rotation of the cube around z-axis cube.rotation_euler.z = math.radians(360)
# insert keyframe at the last frame cube.keyframe_insert("rotation_euler", frame=90)
# change the location of the cube on the z-axis cube.location.z = 0 cube.keyframe_insert("location", frame=100) cube.location.z = 5 cube.keyframe_insert("location", frame=150)