I can't get the sound_bake function to work by script while it works fine from the menu (Unsupported audio format). Any idea ?
I have no backslashes in the path and my blender build includes ffmpeg... so I am out of idea... ?
Especially since it works when I bake manually from the menu with the same file !
Here's the piece of code :
# get the path from the sequencer
bpy.context.area.type = "SEQUENCE_EDITOR"
for s in bpy.context.scene.sequence_editor.sequences:
if s.type == 'SOUND':
file_path = s.filepath
# insert keyframe to the VU of the 3d object
bpy.context.area.type = "VIEW_3D"
bpy.context.scene.objects.active = bpy.data.objects['vu']
bpy.ops.anim.keyframe_insert_menu(type = "Scaling")
bpy.context.active_object.animation_data.action.fcurves[0].lock = True
bpy.context.active_object.animation_data.action.fcurves[1].lock = True
# bake
bpy.context.area.type = "GRAPH_EDITOR"
bpy.ops.graph.sound_bake(filepath=file_path, low=(0), high=(2000))
Thanks for reading !