I18n: Fix add-on extraction

- The "location" and "warning" fields in bl_info are no longer exposed
  in the interface, so there is no need to extract them any more.

- Some add-ons do not define a description (Copy Global Transform for
  example), so they should be skipped.

- Some third-party legacy add-ons do not use the 'support' field, and
  that can cause an error in extraction. Since this won't happen
  for built-in add-ons, checking that an add-on is built-in is enough.

Pull Request: https://projects.blender.org/blender/blender/pulls/122970
This commit is contained in:
Damien Picard
2024-06-09 18:14:58 +02:00
committed by Gitea
parent 119f764eb9
commit a5df83167e

View File

@@ -1021,7 +1021,9 @@ def dump_asset_messages(msgs, reports, settings):
def dump_addon_bl_info(msgs, reports, module, settings):
for prop in ('name', 'location', 'description', 'warning'):
for prop in ('name', 'description'):
if prop not in module.bl_info:
continue
process_msg(
msgs,
settings.DEFAULT_CONTEXT,
@@ -1077,10 +1079,8 @@ def dump_messages(do_messages, do_checks, settings):
# Get strings from addons' bl_info.
import addon_utils
for module in addon_utils.modules():
# Only process official add-ons, i.e. those marked as 'OFFICIAL' and
# existing in the system add-ons directory (not user-installed ones).
if (module.bl_info['support'] != 'OFFICIAL'
or not bpy.path.is_subdir(module.__file__, bpy.utils.system_resource('SCRIPTS'))):
# Only process official add-ons, i.e. those in the system directory (not user-installed ones).
if not bpy.path.is_subdir(module.__file__, bpy.utils.system_resource('SCRIPTS')):
continue
dump_addon_bl_info(msgs, reports, module, settings)