Make all paths relative for a blend file via python I have a bunch of blend files, each in their own directory with supported files wherever necessary. I want to configure all the blend files to use relative paths. I can open each of them and do File &gt; Externel Data &gt; Make all paths relative. But since I've a lot of blend files, this is time consuming. Is it possible to do this via python script?
This will make all paths relative and then save
import bpy
bpy.ops.file.make_paths_relative()
bpy.ops.wm.save_mainfile()

You can run this from the shell like this. This should make all paths in file.blend relative
blender --background file.blend --python-expr 'import bpy;bpy.ops.file.make_paths_relative();bpy.ops.wm.save_mainfile()'