The functionality of the Bone Selection Sets add-on is now integrated into Blender itself. Rigify has been updated to no longer check for the add-on, but just assume that the functionality is available. The keymap is still the same, and so are all the class names. This ensures that there are no conflicts when people still have the old add-on enabled somehow. And there is versioning code to remove the 'add-on enabled' state so that Blender won't complain it cannot find it any more. Compared to the add-on, the following changes are made: - The 'bone' icon has been removed from the list of available selection sets. It was the same for each entry anyway, and thus didn't provide any information. - The code has been split up into multiple files, with the UI elements in `scripts/startup/bl_ui/properties_data_armature.py` and the operators in `scripts/startup/bl_operators/bone_selection_sets.py`. - Helper functions and classes are prefixed with `_` to indicate that they are not part of any public API. - The `Operator` helper subclasses have been transformed to mix-in classes. This way the only subclasses of `Operator` are the actual operators. - Comments & descriptions have been updated for clarity & consistency. This commit contains code by the following authors, ordered by number of commits in the original add-on repository, highest first: Co-Authored By: Ines Almeida <britalmeida@gmail.com> Co-Authored By: Sybren A. Stüvel <sybren@stuvel.eu> Co-Authored By: Campbell Barton <ideasman42@gmail.com> Co-Authored By: meta-androcto <meta.androcto1@gmail.com> Co-Authored By: Demeter Dzadik <Mets> Co-Authored By: lijenstina <lijenstina@gmail.com> Co-Authored By: Brecht Van Lommel <brechtvanlommel@gmail.com> Co-Authored By: Aaron Carlisle <carlisle.b3d@gmail.com> For the full history see the original add-on at: https://projects.blender.org/blender/blender-addons/commits/branch/main/bone_selection_sets.py Reviewed On: https://projects.blender.org/blender/blender/pulls/124343
79 lines
1.6 KiB
Python
79 lines
1.6 KiB
Python
# SPDX-FileCopyrightText: 2009-2023 Blender Authors
|
|
#
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
from __future__ import annotations
|
|
|
|
# support reloading sub-modules
|
|
if "bpy" in locals():
|
|
from importlib import reload
|
|
_modules_loaded[:] = [reload(val) for val in _modules_loaded]
|
|
del reload
|
|
|
|
_modules = [
|
|
"add_mesh_torus",
|
|
"anim",
|
|
"assets",
|
|
"bone_selection_sets",
|
|
"clip",
|
|
"connect_to_output",
|
|
"console",
|
|
"constraint",
|
|
"file",
|
|
"geometry_nodes",
|
|
"image",
|
|
"image_as_planes",
|
|
"mesh",
|
|
"node",
|
|
"object",
|
|
"object_align",
|
|
"object_quick_effects",
|
|
"object_randomize_transform",
|
|
"presets",
|
|
"rigidbody",
|
|
"screen_play_rendered_anim",
|
|
"sequencer",
|
|
"spreadsheet",
|
|
"userpref",
|
|
"uvcalc_follow_active",
|
|
"uvcalc_lightmap",
|
|
"uvcalc_transform",
|
|
"vertexpaint_dirt",
|
|
"view3d",
|
|
"world",
|
|
"wm",
|
|
]
|
|
|
|
import bpy
|
|
|
|
if bpy.app.build_options.freestyle:
|
|
_modules.append("freestyle")
|
|
|
|
__import__(name=__name__, fromlist=_modules)
|
|
_namespace = globals()
|
|
_modules_loaded = [_namespace[name] for name in _modules]
|
|
del _namespace
|
|
|
|
|
|
def register():
|
|
from bpy.utils import register_class
|
|
from . import bone_selection_sets
|
|
|
|
for mod in _modules_loaded:
|
|
for cls in mod.classes:
|
|
register_class(cls)
|
|
|
|
bone_selection_sets.register()
|
|
|
|
|
|
def unregister():
|
|
from bpy.utils import unregister_class
|
|
from . import bone_selection_sets
|
|
|
|
bone_selection_sets.unregister()
|
|
|
|
for mod in reversed(_modules_loaded):
|
|
for cls in reversed(mod.classes):
|
|
if cls.is_registered:
|
|
unregister_class(cls)
|