Fix #44834: Add bone selection icon next to face and vertex selection in weight paint mode #115409

Merged
Christoph Lendenfeld merged 5 commits from daisea3e1203/blender:add_bone_selection_switch into main 2023-12-01 13:39:07 +01:00
Contributor

Issue

Currently, in weight paint mode, there is an icon for face and vertex selection mode, but there isn't one for the default mode where the user can select a bone in any tool by alt clicking. This lack of indication might lead to confusion for the users when they are not able to select a bone by alt clicking during weight painting.

Solution

By adding a bone selection icon when there is a pose mode armature, we can communicate to the user that:

  1. they can select a bone while the bone selection icon is active. (when they are not in face or vertex selection mode)
  2. they have forgot to select an armature when entering weight paint mode by not showing the bone selection icon at all when there is no pose mode armature.

Old:
The bone selection icon is not present in any case
image

New:
The bone selection icon is present when entering weight paint mode with an armature selected. When it is active the user can select a bone by alt clicking.

image

When the bone selection icon is inactive, the user can't select a bone (alt clicking selects face and vertex mode's respective element)

image

When no armature is selected when entering weight paint mode (no pose mode armature exists), the bone selection icon doesn't show up indicating that the user has forgot to select an armature. (The user is also unable to select a bone by alt clicking.)

image

Note: There was an abandoned PR for this issue 3 years ago, and I tried to take the review here into account as much as possible when deciding on and implementing this solution. (https://archive.blender.org/developer/D7855?id=25210)

Related fixes

(Partly due to this being my first PR, I wasn't able to decide if the following changes should be in a different PR. Please comment if this is the case.)

Selection tool for bone selection mode

Currently, while selection tools exist for face and vertex selection mode, one doesn't exist for the default mode (bone selection mode). As the default mode will be getting a clear indicator that it will function as a bone selection mode, I added a selection tool entry for the bone selection mode.

image

Note: I only added the tweak tool and not the other selection tools (box, lasso and circle) because selecting multiple bones in weight paint mode isn't useful.

EDIT: It was mentioned that selecting multiple bones in weight paint mode has its uses in a related issue #114981 , so the task of adding box, lasso, and circle selection tools is moved to the Future Improvements section.

Note: currently, going to bone selection mode when using Box Select tool in face and vertex selection mode results in no tools selected at all. Although left mouse click functions the same as in tweak tool, it would be unclear to the user. This will be addressed when adding box, lasso and circle selection tool to bone selection mode, thus the list of tools matching for all three modes.

image

Shortcut for bone selection mode

Face and vertex selection modes has the shortcut 1 and 2, so it seemed natural to give bone selection mode the shortcut of 3.

Future Improvements

In this PR, only the tweak tool is enabled for bone selection mode because simply adding box, circle and lasso select to the tool entry does not make them function as expected. (box, circle and lasso select tools all behave like the tweak tool for bone selection.) Making the other selection tools function like they do in pose mode while in bone selection mode will be addressed in a different PR. (I'm planning on tackling this right after.)
(or if you think this should be addressesd in this PR, please let me know!)

Files

Example file used in screen shots: issue_44834.blend

# Issue Currently, in weight paint mode, there is an icon for face and vertex selection mode, but there isn't one for the default mode where the user can select a bone in any tool by alt clicking. This lack of indication might lead to confusion for the users when they are not able to select a bone by alt clicking during weight painting. # Solution By adding a bone selection icon when there is a pose mode armature, we can communicate to the user that: 1. they can select a bone while the bone selection icon is active. (when they are not in face or vertex selection mode) 2. they have forgot to select an armature when entering weight paint mode by not showing the bone selection icon at all when there is no pose mode armature. **Old:** The bone selection icon is not present in any case ![image](/attachments/ef10c45b-d37e-49b9-9bcc-fd98a91c42a8) **New:** The bone selection icon is present when entering weight paint mode with an armature selected. When it is active the user can select a bone by alt clicking. ![image](/attachments/1d65581a-944a-4250-bb0a-1eb0a36e0969) When the bone selection icon is inactive, the user can't select a bone (alt clicking selects face and vertex mode's respective element) ![image](/attachments/86b3b7d7-6061-4861-96b2-dc229025a1aa) When no armature is selected when entering weight paint mode (no pose mode armature exists), the bone selection icon doesn't show up indicating that the user has forgot to select an armature. (The user is also unable to select a bone by alt clicking.) ![image](/attachments/ebf62dd1-5e49-4c0e-bec9-2a3d029396a3) Note: There was an abandoned PR for this issue 3 years ago, and I tried to take the review here into account as much as possible when deciding on and implementing this solution. (https://archive.blender.org/developer/D7855?id=25210) # Related fixes (Partly due to this being my first PR, I wasn't able to decide if the following changes should be in a different PR. Please comment if this is the case.) ## Selection tool for bone selection mode Currently, while selection tools exist for face and vertex selection mode, one doesn't exist for the default mode (bone selection mode). As the default mode will be getting a clear indicator that it will function as a bone selection mode, I added a selection tool entry for the bone selection mode. ![image](/attachments/6d4593bd-0bf0-4dc9-8360-319754bbf03d) ~~Note: I only added the tweak tool and not the other selection tools (box, lasso and circle) because selecting multiple bones in weight paint mode isn't useful.~~ **EDIT:** It was mentioned that selecting multiple bones in weight paint mode has its uses in a related issue #114981 , so the task of adding box, lasso, and circle selection tools is moved to the Future Improvements section. Note: currently, going to bone selection mode when using Box Select tool in face and vertex selection mode results in no tools selected at all. Although left mouse click functions the same as in tweak tool, it would be unclear to the user. This will be addressed when adding box, lasso and circle selection tool to bone selection mode, thus the list of tools matching for all three modes. ![image](/attachments/7a698244-6faf-429b-90e9-a4c9fdce17f8) ## Shortcut for bone selection mode Face and vertex selection modes has the shortcut 1 and 2, so it seemed natural to give bone selection mode the shortcut of 3. # Future Improvements In this PR, only the tweak tool is enabled for bone selection mode because simply adding box, circle and lasso select to the tool entry does not make them function as expected. (box, circle and lasso select tools all behave like the tweak tool for bone selection.) Making the other selection tools function like they do in pose mode while in bone selection mode will be addressed in a different PR. (I'm planning on tackling this right after.) (or if you think this should be addressesd in this PR, please let me know!) # Files Example file used in screen shots: [issue_44834.blend](/attachments/abe423aa-50ab-4c77-9e9c-7996b5bc7d2d)
Daiki Hashimoto added 3 commits 2023-11-25 15:11:50 +01:00
Iliya Katushenock added this to the User Interface project 2023-11-25 15:12:50 +01:00
Christoph Lendenfeld requested review from Christoph Lendenfeld 2023-11-28 14:34:20 +01:00
Christoph Lendenfeld requested changes 2023-11-28 14:56:19 +01:00
Christoph Lendenfeld left a comment
Member

I was able to get a python error
Ignore that, seems to be independent of this PR: #115276: UI code error spam: space_view3d_toolbar line 678

Traceback (most recent call last):
  File "/home/christoph/blender-git/build_linux_debug/bin/4.1/scripts/startup/bl_ui/space_view3d_toolbar.py", line 678, in draw_header
    iface_("%s") % (ob.vertex_groups.active.name) if ob.vertex_groups else
AttributeError: 'NoneType' object has no attribute 'name'

And the order of the items in the toolbar should be consistent between vert/face/bone select modes.
I know this isn't consistent with object mode, but that could be a separate PR.

But adding the tweak tool to the toolbar is ok for this PR IMO.

Overall great job though. I will make a build and give this to the riggers to test.
Also it will be discussed in the upcoming module meeting. If you have time you are more than welcome to join

~~I was able to get a python error~~ Ignore that, seems to be independent of this PR: [#115276: UI code error spam: space_view3d_toolbar line 678](https://projects.blender.org/blender/blender/issues/115276) ``` Traceback (most recent call last): File "/home/christoph/blender-git/build_linux_debug/bin/4.1/scripts/startup/bl_ui/space_view3d_toolbar.py", line 678, in draw_header iface_("%s") % (ob.vertex_groups.active.name) if ob.vertex_groups else AttributeError: 'NoneType' object has no attribute 'name' ``` And the order of the items in the toolbar should be consistent between vert/face/bone select modes. I know this isn't consistent with object mode, but that could be a separate PR. But adding the tweak tool to the toolbar is ok for this PR IMO. Overall great job though. I will make a build and give this to the riggers to test. Also it will be discussed in the upcoming module meeting. If you have time you are more than welcome to join
Christoph Lendenfeld added the
Module
Animation & Rigging
Interest
User Interface
labels 2023-11-28 14:56:50 +01:00

@blender-bot package

@blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR115409) when ready.
Daiki Hashimoto added 2 commits 2023-11-29 03:53:35 +01:00
Author
Contributor

@ChrisLend
Thank you so much for the review!

And the order of the items in the toolbar should be consistent between vert/face/bone select modes.

This should be addressed in the latest commit (6edded7564).

Looking forward to joining the next module meeting :)

@ChrisLend Thank you so much for the review! > And the order of the items in the toolbar should be consistent between vert/face/bone select modes. This should be addressed in the latest commit (6edded7564). Looking forward to joining the next module meeting :)
Member

Seems to work nicely, LGTM! :)

Downloaded a build from before the aforementioned fix, but I also didn't read Christoph's comment before testing, so the only issue I ran into was the same as him.

Supporting other (bone) selection tools (box, circle, lasso) would be nice, but maybe that's a separate/future task. The hotkeys for box and circle select already work anyways.

I was able to get a python error

This is unrelated, there's a report for it here: #115276

Seems to work nicely, LGTM! :) Downloaded a build from before the aforementioned fix, but I also didn't read Christoph's comment before testing, so the only issue I ran into was the same as him. Supporting other (bone) selection tools (box, circle, lasso) would be nice, but maybe that's a separate/future task. The hotkeys for box and circle select already work anyways. > I was able to get a python error This is unrelated, there's a report for it here: https://projects.blender.org/blender/blender/issues/115276
Member

Thanks for the PR! Excited to get this landed.

I'm not super familiar with this area of Blender's code, but as far as I can tell the code looks good.

In testing, the button behavior feels weird to me now that there's a third button. Specifically, the face and vertex selection mode buttons still behave like toggles. When there was just the two of them, that made sense. But now that there's a third button explicitly representing the third state, I think it would make more sense for all three buttons to just be "switch to this mode", with no toggle behavior.

The only other issues I found are also in current master, and thus not an issue with this PR.

Thanks for the PR! Excited to get this landed. I'm not super familiar with this area of Blender's code, but as far as I can tell the code looks good. In testing, the button behavior feels weird to me now that there's a third button. Specifically, the face and vertex selection mode buttons still behave like toggles. When there was just the two of them, that made sense. But now that there's a third button explicitly representing the third state, I think it would make more sense for all three buttons to just be "switch to this mode", with no toggle behavior. The only other issues I found are also in current master, and thus not an issue with this PR.
Member

Eeehhhh, I'm usually a fan of consistency, but I think people like me already have a strong muscle memory for pressing the masking mode they're already in, to go back to bone selection. That also means you can still manage all 3 states with just 2 hotkeys. Of course, with the new default hotkeys that's not a big deal, since "1, 2, 3" keys makes a lot of sense. But if anyone else is a hotkey traditionalist like myself, and changed those hotkeys back to V and M after the 4.0 keymap changes, they'd now have to juggle the V, M, and 3 keys.

So, while I may be biased and selfish, I'd vote for keeping the toggling behaviour as it is, unless it really makes the code simpler/development easier, or you feel strongly about it.

Eeehhhh, I'm usually a fan of consistency, but I think people like me already have a strong muscle memory for pressing the masking mode they're already in, to go back to bone selection. That also means you can still manage all 3 states with just 2 hotkeys. Of course, with the new default hotkeys that's not a big deal, since "1, 2, 3" keys makes a lot of sense. But if anyone else is a hotkey traditionalist like myself, and changed those hotkeys back to V and M after the 4.0 keymap changes, they'd now have to juggle the V, M, and 3 keys. So, while I may be biased and selfish, I'd vote for keeping the toggling behaviour as it is, unless it really makes the code simpler/development easier, or you feel strongly about it.
Christoph Lendenfeld approved these changes 2023-12-01 13:31:54 +01:00
Christoph Lendenfeld left a comment
Member

looks good to me

The toggling behavior is a bit weird, but I side with demeter on this.
I don't think it's a big deal overall

looks good to me The toggling behavior is a bit weird, but I side with demeter on this. I don't think it's a big deal overall
Christoph Lendenfeld merged commit edcac1f48b into main 2023-12-01 13:39:07 +01:00
Member

I still think we should change the behavior as I described, but I'm fine leaving that for a future PR. And we can discuss it more then.

I still think we should change the behavior as I described, but I'm fine leaving that for a future PR. And we can discuss it more then.
Daiki Hashimoto deleted branch add_bone_selection_switch 2023-12-02 09:18:08 +01:00
Sign in to join this conversation.
No reviewers
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
5 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#115409
No description provided.