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:
authorSiddhartha Jejurkar <f20180617@goa.bits-pilani.ac.in>2022-03-03 15:02:07 +0300
committerSiddhartha Jejurkar <f20180617@goa.bits-pilani.ac.in>2022-03-03 15:29:09 +0300
commitffaaa0bcbf477c30cf3665b9330bbbb767397169 (patch)
tree4ae6a873568f4267691d991abff10928bb299f36 /release
parent76879e37024504d6f14609730be9ac17b5a02293 (diff)
UV: Edge selection support
This patch adds edge selection support for UV editing (refer T76545). Developed as a part of GSoC 2021 project - UV Editor Improvements. Previously, selections in the UV editor always flushed down to vertices and this caused multiple issues such as T76343, T78757 and T26676. This patch fixes that by adding edge selection support for all UV operators and adding support for flushing selections between vertices and edges. Updating UV select modes is now done using a separate operator, which also handles select mode flushing and undo for UV select modes. Drawing edges (in UV edge mode) is also updated to match the edit-mesh display in the 3D viewport. Notes on technical changes made with this patch: * MLOOPUV_EDGESEL flag is restored (was removed in rB9fa29fe7652a). * Support for flushing selection between vertices and edges. * Restored the BMLoopUV.select_edge boolean in the Python API. * New operator to update UV select modes and flushing. * UV select mode is now part of editmesh undo. TODOs added with this patch: * Edge support for shortest path operator (currently uses vertex path logic). * Change default theme color instead of reducing contrast with edge-select. * Proper UV element selections for Reveal Hidden operator. Reviewed By: campbellbarton Differential Revision: https://developer.blender.org/D12028
Diffstat (limited to 'release')
-rw-r--r--release/scripts/presets/keyconfig/keymap_data/blender_default.py6
-rw-r--r--release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py16
-rw-r--r--release/scripts/startup/bl_ui/space_image.py12
3 files changed, 22 insertions, 12 deletions
diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
index 6f4f862a3b8..83946fbf68f 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -385,9 +385,9 @@ def _template_items_uv_select_mode(params):
*_template_items_editmode_mesh_select_mode(params),
# Hack to prevent fall-through, when sync select isn't enabled (and the island button isn't visible).
("mesh.select_mode", {"type": 'FOUR', "value": 'PRESS'}, None),
- *(("wm.context_set_enum", {"type": NUMBERS_1[i], "value": 'PRESS'},
- {"properties": [("data_path", 'tool_settings.uv_select_mode'), ("value", ty)]})
- for i, ty in enumerate(('VERTEX', 'EDGE', 'FACE', 'ISLAND')))
+ *(("uv.select_mode", {"type": k, "value": 'PRESS'},
+ {"properties": [("type", e)]})
+ for k, e in (('ONE', 'VERTEX'), ('TWO', 'EDGE'), ('THREE', 'FACE'), ('FOUR', 'ISLAND')))
]
diff --git a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
index e65ac32d088..8c303bc3f69 100644
--- a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
+++ b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
@@ -554,14 +554,14 @@ def km_uv_editor(params):
("wm.search_menu", {"type": 'TAB', "value": 'PRESS'}, None),
# Selection modes.
*_template_items_editmode_mesh_select_mode(params),
- ("wm.context_set_enum", {"type": 'ONE', "value": 'PRESS'},
- {"properties": [("data_path", 'tool_settings.uv_select_mode'), ("value", 'VERTEX')]}),
- ("wm.context_set_enum", {"type": 'TWO', "value": 'PRESS'},
- {"properties": [("data_path", 'tool_settings.uv_select_mode'), ("value", 'EDGE')]}),
- ("wm.context_set_enum", {"type": 'THREE', "value": 'PRESS'},
- {"properties": [("data_path", 'tool_settings.uv_select_mode'), ("value", 'FACE')]}),
- ("wm.context_set_enum", {"type": 'FOUR', "value": 'PRESS'},
- {"properties": [("data_path", 'tool_settings.uv_select_mode'), ("value", 'ISLAND')]}),
+ ("uv.select_mode", {"type": 'ONE', "value": 'PRESS'},
+ {"properties": [("type", 'VERTEX')]}),
+ ("uv.select_mode", {"type": 'TWO', "value": 'PRESS'},
+ {"properties": [("type", 'EDGE')]}),
+ ("uv.select_mode", {"type": 'THREE', "value": 'PRESS'},
+ {"properties": [("type", 'FACE')]}),
+ ("uv.select_mode", {"type": 'FOUR', "value": 'PRESS'},
+ {"properties": [("type", 'ISLAND')]}),
("uv.select", {"type": 'LEFTMOUSE', "value": 'CLICK'},
{"properties": [("extend", False), ("deselect_all", True)]}),
diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py
index 5b840fae341..0aac224bc68 100644
--- a/release/scripts/startup/bl_ui/space_image.py
+++ b/release/scripts/startup/bl_ui/space_image.py
@@ -779,7 +779,17 @@ class IMAGE_HT_header(Header):
if tool_settings.use_uv_select_sync:
layout.template_edit_mode_selection()
else:
- layout.prop(tool_settings, "uv_select_mode", text="", expand=True)
+ row = layout.row(align=True)
+ uv_select_mode = tool_settings.uv_select_mode[:]
+ row.operator("uv.select_mode", text="", icon='UV_VERTEXSEL',
+ depress=(uv_select_mode == 'VERTEX')).type = 'VERTEX'
+ row.operator("uv.select_mode", text="", icon='UV_EDGESEL',
+ depress=(uv_select_mode == 'EDGE')).type = 'EDGE'
+ row.operator("uv.select_mode", text="", icon='UV_FACESEL',
+ depress=(uv_select_mode == 'FACE')).type = 'FACE'
+ row.operator("uv.select_mode", text="", icon='UV_ISLANDSEL',
+ depress=(uv_select_mode == 'ISLAND')).type = 'ISLAND'
+
layout.prop(tool_settings, "uv_sticky_select_mode", icon_only=True)
IMAGE_MT_editor_menus.draw_collapsible(context, layout)