bl_i18n_utils - dump_addon_messages
is missing addon's operator data and has redundant strings #116579
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
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
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#116579
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?
Blender 4.0.2, perhaps ping @mont29
Not sure what's the better place for this issue - blender-addons or blender but since it's mostly caused by the way bl_extract_messages.py behaves, I've started it in blender.
Way to reproduce:
Create a new folder in blender addons
subclasses_error
and save init.py to that folder.Open Blender and enable "Subclasses Error" addon in the preferences.
Use "Refresh I18n Data" in scene settings, choose "Subclasses Error" addon. (you'll need "Manage UI Translations" addon enabled and working).
Resulting
translation.py
added tosubclasses_error
directory is attached bellow. There are few issues:Subclasses error test name
andSubclasses error test description
)Collection Definition
,RNA collection property to define lists, arrays and mappings
, etcdump_rna_messages
fails since I guess unregistered classesbl_rna
is corrupted in a way and now contains corrupted symbols instead ofbl_rna.identifier
and it fails on this line trying to concatenate corrupted string.06eda2a484/scripts/modules/bl_i18n_utils/bl_extract_messages.py (L411)
I've noticed something that perhaps is related - when some addon and it's classes unregistered it's operator classes are not removed from
bpy.types.OperatorProperties.__subclasses__()
. E.g. disabling and enabling the addon again will result in this:I thought it's related since
dump_rna_messages
is relying on subclasses to find elements to parse. And the waydump_addon_messages
work it saves messages A with addon enabled, then it disabled the addon, saves messages B and the difference between A and B is considered to be this addon's specific strings.06eda2a484/scripts/modules/bl_i18n_utils/bl_extract_messages.py (L428)
__init__.py
translations.py
Hi, thanks for the report. Do we require
translation
repo as well? I've been asked to init i18n settings but following 3 operations are not showing up afterwards due toif not i18n_sett.is_init:
(Translation root looks wrong to me in preferences)
image
image
@PratikPB2123
Well, it probably does require
translation
repo but for my case I was just translating an addon and only needed access to those operators that can retrieve some addon’s strings, so I just used some dummy directories likeC:/Blender/source
forSOURCE_DIR
(note that, need to make sure it has directorieslocale/po
inside) andC:/Blender/i18
forI18N_DIR
.I can confirm.
A few things to note:
"Subclasses error test name"
,"Subclasses error test description"
.bpy.types.*Property
than you, but this is also the case when extracting other translations and has been for a while:bl_rna
) for a few versions now. I tried to investigate a bit but didn’t do much progress. The__subclasses__
thing could be a good hint.FWIW I've monkey patched
dump_addon_messages
for my usecase - now it expects addon to be disabled (and Blender restarted after) before proceeding.It now dumps strings before addon is activated and after and finds the difference. It solves the issue with the corrupted data but there are still many data from other addons and general Blender operators..
6569d0031f
Yeah, it does crash from time to time. Sometimes it works on the first try and crashes on the second. Sometimes crashes on the first try (usually on big addons).