Operator Presets don't exists from Release 4.2 #8
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
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?
Worked: 4.1
Broken: 4.2 LTS & 4.3 Alpha
With the moving of the Bolt Factory to be an Extension, rather than an addon, the operator presets are no longer present.
Blender, for a long time, up until version 4.1 used a separate folder to store the files used for "Operator Presets".
..../blender-4.1.0-linux-x64/4.1/scripts/addons/presets/operator/mesh.bolt_add/
In this folder are the files used to populate the drop down.
In version 4.2 this folder no longer exists.
This depot: https://projects.blender.org/extensions/add_mesh_BoltFactory/src/branch/main/source
does not contain the source files which were previously picked up from: https://projects.blender.org/blender/blender-addons/src/branch/main/presets/operator/mesh.bolt_add
Regarding a fix: the extensions really don't want to be having their presets stored in another development depot such as:
https://projects.blender.org/blender/blender/src/branch/main/scripts/addons_core
How/where should the presets from: https://projects.blender.org/blender/blender-addons/src/branch/main/presets/operator/mesh.bolt_add
reside in the new world?
More reading: blender/blender#119521 has the text:
"Provide guidance for where extensions should store presets (existing conventions for add-ons may not make sense)."
But I don't see anything helpful - also I don't see anything in the manual.
Using the add bold dialog box to save a preset it generates a file (on Linux) at:
/home/swatya/.config/blender/4.2/scripts/presets/operator/mesh.bolt_add/m4_test_preset.py
Landscapes is also broken without viable Presets: extensions/ant_landscape#2
The solution will work from 4.3. The "if" test keeps things happy on 4.2.
In Boltfactory.py
def register(): needs to have the following lines added:
import os
# Part of 4.3 may be back-ported to 4.2.
if register_preset_path := getattr(bpy.utils, "register_preset_path", None):
register_preset_path(os.path.join(os.path.dirname(__file__)))
def unregister(): needs to have the following lines added:
import os
# Part of 4.3 may be back-ported to 4.2.
if unregister_preset_path := getattr(bpy.utils, "unregister_preset_path", None):
unregister_preset_path(os.path.join(os.path.dirname(__file__)))
A nested directory needs creating in the Boltfactory mini depot:
presets\operator\mesh.bolt_add\
This directory needs then populating with the presets from the old addons depot at:
/scripts/addons/presets/operator/mesh.bolt_add
I found this solution in another extension, and have copied the work of @Campbell Barton :)
See: https://projects.blender.org/extensions/add_mesh_extra_objects/src/branch/main/source/init.py
Fixed under #124020
I hope the collation of this information helps someone update this extension.
Correcting link: extensions/add_mesh_extra_objects#1
I have a fix for the scale of the presets on the pre-4.2 code locally, but haven’t tested it yet. I haven’t looked into updating this here yet. I’ll keep you posted.
Closing as its fixed and updated
@nickberckley I see that you replied to the comments on: https://extensions.blender.org/add-ons/boltfactory/reviews/
While the extension has been fixed, if people try to use it in LTS 4.2.0 the path error still exists.
I've just downloaded LTS 4.2.1 and the presets work as expected.
If you have the power to edit your reply saying both the extension and the core blender need updating; that might help 25k other people who have already downloaded this extension in the past month.
Thanks to you and the rest of the team for getting this fixed.
You're right I made mistake, I should've modified minimum version to 4.2.1