Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-10-10 02:54:18 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-10-10 02:57:13 +0300
commit1dd3b93d2f925ad0c3ec6927ce77474b47157ecc (patch)
tree117496da7515d12ccd831bff073e169086016bf0 /release/scripts/startup/bl_ui
parent2a2858b30dbbc19246446bcc89a7a4e7f67c7ce0 (diff)
Revert "Cleanup: avoid for loop"
This reverts commit 390dc94562ea01e41e560dbee1c481ad6b22eab7. After testing this is approx half the speed of a for loop. Add missing break and assign snap_elements to a variable.
Diffstat (limited to 'release/scripts/startup/bl_ui')
-rw-r--r--release/scripts/startup/bl_ui/space_view3d.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index d9f48ffc2b6..22624ce8482 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -154,10 +154,13 @@ class VIEW3D_HT_header(Header):
snap_elements = tool_settings.snap_elements
if len(snap_elements) == 1:
text = ""
- icon = snap_items[next(iter(snap_elements))].icon
+ for elem in snap_elements:
+ icon = snap_items[elem].icon
+ break
else:
text = "Mix"
icon = 'NONE'
+ del snap_items, snap_elements
row = layout.row(align=True)
row.prop(tool_settings, "use_snap", text="")