Enum Property names are not displayed correctly #50426
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
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-addons#50426
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?
System Information
Operating system and graphics card
Blender Version
Broken: (example: 2.78a e8299c8)
Short description of error
I have created a custom EnumProperty which uses a function to generate a dynamic list of items. That function loops over all brushes and creates a list out of them.
Displaying that enum property via layout.template_icon_view(context.scene, "prop_name",show_labels=True) and layout.prop(context.scene, "prop_name",expand=True) is resulting in totally messed up names.
Items are displaying names of other items or crypted text.
For template_icon_view it sometimes works properly, but most of the time not.
However, displaying the property via layout.prop(context.scene, "prop_name",expand=True) works perfectly fine. Always.
Exact steps for others to reproduce the error
I have attached a blendfile showcasing the problem and also a small video.
blender_enum_flicker.mp4 enum_property_bug.blend
Changed status to: 'Open'
Added subscriber: @ndee
If the attached video is not displaying correctly.
Here is a link to it:
https://www.dropbox.com/s/bykn28wf4nikht1/blender_enum_flicker_02.mp4?dl=0
Changed status from 'Open' to: 'Archived'
Thanks for the report, but that’s more a known issue than a bug here, as stated by the API documentation, you have to keep a (python local) reference to the strings you return in that items callback, something like this shall work:
global BRUSHES
BRUSHES = []
for i,brush in enumerate(bpy.data.brushes):
icon_id = bpy.types.UILayout.icon(brush)
name = "%s" % brush.name
BRUSHES.append((name, name, name, icon_id, i))
return BRUSHES
Ok thanks for the quick answer @mont29
The global keyword disables the flickering but names could still be mixed up. Some brushes are named twice with the same label.. this is somehow weird.
Added subscriber: @Andrew_D
This comment was removed by @Andrew_D-1