UV: Add "Invert Pins" to the menu in the uv editor #109187

Merged
Chris Blackbourn merged 1 commits from Chris_Blackbourn/blender:uv-invert-pinned into main 2023-07-04 02:46:32 +02:00

Thanks Robert Rioux for the suggestion.

Thanks Robert Rioux for the suggestion.
Chris Blackbourn added 1 commit 2023-06-21 06:02:00 +02:00
a10877a14f UV: Add "Invert Pins" to the menu in the uv editor
Thanks Robert Rioux for the suggestion.
Chris Blackbourn requested review from Campbell Barton 2023-06-21 06:02:17 +02:00

Please explain why this is useful.

Please explain why this is useful.
First-time contributor

It 's actually quite useful. Just like in modeling, sometimes it's faster/easier to select what you don't want and invert it.

It 's actually quite useful. Just like in modeling, sometimes it's faster/easier to select what you don't want and invert it.

I guess this is useful in the context of packing, where someone might pin all the vertices in an islands to lock it? And not so much in the context of the original purpose of pinning a handful of vertices in a UV island to control its shape. Because there inverting the pins doesn't seem useful.

I guess this is useful in the context of packing, where someone might pin all the vertices in an islands to lock it? And not so much in the context of the original purpose of pinning a handful of vertices in a UV island to control its shape. Because there inverting the pins doesn't seem useful.
First-time contributor

No, actually if you pin something you can still move them around, which doesn't make more sent to me. If it's pinned, it's pinned for everything. I'm really talking about smoothing and unfolding. There are situations where it's faster/easier to select what you don't want and invert it. I can post an example if needed

No, actually if you pin something you can still move them around, which doesn't make more sent to me. If it's pinned, it's pinned for everything. I'm really talking about smoothing and unfolding. There are situations where it's faster/easier to select what you don't want and invert it. I can post an example if needed

Pins are meant to lock things into place for unwrapping and packing, but not for user edits. That's the purpose, to give some user control over what the automated algorithms are doing.

I didn't fully understand your reply, it sounds like you are thinking of pinning as a method to lock vertices from user editing?

Pins are meant to lock things into place for unwrapping and packing, but not for user edits. That's the purpose, to give some user control over what the automated algorithms are doing. I didn't fully understand your reply, it sounds like you are thinking of pinning as a method to lock vertices from user editing?
First-time contributor

For me, pinning is for both. When I pin something, it's because I don't want it to move in any situations in the UV editor.

For me, pinning is for both. When I pin something, it's because I don't want it to move in any situations in the UV editor.

But that's not how pinning actually works, so the motivation for this PR makes no sense then unless pinning behavior is changed as well?

But that's not how pinning actually works, so the motivation for this PR makes no sense then unless pinning behavior is changed as well?
First-time contributor

You mean, this in not how pinning works "in Blender" ;-) But it is in another software that I won't name. Still, the original post is not about if UVs can be moved or not once pinned but about inverting the selection, which is very useful and shouldn't be hard to implement. I will try to make an example

You mean, this in not how pinning works "in Blender" ;-) But it is in another software that I won't name. Still, the original post is not about if UVs can be moved or not once pinned but about inverting the selection, which is very useful and shouldn't be hard to implement. I will try to make an example

I understand that proposing a(separate) feature to lock vertices can be useful, and that inverting selection and locking can be useful. But it's not so obvious why inverting pinning is useful.

I understand that proposing a(separate) feature to lock vertices can be useful, and that inverting selection and locking can be useful. But it's not so obvious why inverting pinning is useful.
First-time contributor

You select the nose and invert the selection because it's faster this way, but inverse will select ALL the UVs in the UV editor. Or, you select the nose, pin it, invert the pin but it only affects the island itself. Basically, many many times, it's easier to select the area that you want to work on than the opposite. Hence the use of invert pin. One thing that could also be very useful is unpin all so that you don't have to select them first.

You select the nose and invert the selection because it's faster this way, but inverse will select ALL the UVs in the UV editor. Or, you select the nose, pin it, invert the pin but it only affects the island itself. Basically, many many times, it's easier to select the area that you want to work on than the opposite. Hence the use of invert pin. One thing that could also be very useful is unpin all so that you don't have to select them first.

Ok, I can see how this can be useful to re-unwrap some smaller part of a UV island.

Or, you select the nose, pin it, invert the pin but it only affects the island itself.

To be clear, this is missing a step to select the whole islands before inverting the pin. Because otherwise it will unpin just the nose again.

Ok, I can see how this can be useful to re-unwrap some smaller part of a UV island. > Or, you select the nose, pin it, invert the pin but it only affects the island itself. To be clear, this is missing a step to select the whole islands before inverting the pin. Because otherwise it will unpin just the nose again.
First-time contributor

Actually, when I think about it, I could juste select the entire island and deselect the part I want to modify, then pin... Ok, so invert pin may not be necessary. But unpin all would be cool

Actually, when I think about it, I could juste select the entire island and deselect the part I want to modify, then pin... Ok, so invert pin may not be necessary. But unpin all would be cool
Author
Member

Pins are meant to lock things into place for unwrapping and packing, but not for user edits. That's the purpose, to give some user control over what the automated algorithms are doing.

I didn't fully understand your reply, it sounds like you are thinking of pinning as a method to lock vertices from user editing?

I always interpreted "pin" as locking UVs to a pin, and then when the user does a "move" operation, they are moving the pin, and then the underlying UV follows the pin.

That's the current behavior for the Relax and Pinch Sculpt Tools.

For the "Grab" tool, because it has a fall off, I was going to implement a nice mode where the user can disable moving pins, and then both the user's brush and the pins will both have a falloff giving a nice smooth gradient around the pinned UVs.

> Pins are meant to lock things into place for unwrapping and packing, but not for user edits. That's the purpose, to give some user control over what the automated algorithms are doing. > > I didn't fully understand your reply, it sounds like you are thinking of pinning as a method to lock vertices from user editing? I always interpreted "pin" as locking UVs to a pin, and then when the user does a "move" operation, they are moving the pin, and then the underlying UV follows the pin. That's the current behavior for the Relax and Pinch Sculpt Tools. For the "Grab" tool, because it has a fall off, I was going to implement a nice mode where the user can disable moving pins, and then both the user's brush *and* the pins will both have a falloff giving a nice smooth gradient around the pinned UVs.
Author
Member

Where are we at with this one? Is it okay to merge? Or do we need more discussion?

Where are we at with this one? Is it okay to merge? Or do we need more discussion?
First-time contributor

I would put it at the lowest priority. It could be useful but there are more urgent things to fixed. My two cents.

I would put it at the lowest priority. It could be useful but there are more urgent things to fixed. My two cents.
Author
Member

Well this is a pull-request, the work has already been done. The question is do we want to merge or not?

Well this is a pull-request, the work has already been done. The question is do we want to merge or not?
Brecht Van Lommel approved these changes 2023-07-03 12:52:52 +02:00
Brecht Van Lommel left a comment
Owner

I don't think this is particularly useful, but also have no real objection to it.

I don't think this is particularly useful, but also have no real objection to it.
Chris Blackbourn merged commit 4f6ce68500 into main 2023-07-04 02:46:32 +02:00
Chris Blackbourn deleted branch uv-invert-pinned 2023-07-04 02:46:34 +02:00

For the records/future PRs:

  1. The final commit still showed no explanation of the justification of the feature. No one should be expected to go over a patch discussion to understand why something new was added, or how it works. While the patch description AND the commit log should contain this information.

  2. Having a PR is no reason for something to get merged. If its usefulness is speculative, I would suggest even reverting it to be honest. The less options we have, the simpler it is for artists. You can also check with other module members (e.g., @DanielBystedt) on that.

For the records/future PRs: 1. The final commit still showed no explanation of the justification of the feature. No one should be expected to go over a patch discussion to understand why something new was added, or how it works. While the patch description AND the commit log should contain this information. 2. Having a PR is no reason for something to get merged. If its usefulness is speculative, I would suggest even reverting it to be honest. The less options we have, the simpler it is for artists. You can also check with other module members (e.g., @DanielBystedt) on that.
Author
Member

I think Brecht was just playing "Devil's Advocate" earlier. Let's try again:

Pins were originally added to guide the unwrap operators, but have since expanded in scope:

  • During live unwrap, any island which contains a pin is not involved in packing.
  • In the UV Sculpt tools, Grab and Relax treat pinned vertices differently from unpinned.
  • UV > Align > Straighten tools use pinning information
  • When determining if a layout is "facing up" or "facing down", pinned islands are considered before unpinned islands.
  • Select Similar > Pinned now exists.
  • Pins can be used in arbitrary ways in user scripts.

And most recently:

  • Pinned islands can be treated differently in the UV Packer.

Are pins useful? Yeah, definitely. They do a lot more than just guide the unwrap process, and they'll continue to find more uses in the future, e.g. in proportional fall off, and in the stitch tools too.

Now lets look at the interaction between selected vertices and the existing pins. There are two boolean values, and there are precisely three boolean expressions:

  • pin = pin OR select ( Menu > UV > Pin )
  • pin = pin AND select ( Menu > UV > Unpin )
  • pin = pin XOR select ( Menu > UV > Invert )

That's all of the boolean expressions. There's only three of them. This PR completes the set of boolean expressions by adding the missing one. It's the same reason we have Select > All, Select > None and Select > Invert.

p.s. I haven't done the math, but I suspect it's not possible to implement "pin = pin XOR select" using only "OR" and "AND" because we don't have "NOT pin".

I think Brecht was just playing "Devil's Advocate" earlier. Let's try again: Pins were originally added to guide the unwrap operators, but have since expanded in scope: * During live unwrap, any island which contains a pin is not involved in packing. * In the UV Sculpt tools, Grab and Relax treat pinned vertices differently from unpinned. * UV > Align > Straighten tools use pinning information * When determining if a layout is "facing up" or "facing down", pinned islands are considered before unpinned islands. * Select Similar > Pinned now exists. * Pins can be used in arbitrary ways in user scripts. And most recently: * Pinned islands can be treated differently in the UV Packer. Are pins useful? Yeah, definitely. They do a lot more than just guide the unwrap process, and they'll continue to find more uses in the future, e.g. in proportional fall off, and in the stitch tools too. Now lets look at the interaction between selected vertices and the existing pins. There are two boolean values, and there are precisely three boolean expressions: * pin = pin OR select ( Menu > UV > Pin ) * pin = pin AND select ( Menu > UV > Unpin ) * pin = pin XOR select ( Menu > UV > Invert ) That's all of the boolean expressions. There's only three of them. This PR completes the set of boolean expressions by adding the missing one. It's the same reason we have Select > All, Select > None and Select > Invert. p.s. I haven't done the math, but I suspect it's not possible to implement "pin = pin XOR select" using only "OR" and "AND" because we don't have "NOT pin".
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
4 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#109187
No description provided.