Sapling generator requires root privileges when saving presets #46718
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
7 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#46718
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Any system with blender installed by root
Blender Version
Broken: 2.76b 2015-11-03 10:56 f336fea
Short description of error
When trying to save presets for the sapling add-on, attempts are made to write to directories outside the current user's home directory. As a result, the preset is not saved, because of file permissions.
See also http://blender.stackexchange.com/questions/38172/error-while-exporting-preset-in-saplingadd-tree/41156#41156
Exact steps for others to reproduce the error
In object mode: Add/Curve/Add Tree, then try to "Export Preset"
Changed status to: 'Open'
Added subscriber: @Torbjorn-Rathsman
Added subscribers: @Abpy, @Blendify
@Abpy does this happen with your newer version of the addon?
Here is a patch solving the problem:
https://developer.blender.org/differential/diff/5408/
Added subscriber: @BrendonMurphy
hi, I confirm this bug & run some further tests.
I had thought this issue was fixed.
@Torbjorn-Rathsman could you test this version please: https://developer.blender.org/T46559 & make comment there. It would be preferred to fix this issue in @Abpy version & update in one go.
This is also somewhat of a known issue on windows, the use of appdata folder requires admin permissions.
Thanks for your help..
So the problem is that windows will not write to the application folder?
Is the solution to write the preset somewhere else, or to just prevent saving if it does not work?
Added subscribers: @ideasman42, @Sergey
While the patch might solve issue with particular addon, other addons will still be buggy? Also, the preset system itself should choose whether to use blender's application folder or user's config folder to store the presets.
@ideasman42, can you comment on this?
Here is my solution.
user presets are saved to:
os.path.join(bpy.utils.script_path_user(), 'presets', 'operator', 'add_curve_sapling_3')
https://github.com/abpy/improved-sapling-tree-generator
Added subscriber: @aaron-14
@aaron-14 This solution works. However, it is not a good idea to test if a file exists first, and then open it. since the file can be created between the calls That's why I replaced open(...,'w') with open(...,'x'). Also I want the ability to overwrite my own presets, so perhaps the test can be removed.
I added an option to overwrite the file. It still uses os.path.exists though, because with the option to overwrite it doesn't make sense to use open(...,'x'), and it has to check that its not in the builtin presets.
(also, sorry its on github rather than a diff here. It would be a lot of extra work to make a diff between the blender version and mine)
@aaron-14, that will be fine. Hope the changes will go into the main branch soon
@Sergey, this addon handles presets its self, other addons which use blender's preset system wont have issues.
@Abpy, are your interested to take over maintaining the sapling generator bundled with Blender?
That, or I can fix the bug in master, and we can investigate including your changes later.
I just dont want the code to converge too far if we're going to eventually have to merge back.
@ideasman42
Yes, @Abpy the goal here is to replace current sapling addon entirely with the new updated version.
Added subscriber: @mont29
Any news here? If merging new work takes too much time let's at least fix the bug in master…
@ideasman42 @mont29
Yes, @Abpy the goal here is to replace current sapling addon entirely with the new updated version.
What has happened here? I may take this over soon.
closing as archived.
If problem still exists in the new version (available in buildbot builds from tomorrow) please create a new task.
Note: Running Blender as Administrator on Windows fixes this problem.
Changed status from 'Open' to: 'Archived'