Skip to content

Fix broken Japanese text in search operator popups#601

Open
Mysteryem wants to merge 1 commit into
absolute-quantum:developmentfrom
Mysteryem:search_popup_fix_pr
Open

Fix broken Japanese text in search operator popups#601
Mysteryem wants to merge 1 commit into
absolute-quantum:developmentfrom
Mysteryem:search_popup_fix_pr

Conversation

@Mysteryem
Copy link
Copy Markdown

Another issue with dynamic enum properties.

Without ensuring that Python kept reference to the strings in the enum for each search operator, strings containing Japanese characters were displaying random memory. Attempting to select an option would actually try to use that random memory as the string to set, so the issue was not purely visual.

This patch wraps all search operators' enum items functions in wrap_dynamic_enum_items to ensure that Python keeps reference to the strings.

wrap_dynamic_enum_items has been modified specifically for search operators to allow for instances that are not part of a scene or otherwise do not hold the property they reference. To keep the caches of names unique per search operator, their bl_idnames have been used as the keys used by the string cache.


Thanks to MdNight_(Kilia FinClub) for reporting the bug on discord.
This fixes shape keys/bones/etc. showing up in search operator popups like this
image

Another issue with dynamic enum properties.

Without ensuring that Python kept reference to the strings in the enum for each search operator, strings containing Japanese characters were displaying random memory. Attempting to select an option would actually try to use that random memory as the string to set, so the issue was not purely visual.

This patch wraps all search operators' enum `items` functions in `wrap_dynamic_enum_items` to ensure that Python keeps reference to the strings.

`wrap_dynamic_enum_items` has been modified specifically for search operators to allow for instances that are not part of a scene or otherwise do not hold the property they reference. To keep the caches of names unique per search operator, their `bl_idname`s have been used as the keys used by the string cache.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant