'Select Similar' for the UV Editor #47437

Closed
opened 2016-02-16 16:26:20 +01:00 by Campbell Barton · 39 comments

Benefits: Artists can more easily isolate parts of the UV map to operate on, using a selection method they will already be families with from other parts of Blender.

Description: With this option you could select UV's based on characteristics of the mesh, eg:

  • Material
  • Face Area
  • UV Area
  • Polygon Sides
  • Pinned State
    ... possibly other options too, note that a subset of these can be accepted for the initial patch.

See mesh edit-mode, Select Grouped (Shift-G).

Challenges: adding key binding, operator and evaluating/comparing mesh data.

**Benefits:** Artists can more easily isolate parts of the UV map to operate on, using a selection method they will already be families with from other parts of Blender. **Description:** With this option you could select UV's based on characteristics of the mesh, eg: - Material - Face Area - UV Area - Polygon Sides - Pinned State *... possibly other options too, note that a subset of these can be accepted for the initial patch.* See mesh edit-mode, Select Grouped (Shift-G). **Challenges:** adding key binding, operator and evaluating/comparing mesh data.
Author
Owner

Changed status to: 'Open'

Changed status to: 'Open'
Author
Owner

Added subscriber: @ideasman42

Added subscriber: @ideasman42
Campbell Barton changed title from Select similar for the UV Editor to 'Select Similar' for the UV Editor 2016-02-16 19:55:04 +01:00

Added subscriber: @michaelknubben

Added subscriber: @michaelknubben
Michał Ziobro self-assigned this 2016-06-24 14:47:05 +02:00

Added subscriber: @tcorwine

Added subscriber: @tcorwine

Added subscriber: @karthik24iyer

Added subscriber: @karthik24iyer

Removed subscriber: @karthik24iyer

Removed subscriber: @karthik24iyer

Added subscriber: @Nilkel

Added subscriber: @Nilkel

Added subscriber: @shobit30

Added subscriber: @shobit30

Is this task completed?
I would like to try this.

Is this task completed? I would like to try this.
Michał Ziobro was unassigned by Campbell Barton 2017-03-03 15:04:49 +01:00
Author
Owner

Added subscriber: @Muchomor

Added subscriber: @Muchomor

Added subscriber: @DavidSandberg

Added subscriber: @DavidSandberg

Added subscriber: @knox

Added subscriber: @knox
Added subscriber: @CarlosRafaeldeOliveiraCarneiro
Jeff Knox self-assigned this 2017-07-09 06:58:20 +02:00

Added subscriber: @Loading_M

Added subscriber: @Loading_M

Added subscriber: @matc

Added subscriber: @matc

Added subscriber: @KalyanS

Added subscriber: @KalyanS

What's the status on this? Can I try it?

What's the status on this? Can I try it?
Author
Owner

Yes (no need to ask, any open quick-hack is a candidate to try).

Yes (no need to ask, any open quick-hack is a candidate to try).

Cool, thanks! I have used blender for a while and know C++, but I am new to blender development - any pointers on how to do this? Mostly I am having trouble navigating the rather large codebase, so any advice would be greatly appreciated.

Cool, thanks! I have used blender for a while and know C++, but I am new to blender development - any pointers on how to do this? Mostly I am having trouble navigating the rather large codebase, so any advice would be greatly appreciated.
Author
Owner
See https://wiki.blender.org/wiki/Developer_Intro/Advice

I had worked on this a couple of weeks ago. I updated my version to current master (D4792).

@ideasman42 Could you have a look at D4792 to determine whether this approach could serve @KalyanS as a basis?

I had worked on this a couple of weeks ago. I updated my version to current master ([D4792](https://archive.blender.org/developer/D4792)). @ideasman42 Could you have a look at [D4792](https://archive.blender.org/developer/D4792) to determine whether this approach could serve @KalyanS as a basis?

@matc Thanks for the diff, I'll take a look at it when I have time and try to implement this task.

Quick question - where does the 2.8 codebase store keymaps? I've looked at some old diffs but they seem to be outdated. There's some code regarding window managers and keymaps, but where can I define custom keymaps for a space/editor?

@matc Thanks for the diff, I'll take a look at it when I have time and try to implement this task. Quick question - where does the 2.8 codebase store keymaps? I've looked at some old diffs but they seem to be outdated. There's some code regarding window managers and keymaps, but where can I define custom keymaps for a space/editor?

Keymaps appear to be in release/scripts/presets/keyconfig/keymap_data/.

I don't think you do have to change any key bindings. I usually just use the operator search menu (Space or F3) to run an operator.

Keymaps appear to be in `release/scripts/presets/keyconfig/keymap_data/`. I don't think you do have to change any key bindings. I usually just use the operator search menu (Space or F3) to run an operator.

Ahh finally I have some time to work on this! I've implemented @matc's patch (D4792) as well as adding the Shift-G keybind for consistency (turned out to be very simple once I figured out how the keymaps worked). Unfortunately, I don't have enough Blender internal/general knowledge to know the inner workings of kdtrees, gsets, etc... does anyone have any pointers on how to extend D4792 to edge and vertex select?

I don't like asking for step by step guidance like this - I'm sure others have work to do, but I really have no idea how to go about anything in this multi-million line codebase.

Ahh finally I have some time to work on this! I've implemented @matc's patch ([D4792](https://archive.blender.org/developer/D4792)) as well as adding the Shift-G keybind for consistency (turned out to be very simple once I figured out how the keymaps worked). Unfortunately, I don't have enough Blender internal/general knowledge to know the inner workings of kdtrees, gsets, etc... does anyone have any pointers on how to extend [D4792](https://archive.blender.org/developer/D4792) to edge and vertex select? I don't like asking for step by step guidance like this - I'm sure others have work to do, but I really have no idea how to go about anything in this multi-million line codebase.

Gset is just the equivalent to a set in C++ or Java. You can find the implementation in BLI_ghash.c by looking for the BLI_gset_ prefix.

From wikipedia: "In computer science, a k-d tree (short for k-dimensional tree) is a space-partitioning data structure for organizing points in a k-dimensional space."
The implementation of kdtree is in kdtree_impl.h.

I don't think you have to worry all that much about those. In each case you will just be using for example the length of an edge measured in uv space instead of mesh space. The collections should not need to be changed.

Essentially all functions in D4792 exist for vertices and edges too. Their names should be the same with "face" replaced by "vert" or "edge".

As a start I suggest to modify similar_edge_select_exec to optionally make the selection in uv editor instead of the viewport.
Basically make the following code work with edges.

        if (select) {
          if (selection_mode == SIM_DATA_MODE_MESH) {
            BM_face_select_set(bm, face, true);
          }
          else {
            uvedit_face_select_enable(scene, em, face, true, cd_loop_uv_offset);
          }
          changed = true;
        }
Gset is just the equivalent to a set in C++ or Java. You can find the implementation in BLI_ghash.c by looking for the BLI_gset_ prefix. From wikipedia: "In computer science, a [k-d tree](https://en.wikipedia.org/wiki/Kdtree) (short for k-dimensional tree) is a space-partitioning data structure for organizing points in a k-dimensional space." The implementation of kdtree is in kdtree_impl.h. I don't think you have to worry all that much about those. In each case you will just be using for example the length of an edge measured in uv space instead of mesh space. The collections should not need to be changed. Essentially all functions in [D4792](https://archive.blender.org/developer/D4792) exist for vertices and edges too. Their names should be the same with "face" replaced by "vert" or "edge". As a start I suggest to modify similar_edge_select_exec to optionally make the selection in uv editor instead of the viewport. Basically make the following code work with edges. ``` if (select) { if (selection_mode == SIM_DATA_MODE_MESH) { BM_face_select_set(bm, face, true); } else { uvedit_face_select_enable(scene, em, face, true, cd_loop_uv_offset); } changed = true; } ```

Ok I have a preliminary diff working on edge direction and length select (see D5108). It adds on to @matc's D4792. I would love to get feedback on this diff!

Ok I have a preliminary diff working on edge direction and length select (see [D5108](https://archive.blender.org/developer/D5108)). It adds on to @matc's [D4792](https://archive.blender.org/developer/D4792). I would love to get feedback on this diff!

Added subscriber: @Ashwin_Ginoria

Added subscriber: @Ashwin_Ginoria

Hello, I'm Ashwin Ginoria a Student of B.Tech (2nd year) Computer Science Engineering, IIT Mandi, India. I'm new to open source Development and would love to join the comunity and I'd like to work on this task so ...
Is this task Completed ?
Also is it a beginner friendly task ?
It would be my first contribution to blender.

Hello, I'm Ashwin Ginoria a Student of B.Tech (2nd year) Computer Science Engineering, IIT Mandi, India. I'm new to open source Development and would love to join the comunity and I'd like to work on this task so ... Is this task Completed ? Also is it a beginner friendly task ? It would be my first contribution to blender.

Added subscriber: @propersquid

Added subscriber: @propersquid

Added subscriber: @yulia_maliauka

Added subscriber: @yulia_maliauka

Added subscriber: @tonyhuang19

Added subscriber: @tonyhuang19

Added subscriber: @PierreRisch

Added subscriber: @PierreRisch

Added subscriber: @Chris_Blackbourn

Added subscriber: @Chris_Blackbourn
Jeff Knox was unassigned by Chris Blackbourn 2022-06-10 06:33:35 +02:00
Chris Blackbourn self-assigned this 2022-06-10 06:33:35 +02:00

Fix pending review : D15164

Fix pending review : [D15164](https://archive.blender.org/developer/D15164)

This issue was referenced by 1154b45526

This issue was referenced by 1154b45526797d6f5999d1be18f92124baf8107f

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Member

Added subscriber: @DanielBystedt

Added subscriber: @DanielBystedt
Member

@Chris_Blackbourn asked me to give feedback on this task via blender.chat.

One more useful addition to "select similar" in the uv editor would be the same as "select similar - face regions" in the 3d view. Based on a current uv island selection, the operator would select any other uv island with the same vertex/face count. You can have a look at my image example below.

image.png

One could argue that it could be interesting to add checks for rotation etc and compare uv islands in a more complex way, but I feel that just counting the faces per uv island will work just fine in most cases.

@Chris_Blackbourn asked me to give feedback on this task via blender.chat. One more useful addition to "select similar" in the uv editor would be the same as "select similar - face regions" in the 3d view. Based on a current uv island selection, the operator would select any other uv island with the same vertex/face count. You can have a look at my image example below. ![image.png](https://archive.blender.org/developer/F13320345/image.png) One could argue that it could be interesting to add checks for rotation etc and compare uv islands in a more complex way, but I feel that just counting the faces per uv island will work just fine in most cases.

This issue was referenced by a581460728

This issue was referenced by a5814607289a7e01d4844ee5ef724e6388cf044e
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
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
20 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#47437
No description provided.