mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
Fix #115590: UV window menus disappearing
Due to lack of forward compatibility, tool_settings.snap_uv_element could return empty if a 4.0 file is opened in 3.6. This causes a Python error when trying to identify the element's icon. Avoid this python error. Pull Request: https://projects.blender.org/blender/blender/pulls/116944
This commit is contained in:
parent
a423a329e8
commit
56039bbc2a
1 changed files with 5 additions and 2 deletions
|
|
@ -751,7 +751,10 @@ class IMAGE_HT_header(Header):
|
|||
|
||||
# Snap.
|
||||
snap_uv_element = tool_settings.snap_uv_element
|
||||
act_snap_uv_element = tool_settings.bl_rna.properties["snap_uv_element"].enum_items[snap_uv_element]
|
||||
try:
|
||||
act_snap_icon = tool_settings.bl_rna.properties["snap_uv_element"].enum_items[snap_uv_element].icon
|
||||
except KeyError:
|
||||
act_snap_icon = 'NONE'
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.prop(tool_settings, "use_snap_uv", text="")
|
||||
|
|
@ -759,7 +762,7 @@ class IMAGE_HT_header(Header):
|
|||
sub = row.row(align=True)
|
||||
sub.popover(
|
||||
panel="IMAGE_PT_snapping",
|
||||
icon=act_snap_uv_element.icon,
|
||||
icon=act_snap_icon,
|
||||
text="",
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue