# How to get the absolute path?

Is it possible to force uncheck with python the "Relative Path" checkbox in the filebrowser?

• What do you mean by "force" uncheck? Do you want to write a script that does that? – WhatAMesh Sep 12 '18 at 20:26
• Yes with python. Sorry. Should have mentioned that. – tintwotin Sep 12 '18 at 20:27
• May be easier after the fact File > External Data > Make All Paths Absolute Than resetting the default of operators such as bpy.ops.image.open(relative_path=False) – batFINGER Sep 13 '18 at 10:11

You need not reinvent the wheel, you can use functions from menu File -> External data -> make all paths relative (absolute). The python code of this comands are:

bpy.ops.file.make_paths_relative()

bpy.ops.file.make_paths_absolute()

• Thanks. It works well, however using this command causes an error when installing. – tintwotin Sep 13 '18 at 6:12
• Accidental relative path when picking a file breaks Python's Pathlib module handling (especially if it is run as a callback) if your prop is a an actual file path chooser therefor this answer is totally useless. It does not answer the original question. – yarun can Oct 3 '20 at 2:06

You can ensure that the path is absolute(which was what I needed to know back in the day) this way:

    import bpy, os
path = bpy.context.scene.sequence_editor.active_strip.filepath
path = (os.path.realpath(bpy.path.abspath(path)))