I've seen a number of answers on here and other places that if I have a file path in Blender, I can use bpy.path.abspath(file_path) and get the absolute path to a file or directory. My problem is that I have a StringProperty with subtype = 'DIR_PATH' set and I'm having problems with what it displays:
The path is set to /User/<my_name>/Documents/Dev/3DGraphics/3DExperiments, however notice only two slashes show. The StringProperty is showing a path relative to the current file in Blender. When I select another directory, it still gives me a relative path.
I'm using this structure:
class BluePrinterData(bpy.types.PropertyGroup):
status: bpy.props.StringProperty(
name="status",
default="Waiting for Cameras to be Added"
)
project_name: bpy.props.StringProperty(
name="project_name"
)
save_directory: bpy.props.StringProperty(
name = "",
description = "Output Directory",
default = '',
maxlen = 1024,
subtype = 'DIR_PATH'
)
file_format: bpy.props.EnumProperty(
name = 'File Output Format',
description = 'File format for saving images',
items = {('png', 'PNG', 'Save as PNG'),
('pdf', 'PDF', 'Save as PDF'),
('bmp', 'BMP', 'Save as BMP'),
('tiff', 'TIFF', 'Save as TIFF')},
default = 'png'
)
Note the 3rd property down, save_directory, is the one I'm talking about and I've set the subtype as needed.
I've tried adding an if statement to change the path to absolute if it isn't, but that doesn't make a difference.
The one thing I'm trying to do here is make sure that instead of seeing the relative path in the StringProperty, I see the absolute path.
I've looked over API docs, but I can't find what I have to change to display an absolute path.
(Again, please note I know when I need that absolute path in Python, I can convert - but I can't find a way to convert what the StringProperty with the subtype = 'DIR_PATH' to show the absolute path.)


Nand untick Relative (allows the user to decide). Exactly the same question: How can I get the full path of the selected file from the file explorer with python, Also related: https://blender.stackexchange.com/questions/12152/absolute-path-of-files-in-blender-with-python – brockmann Mar 28 '21 at 08:42default='todefault='//'and that changed it to display the absolute path, but I don't know why. CodeManX describes that, but I still don't get why the double-slash overrides and starts with an absolute path. – Tango Mar 28 '21 at 18:12