String property with sub_type =file_path gives wrong path #47529

Closed
opened 2016-02-22 17:20:23 +01:00 by Jose Conseco · 6 comments

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:
PathBug.blend
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')
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: [PathBug.blend](https://archive.blender.org/developer/F285063/PathBug.blend) 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')
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @JoseConseco

Added subscriber: @JoseConseco

This issue was referenced by blender/blender@adab35ba02

This issue was referenced by blender/blender@adab35ba02476c9b3f77f31b2ac77ebd4c4fdbcf

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Added subscriber: @ideasman42

Added subscriber: @ideasman42

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.

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.
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#47529
No description provided.