Backport #31299 Parse base path and tree path so that media links can be correctly created with /media/. Resolves #31294 --------- Co-authored-by: Brecht Van Lommel <brecht@blender.org>