Allow setting weights (Ctrl+X) without paintmask enabled #112413

Merged
Philipp Oeser merged 1 commits from lichtwerk/blender:set_weight_without_paintmask into main 2023-09-27 09:13:13 +02:00
Member

Currently if there is no selection mode enabled the operator is disabled and greyed
out in the menu. The shortcut doesn't do anything, which can be unexpected and jarring.

With this PR the operator will work when no selection mode is enabled and in that case
fill the entire mesh using the Weight from the active tool.
This is then consistent with vertex paint mode and the "Set Vertex Color" operator.

So now remove the overly-strict mask_paint_poll poll (and replace with
more appropriate weight_paint_mode_poll).

NOTE: mask_paint_poll is now unused, could be removed

Currently if there is no selection mode enabled the operator is disabled and greyed out in the menu. The shortcut doesn't do anything, which can be unexpected and jarring. With this PR the operator will work when no selection mode is enabled and in that case fill the entire mesh using the Weight from the active tool. This is then consistent with vertex paint mode and the "Set Vertex Color" operator. So now remove the overly-strict `mask_paint_poll` poll (and replace with more appropriate `weight_paint_mode_poll`). NOTE: `mask_paint_poll` is now unused, could be removed
Philipp Oeser added 1 commit 2023-09-15 13:26:22 +02:00
0154037851 Allow setting weights (Ctrl+X) without paintmask enabled
Compared to setting vertex colors with Ctrl+X (which does not have the
requirement of having vertex/face mask enabled) this was inconsistent.
It is also not needed to check if paintmask is enabled, the code checks
for this just fine.

So now remove the overly-strict `mask_paint_poll` poll (and replace with
more appropriate `weight_paint_mode_poll`).

NOTE: `mask_paint_poll` is now unused, could be removed
Philipp Oeser added this to the Animation & Rigging project 2023-09-15 13:26:31 +02:00
Philipp Oeser added the
Interest
Sculpt, Paint & Texture
label 2023-09-15 13:26:36 +02:00
Philipp Oeser requested review from Sybren A. Stüvel 2023-09-15 13:26:47 +02:00
Philipp Oeser requested review from Julien Kaspar 2023-09-15 13:26:53 +02:00
Julien Kaspar approved these changes 2023-09-15 15:07:42 +02:00
Julien Kaspar left a comment
Member

Yes I think this is for the best for consistency, even if it would be rarely used.

Yes I think this is for the best for consistency, even if it would be rarely used.

As someone who doesn't do weightpainting on a daily basis, I'm a bit confused as to what this changes in practice.

As someone who doesn't do weightpainting on a daily basis, I'm a bit confused as to what this changes in practice.
Member

This change was suggested from the rigging module artists when the keymap changes were introduced.
I'm unsure if riggers would make heavy use of this operator when there's no selection but it is nice to allow it for consistency.

I can personally see one use case: Instead of selecting everything in edit mode and using the "Assign" button (in Properties -> Object Data -> Vertex Groups), this can now directly be done in Weight Paint mode with this operator shortcut.

This change was suggested from the rigging module artists when the keymap changes were introduced. I'm unsure if riggers would make heavy use of this operator when there's no selection but it is nice to allow it for consistency. I can personally see one use case: Instead of selecting everything in edit mode and using the "Assign" button (in Properties -> Object Data -> Vertex Groups), this can now directly be done in Weight Paint mode with this operator shortcut.

This change was suggested from the rigging module artists when the keymap changes were introduced.

For tracability of such decisions, please include information like this in the PR description. A link to the relevant meeting notes / devtalk thread would also be good. Right now, for me, this PR came out of the blue, and it's hard to do a review like that.

Please also refer to https://wiki.blender.org/wiki/Process/Contributing_Code#Ingredients_of_a_Pull_Request, as this PR description doesn't include much info about which problem is being solved, or why this is the best way to solve this.

I'm unsure if riggers would make heavy use of this operator when there's no selection but it is nice to allow it for consistency.

What would it do when there is no selection?

I can personally see one use case: Instead of selecting everything in edit mode and using the "Assign" button (in Properties -> Object Data -> Vertex Groups), this can now directly be done in Weight Paint mode with this operator shortcut.

I'm still confused as to what the exact problem is that this PR addresses. Or what the practical impact is of this change.

> This change was suggested from the rigging module artists when the keymap changes were introduced. For tracability of such decisions, please include information like this in the PR description. A link to the relevant meeting notes / devtalk thread would also be good. Right now, for me, this PR came out of the blue, and it's hard to do a review like that. Please also refer to https://wiki.blender.org/wiki/Process/Contributing_Code#Ingredients_of_a_Pull_Request, as this PR description doesn't include much info about which problem is being solved, or why this is the best way to solve this. > I'm unsure if riggers would make heavy use of this operator when there's no selection but it is nice to allow it for consistency. What would it do when there is no selection? > I can personally see one use case: Instead of selecting everything in edit mode and using the "Assign" button (in Properties -> Object Data -> Vertex Groups), this can now directly be done in Weight Paint mode with this operator shortcut. I'm still confused as to what the exact problem is that this PR addresses. Or what the practical impact is of this change.
Author
Member

This change was suggested from the rigging module artists when the keymap changes were introduced.

For tracability of such decisions, please include information like this in the PR description. A link to the relevant meeting notes / devtalk thread would also be good. Right now, for me, this PR came out of the blue, and it's hard to do a review like that.

I wasnt aware this was "officially" decided actually, so it actually came "out of the blue" -- from personal observation.
Will try to dig up meeting notes (or do you have a link @JulienKaspar ?)

Please also refer to https://wiki.blender.org/wiki/Process/Contributing_Code#Ingredients_of_a_Pull_Request, as this PR description doesn't include much info about which problem is being solved, or why this is the best way to solve this.

I'm unsure if riggers would make heavy use of this operator when there's no selection but it is nice to allow it for consistency.

What would it do when there is no selection?

It does it on the entire mesh (just like if you would enable paint mask and select everything -- or as @JulienKaspar described "Instead of selecting everything in edit mode and using the "Assign" button (in Properties -> Object Data -> Vertex Groups), this can now directly be done in Weight Paint mode with this operator shortcut."

I can personally see one use case: Instead of selecting everything in edit mode and using the "Assign" button (in Properties -> Object Data -> Vertex Groups), this can now directly be done in Weight Paint mode with this operator shortcut.

I'm still confused as to what the exact problem is that this PR addresses. Or what the practical impact is of this change.

Well, it makes it consistent with vertexpaint and saves you a couple of clicks in weightpaint

> > This change was suggested from the rigging module artists when the keymap changes were introduced. > > For tracability of such decisions, please include information like this in the PR description. A link to the relevant meeting notes / devtalk thread would also be good. Right now, for me, this PR came out of the blue, and it's hard to do a review like that. > I wasnt aware this was "officially" decided actually, so it actually came "out of the blue" -- from personal observation. Will try to dig up meeting notes (or do you have a link @JulienKaspar ?) > Please also refer to https://wiki.blender.org/wiki/Process/Contributing_Code#Ingredients_of_a_Pull_Request, as this PR description doesn't include much info about which problem is being solved, or why this is the best way to solve this. > > > I'm unsure if riggers would make heavy use of this operator when there's no selection but it is nice to allow it for consistency. > > What would it do when there is no selection? > It does it on the entire mesh (just like if you would enable paint mask and select everything -- or as @JulienKaspar described "Instead of selecting everything in edit mode and using the "Assign" button (in Properties -> Object Data -> Vertex Groups), this can now directly be done in Weight Paint mode with this operator shortcut." > > I can personally see one use case: Instead of selecting everything in edit mode and using the "Assign" button (in Properties -> Object Data -> Vertex Groups), this can now directly be done in Weight Paint mode with this operator shortcut. > > I'm still confused as to what the exact problem is that this PR addresses. Or what the practical impact is of this change. > Well, it makes it consistent with vertexpaint and saves you a couple of clicks in weightpaint
Member

Next time I'll document the request in meeting notes or somewhere traceable. Instead it was done in the module chat and hard to trace back.

For the missing info:

Currently if there is no selection mode enabled the operator is disabled and greyed out in the menu. The shortcut doesn't do anything, which can be unexpected and jarring.

With this PR the operator will work when no selection mode is enabled and in that case fill the entire mesh using the Weight from the active tool.
This is then consistent with vertex paint mode and the "Set Vertex Color" operator.

Next time I'll document the request in meeting notes or somewhere traceable. Instead it was done in the module chat and hard to trace back. For the missing info: Currently if there is no selection mode enabled the operator is disabled and greyed out in the menu. The shortcut doesn't do anything, which can be unexpected and jarring. With this PR the operator will work when no selection mode is enabled and in that case fill the entire mesh using the Weight from the active tool. This is then consistent with vertex paint mode and the "Set Vertex Color" operator.

Thanks for the clarification, this helps.

I think the UI module should make a decision on this. There are other operators that silently do nothing when nothing is selected; the 'Symmetrize Armature' was discussed in #107902 (comment). Blender is inconsistent here, where some operators are disabled (like 'Set Weights') and some do nothing (like 'Delete' in mesh edit mode, or 'Delete Objects', which is even more insulting because it does ask you to confirm before doing nothing).

For the Symmetrize Armature we decided that it's likely best to keep it working, but emit a warning when there was nothing selected. I personally think that's the right approach, but as I said, it would be better to have a more Blender-wide approach to this (or maybe there is already and I'm just not aware).

Thanks for the clarification, this helps. I think the UI module should make a decision on this. There are other operators that silently do nothing when nothing is selected; the 'Symmetrize Armature' was discussed in https://projects.blender.org/blender/blender/pulls/107902#issuecomment-964704. Blender is inconsistent here, where some operators are disabled (like 'Set Weights') and some do nothing (like 'Delete' in mesh edit mode, or 'Delete Objects', which is even more insulting because it does ask you to confirm before doing nothing). For the Symmetrize Armature we decided that it's likely best to keep it working, but emit a warning when there was nothing selected. I personally think that's the right approach, but as I said, it would be better to have a more Blender-wide approach to this (or maybe there is already and I'm just not aware).
Author
Member

Thanks for the clarification, this helps.

I think the UI module should make a decision on this. There are other operators that silently do nothing when nothing is selected; the 'Symmetrize Armature' was discussed in #107902 (comment). Blender is inconsistent here, where some operators are disabled (like 'Set Weights') and some do nothing (like 'Delete' in mesh edit mode, or 'Delete Objects', which is even more insulting because it does ask you to confirm before doing nothing).

For the Symmetrize Armature we decided that it's likely best to keep it working, but emit a warning when there was nothing selected. I personally think that's the right approach, but as I said, it would be better to have a more Blender-wide approach to this (or maybe there is already and I'm just not aware).

I think comparing Set Weights to the other operators you mention is misleading since objectmode / editmode /posemode do not require to enable something to make a selection to begin with (enable paintmask).
You can do pretty much everything in the Weights menu without having anything selected (except for Set Weights) as well as using the tools/brushes which also dont require a selection.

> Thanks for the clarification, this helps. > > I think the UI module should make a decision on this. There are other operators that silently do nothing when nothing is selected; the 'Symmetrize Armature' was discussed in https://projects.blender.org/blender/blender/pulls/107902#issuecomment-964704. Blender is inconsistent here, where some operators are disabled (like 'Set Weights') and some do nothing (like 'Delete' in mesh edit mode, or 'Delete Objects', which is even more insulting because it does ask you to confirm before doing nothing). > > For the Symmetrize Armature we decided that it's likely best to keep it working, but emit a warning when there was nothing selected. I personally think that's the right approach, but as I said, it would be better to have a more Blender-wide approach to this (or maybe there is already and I'm just not aware). > I think comparing `Set Weights` to the other operators you mention is misleading since objectmode / editmode /posemode do not require to `enable` something to make a selection to begin with (enable paintmask). You can do pretty much everything in the `Weights` menu without having anything selected (except for `Set Weights`) as well as using the tools/brushes which also dont require a selection.
Sybren A. Stüvel approved these changes 2023-09-26 18:19:49 +02:00
Sybren A. Stüvel left a comment
Member

Good point!

Good point!
Philipp Oeser merged commit 0b1d2d63fe into main 2023-09-27 09:13:13 +02:00
Philipp Oeser deleted branch set_weight_without_paintmask 2023-09-27 09:13:14 +02:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser Project (Legacy)
Interest
Asset System
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 Assignees
3 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#112413
No description provided.