Page MenuHome

String property with sub_type =file_path gives wrong path
Closed, ResolvedPublic

Description

Tested in testbuild 2,
When I navigate to file, from python panel, string property with sub_type =file_path is set to incorrect destination. This happens only if I navigate outside blend file location. So eg. my blend file is in: C:\Users\pl\Desktop\
I navigate to:
c:\pagefile.sys,
the resulting string prop (sub_type =file_path) is:
'//..\..\..\pagefile.sys' but it should be c:\pagefile.sys
Worked ok in blender 2.76.
Blend file with simple panel script, and string property attached to scene:


Steps:

  • run script,
  • navigate to some random file placed outside blend file location (random file needs to be on same drive as blend scene, because otherwise path will be correct- and you wont see bug)
  • path will be set incorrectly (someting like '//..\..\..\file.abc')

Event Timeline

Jose Conseco (joseconseco) raised the priority of this task from to 90.
Jose Conseco (joseconseco) updated the task description. (Show Details)
Jose Conseco (joseconseco) edited a custom field.

Note that //..\..\..\file.abc is correct, its a relative path.

When you select a file, you have to toggle relative paths off.

However if you start our with an absolute path, having to always toggle off relative is rather annoying.

Committed a change so even when you have relative paths enabled by default, the Relative Path option for selecting files will be initialized from the initial file path, so selecting a new file wont change the relative/absolute state of the path.

When there is no file-path, the default is used.