def import_audio(self, project_directory, audio_files, import_channel):
"""
Imports audio files as sound strips from absolute file paths
Returns the list of newly imported audio files
"""
import_frame = bpy.context.scene.frame_current
new_sequences = []
for f in audio_files:
audio_abs_path = os.path.join(project_directory, f)
bpy.ops.sequencer.sound_strip_add(
self.SEQUENCER_AREA,
filepath=audio_abs_path,
frame_start=import_frame,
channel=import_channel)
new_sequences.extend(bpy.context.selected_sequences)
import_frame = bpy.context.selected_sequences[0].frame_final_end
return new_sequences
评论列表
文章目录