Page MenuHome

Userprefs not saved when setting StringProperty of subtype='DIR_PATH' with directory browser
Closed, ResolvedPublic

Description

System Information
Operating system: Windows-10-10.0.18362 64 Bits
Graphics card: GeForce RTX 2080 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 442.59

Blender Version
Broken: version: 2.81 (sub 16), branch: master, commit date: 2019-12-04 11:32, hash: rBf1aa4d18d49d
Worked: (optional)

Short description of error
We have an Addon where you can set up your project path in the Addon preferences that uses a StringProperty with the subtype='DIR_PATH'.
When editing the text field by hand by for example pasting in a path, the userprefs are written at blender closure.
But if you select a path with the directory browser the userprefs are not written on closure.

Exact steps for others to reproduce the error

  • Have an Addon with AddonPreferences class.
  • Have a StringProperty of subtype 'DIR_PATH' stored in the AddonPreferences
  • Open a empty blender scene and open addon preferences.
  • Set the StringProperty using the the directory browser button next to the text field.
  • Close Blender
  • Open Blender again, now the StringProperty is empty.

Thanks!

Event Timeline

Ankit Meel (ankitm) changed the task status from Needs Triage to Needs Information from User.EditedJun 2 2020, 1:08 PM

Could you test on later versions ?
I tried on 2.90, rBbdda53fdb29d9f015d & I can see the dir path after reopening Blender. Archipack, if you want to test. (let me know if I picked the wrong addon)
Are your "save preferences" settings wrong?