'Select Similar' for the UV Editor #47437

Closed
opened 7 years ago by ideasman42 · 39 comments
Owner

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.
Poster
Owner

Changed status to: 'Open'

Changed status to: 'Open'
Poster
Owner

Added subscriber: @ideasman42

Added subscriber: @ideasman42
ideasman42 changed title from Select similar for the UV Editor to 'Select Similar' for the UV Editor 7 years ago

Added subscriber: @michaelknubben

Added subscriber: @michaelknubben
Muchomor self-assigned this 7 years ago

Added subscriber: @tcorwine

Added subscriber: @tcorwine

Added subscriber: @karthik24iyer

Added subscriber: @karthik24iyer

Removed subscriber: @karthik24iyer

Removed subscriber: @karthik24iyer
Nilkel commented 6 years ago

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.
Muchomor was unassigned by ideasman42 6 years ago
Poster
Owner

Added subscriber: @Muchomor

Added subscriber: @Muchomor

Added subscriber: @DavidSandberg

Added subscriber: @DavidSandberg
knox commented 6 years ago

Added subscriber: @knox

Added subscriber: @knox
Added subscriber: @CarlosRafaeldeOliveiraCarneiro
knox self-assigned this 6 years ago

Added subscriber: @Loading_M

Added subscriber: @Loading_M
matc commented 4 years ago

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?
Poster
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.
Poster
Owner
See https://wiki.blender.org/wiki/Developer_Intro/Advice
matc commented 4 years ago

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?
matc commented 4 years ago

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.
matc commented 4 years ago

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
knox was unassigned by Chris_Blackbourn 8 months ago
Chris_Blackbourn self-assigned this 8 months ago

Fix pending review : D15164

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

This issue was referenced by 1154b45526

This issue was referenced by 1154b45526797d6f5999d1be18f92124baf8107f

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Chris_Blackbourn closed this issue 8 months ago

Added subscriber: @DanielBystedt

Added subscriber: @DanielBystedt

@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.
Collaborator

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/Collada
Interest/Compositing
Interest/Core
Interest/Cycles
Interest/Dependency Graph
Interest/Development Management
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/Modeling
Interest/Modifiers
Interest/Motion Tracking
Interest/Nodes & Physics
Interest/Overrides
Interest/Performance
Interest/Performance
Interest/Physics
Interest/Pipeline, Assets & I/O
Interest/Platforms, Builds, Tests & Devices
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
legacy module/Animation & Rigging
legacy module/Core
legacy module/Development Management
legacy module/Eevee & Viewport
legacy module/Grease Pencil
legacy module/Modeling
legacy module/Nodes & Physics
legacy module/Pipeline, Assets & IO
legacy module/Platforms, Builds, Tests & Devices
legacy module/Python API
legacy module/Rendering & Cycles
legacy module/Sculpt, Paint & Texture
legacy module/Triaging
legacy module/User Interface
legacy module/VFX & Video
legacy project/1.0.0-beta.2
legacy project/Asset Browser (Archived)
legacy project/BF Blender: 2.8
legacy project/BF Blender: After Release
legacy project/BF Blender: Next
legacy project/BF Blender: Regressions
legacy project/BF Blender: Unconfirmed
legacy project/Blender 2.70
legacy project/Code Quest
legacy project/Datablocks and Libraries
legacy project/Eevee
legacy project/Game Animation
legacy project/Game Audio
legacy project/Game Data Conversion
legacy project/Game Engine
legacy project/Game Logic
legacy project/Game Physics
legacy project/Game Python
legacy project/Game Rendering
legacy project/Game UI
legacy project/GPU / Viewport
legacy project/GSoC
legacy project/Infrastructure: Websites
legacy project/LibOverrides - Usability and UX
legacy project/Milestone 1: Basic, Local Asset Browser
legacy project/Nodes
legacy project/OpenGL Error
legacy project/Papercut
legacy project/Pose Library Basics
legacy project/Retrospective
legacy project/Tracker Curfew
legacy project/Wintab High Frequency
Meta/Good First Issue
Meta/Papercut
migration/requires-manual-verification
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 & Devices
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 Information 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

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#47437
Loading…
There is no content yet.