Preferences not being saved #37

Open
opened 2024-09-30 05:38:51 +02:00 by Obaidur-Rahman · 10 comments

CC @Mets

System Information
Operating system: Windows-10-10.0.22631-SP0 64 Bits

Blender Version: 4.2.1 LTS, branch: blender-v4.2-release, commit: 2024-08-19
Add-on Version: (1, 6, 0)


Description of the problem:
Customizing the preferences of the 3D Viewport Pie menus addon, then saving the preferences doesn't save the preferences for the addon. Re-starting Blender resets the addon settings back to the default settings.
I have attached a screen recording so you can better understand the issue.

CC @Mets **System Information** Operating system: Windows-10-10.0.22631-SP0 64 Bits **Blender Version:** 4.2.1 LTS, branch: blender-v4.2-release, commit: [2024-08-19](https://projects.blender.org/blender/blender/commit/396f546c9d82) **Add-on Version**: (1, 6, 0) --- Description of the problem: Customizing the preferences of the 3D Viewport Pie menus addon, then saving the preferences doesn't save the preferences for the addon. Re-starting Blender resets the addon settings back to the default settings. I have attached a screen recording so you can better understand the issue.
Obaidur-Rahman added the
bug
label 2024-09-30 05:38:51 +02:00
Collaborator

Heya, I wonder if it could be a disk read/write permission issue, can't repro on my end. The preferences should get saved to a .txt file in your blender config folder and it looks like that's not happening. Could you try the following:

  • Find your config folder (same folder as startup.blend and userprefs.blend)
    • On Windows, you can press Win+R then type %appdata%, then go to Roaming\Blender Foundation\Blender\4.2\config
  • See if there is a file there called space_view3d_pie_menus.txt
  • If it doesn't exist, try launching Blender as administrator and see if that makes a difference.
  • If it does exist, try deleting it and see if it gets re-created and starts working.
  • If it does exist but deleting it doesn't help, check if it got created with any contents, or if it's totally empty.
  • If it did get created and has contents, check the Blender System Console (Window->Toggle System Console) for any errors on startup.
Heya, I wonder if it could be a disk read/write permission issue, can't repro on my end. The preferences should get saved to a .txt file in your blender config folder and it looks like that's not happening. Could you try the following: - Find your config folder (same folder as startup.blend and userprefs.blend) - On Windows, you can press Win+R then type `%appdata%`, then go to `Roaming\Blender Foundation\Blender\4.2\config` - See if there is a file there called `space_view3d_pie_menus.txt` - If it doesn't exist, try launching Blender as administrator and see if that makes a difference. - If it does exist, try deleting it and see if it gets re-created and starts working. - If it does exist but deleting it doesn't help, check if it got created with any contents, or if it's totally empty. - If it did get created and has contents, check the Blender System Console (Window->Toggle System Console) for any errors on startup.
Demeter Dzadik added the
need info
label 2024-10-01 16:46:06 +02:00

Hi! This happened to me as well. Addon version 1.6.2. It occurred on the Windows 11 work computer and my personal Windows 10 computer (22H2 19045.4957). I am using Blender 4.2.2, but it also happened for me in the previous version, 4.2.1.

I checked in "AppData\Roaming\Blender Foundation\Blender\4.2" whether there was a file called "space_view3d_pie_menus.txt" as you described. It's not there, but there is a file called "viewport_pie_menus.txt".

Running Blender as administrator did nothing for me. But:

I tried deleting the "viewport_pie_menus.txt", and now it works flawlessly!
No "viewport_pie_menus.txt" or "space_view3d_pie_menus.txt" files appeared in the config folder after.

I am so happy I got this working. Thank you very much for this amazing addon and for the solution. It's one of my absolute favourite addons!

Hi! This happened to me as well. Addon version 1.6.2. It occurred on the Windows 11 work computer and my personal Windows 10 computer (22H2 19045.4957). I am using Blender 4.2.2, but it also happened for me in the previous version, 4.2.1. I checked in "AppData\Roaming\Blender Foundation\Blender\4.2" whether there was a file called "space_view3d_pie_menus.txt" as you described. It's not there, but there is a file called "viewport_pie_menus.txt". Running Blender as administrator did nothing for me. But: I tried deleting the "viewport_pie_menus.txt", and **now it works flawlessly!** No "viewport_pie_menus.txt" or "space_view3d_pie_menus.txt" files appeared in the config folder after. I am so happy I got this working. Thank you very much for this amazing addon and for the solution. It's one of my absolute favourite addons!
Collaborator

@Stinaus Hmm, I'm glad it's fixed, but it's not clear to me what's going on with the files. "viewport_pie_menus.txt" should be from an older version, and shouldn't be causing any conflicts, nor should it matter for fixing anything, I hope. And if "space_view3d_pie_menus.txt" isn't getting created, then I think your preferences aren't being saved?

@Stinaus Hmm, I'm glad it's fixed, but it's not clear to me what's going on with the files. "viewport_pie_menus.txt" should be from an older version, and shouldn't be causing any conflicts, nor should it matter for fixing anything, I hope. And if "space_view3d_pie_menus.txt" isn't getting created, then I think your preferences aren't being saved?

Hi, sorry for the late response!

Today when I checked Blender to reply to this thread, I noticed the same problem. I was unsure what had happened. I tried the same fix that had worked last time, it even worked when restarting the computer. I have not seen "space_view3d_pie_menus.txt".

I tried some different things, but I finally managed to replicate the issue by disabling the addon.

It works flawlessly as long as "viewport_pie_menus" is deleted/not in the config folder.
If I disable the addon, it will add "viewport_pie_menus" back into the folder, thus breaking the preferences again.

I hope this is helpful, I wish you a great week, and again, thank you for making this amazing addon! Let me know if there is anything else you want me to test

Hi, sorry for the late response! Today when I checked Blender to reply to this thread, I noticed the same problem. I was unsure what had happened. I tried the same fix that had worked last time, it even worked when restarting the computer. I have not seen "space_view3d_pie_menus.txt". I tried some different things, but I finally managed to replicate the issue by disabling the addon. It works flawlessly as long as "viewport_pie_menus" is deleted/not in the config folder. If I disable the addon, it will add "viewport_pie_menus" back into the folder, thus breaking the preferences again. I hope this is helpful, I wish you a great week, and again, thank you for making this amazing addon! Let me know if there is anything else you want me to test
Collaborator

Okay, I finally understand why the file name is different for you guys, I was just being stupid.

Note that due to technical limitations, the add-on's preferences will currently NOT be saved if:

  • Blender is force-shut-down, eg. by quitting the corresponding system terminal window, but afaik on Windows that shouldn't be possible.
  • Blender crashes.
  • Computer is turned off without allowing software to save data (ie. power outage).
  • An error occurs in Blender or in the add-on during quitting.

Is anything like that happening maybe?

Okay, I finally understand why the file name is different for you guys, I was just being stupid. Note that due to technical limitations, the add-on's preferences will currently NOT be saved if: - Blender is force-shut-down, eg. by quitting the corresponding system terminal window, but afaik on Windows that shouldn't be possible. - Blender crashes. - Computer is turned off without allowing software to save data (ie. power outage). - An error occurs in Blender or in the add-on during quitting. Is anything like that happening maybe?

That could very well be! That might be why I had no problems with it for a while after deleting the file, and then the issue suddenly appeared again later (probably because of a crash or something).

If that is the case, I assume the "viewport_pie_menus" file is generated if Blender crashes for instance? For me, if the "viewport_pie_menus" file exists, the preferences are not saved, even when I close Blender normally.

That could very well be! That might be why I had no problems with it for a while after deleting the file, and then the issue suddenly appeared again later (probably because of a crash or something). If that is the case, I assume the "viewport_pie_menus" file is generated if Blender crashes for instance? For me, if the "viewport_pie_menus" file exists, the preferences are not saved, even when I close Blender normally.
Collaborator

It should be the other way around, the .txt file should be storing your add-on preferences, and they should be getting loaded from it. It only gets created on unregister/quit, but not on a crash.

It should be the other way around, the .txt file should be storing your add-on preferences, and they should be getting loaded from it. It only gets created on unregister/quit, but not on a crash.

That is not the case for me, my preferences will not save if it is there. But if the file is not there, it does save the preferences.
This is unlike other addons I have installed, they save my preferences when I edit them. Maybe this is a bug that happens only on Windows or something like that?

That is not the case for me, my preferences will not save if it is there. But if the file is not there, it does save the preferences. This is unlike other addons I have installed, they save my preferences when I edit them. Maybe this is a bug that happens only on Windows or something like that?
Collaborator

I've tested on both Windows and Linux and it works for me.
I'm also not sure why Blender refuses to save some types of keymap entries, as it seems completely random. That's why I had to implement custom behaviour to save these preferences.

If it manages to save the file for the first time, my only guess is that you don't have rights to modify the file after it's created. But you already said you tried launching it as admin, so, I'm out of ideas. :/

I've tested on both Windows and Linux and it works for me. I'm also not sure why Blender refuses to save some types of keymap entries, as it seems completely random. That's why I had to implement custom behaviour to save these preferences. If it manages to save the file for the first time, my only guess is that you don't have rights to modify the file after it's created. But you already said you tried launching it as admin, so, I'm out of ideas. :/
Collaborator

I still couldn't reproduce this, but clearly it's affecting a lot of users. In the latest version, 1.6.5, I've added buttons to manually save and load the preferences, right here:
image

Please let me know if you get any errors from trying to use these buttons, or if they fix the issue for you. 🤞 They also print some data into the terminal, so if you could Toggle System Console and copy paste its contents here (attach as text file ideally), that might be useful.

I still couldn't reproduce this, but clearly it's affecting a lot of users. In the latest version, 1.6.5, I've added buttons to manually save and load the preferences, right here: ![image](/attachments/ba543b55-591a-4e16-9fe5-6fcc3028dd90) Please let me know if you get any errors from trying to use these buttons, or if they fix the issue for you. 🤞 They also print some data into the terminal, so if you could Toggle System Console and copy paste its contents here (attach as text file ideally), that might be useful.
104 KiB
Demeter Dzadik changed title from 3D Viewport Pie Menus addon's Preferences not being saved to Preferences not being saved 2024-11-21 21:39:37 +01:00
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: extensions/space_view3d_pie_menus#37
No description provided.