Fixes T44834
In weight paint, if an armature is selected, adds a
third, bone selection switch, next to the existing face and vertex
buttons, signifying that the user can use shift-click to select a bone.
Details
- Reviewers
Campbell Barton (campbellbarton) - Group Reviewers
Animation & Rigging - Maniphest Tasks
- T44834: Bone selection icon could be added next to Face and Vertex Selection in Weight Paint mode
Diff Detail
- Repository
- rB Blender
Event Timeline
Tested!
One small thing I noticed is that the bone icon doesn't show up until I select a bone, but then it remains even if I deselect all bones. I guess it's trying to avoid the bone icon showing up when weight painting without an armature? That's a good goal, but maybe it could just check for whether there is a pose mode armature at all to be found, rather than waiting for a bone to be selected? Not a big deal though.
Other than that, this feels like a nice addition that I'm sure will help avoid the confusion of not being able to select bones while in masking modes.
UI: Fix bug: bone selection button visibility
Bone selection button was incorrectly shown based on whether armatures
were selected. Whether bones are selectable in Weight Paint mode
actually depends on the mode of the bones.
Thanks for the feedback, @Demeter Dzadik (Mets)!
Indeed, I was trying to hide the button when no bones are selectable - however, it appears my logic was wrong. It seems the selectability of bones depends on whether they are in pose mode as you mentioned - I have updated the code to check for this. Now, the bone button is displayed if and only if the user can select a bone; otherwise, the old 2-button switch is shown to avoid confusion.
Please let me know if you have any additional suggestions. Also can't wait for my code to get roasted in CR :)
@Reinis Mazeiks (Reinis.Mazeiks) thanks for the patch! It's a fix for a 5 year old design task, nicely done. Do you think you can make some screenshots, and extend the task description a bit? Those not only help reviewing, but also will be useful for the release notes.
Tested this and think it's confusing, since this isn't doing anything spesific to bone selection, it just disables the other two options.
If turning both vertex and face selection off is confusing for users (with the current toggle buttons), then this patch doesn't help the case when pose mode isn't used, when users will still want to disable both.
Even when bone selection is not active you can still select bones which makes the option seem it's not working properly.
I think it would make more sense to expose this an enum with 3 states which are available in all modes without making it seem that disabling geometry selection is spesific to the case pose-mode and weight-paint mode are mixed.
@Campbell Barton (campbellbarton) this is sorely needed, since by default there is no easy way to select bones in weight paint mode. It’s one of the major issues we have in Weight Paint mode. Solving this is a must.
@William Reynish (billreynish) this patch just turns vertex and face selection off, you can do this already by toggling them off.
Hi @Campbell Barton (campbellbarton), thanks for the feedback! I hadn't noticed that bones can be selected with the geometry selection enabled as well (geometry seems to have priority when selecting; confused me with xray on) - knowing this, I agree that the new switch would be confusing.
Could you clarify what you meant by your suggested changes? I don't understand the benefit of having bone selection mode available in all modes (?), as this is only needed when weight painting bone influences if I understand correctly. Or are you suggesting that we should make it impossible for the user to select bones when the geometry selection modes are on?
Or perhaps we should make the bone selection mode a toggleable button, independent from geometry selection? That would make sense I guess, and give more control to the user.
I would appreciate it if you could define more precisely what the expected behavior is. Thank you!
@Reinis Mazeiks (Reinis.Mazeiks) as I see it there are two basic options.
- Display the two existing toggle buttons as 3 states (since they're mutually exclusive), where the additional state is not to use geometry selection at all.
This is what T44834 proposes, however after testing it, I think calling it bone selection is misleading. - Add a bone selection mode which changes selection behavior to prioritize bone selection, exact behavior for this is an open topic and I'm wary of adding this, managing mixed weight-paint and pose mode behavior is already getting over complicated (both for users and developers), so additions to this that further complicate things should be avoided.
Afaik bones can only be selected when geometry selection is enabled, by holding Ctrl. Since the user has to actively bypass the geometry selection mode, I think this is fine, and I don't think it's confusing.
Isn't this already the case in the current state of this patch? At least from user perspective, it feels like it. Maybe you are referring to the code side.
Turning it into an enum with 3 states sounds reasonable, but it will affect the workflow a bit. Currently one can bind just two keys to manage the three modes: One to toggle Vertex and one to toggle Face masking. Pressing the button that corresponds to the current masking mode will go back to "bone selection mode". If it were a 3-state enum, you would need 3 shortcuts. Maybe for this reason it makes sense to keep it as booleans? Not sure, but it's something to consider I guess.
*poke* Is there still any plans to work on this patch? I still think it's weird that in current master we have 2 toggle buttons that represent 3 states, so this patch might be an improvement on that if I understand it correctly, but there seems to be a lot of confusion. So I think if it could be cleared up what problem this patch is solving and how, it could still be a good addition to Blender.
@Demeter Dzadik (Mets) sorry for the radio silence. It is unlikely I will work on this again, C code is too complex for my brain to work with :(
Campbell's feedback makes a lot of sense, and further changes would probably be needed to make this a useful feature and avoid confusing users.
what problem this patch is solving
If I remember correctly, I was trying to improve the representation of the currently selected mode as I understood it from the original ticket, in cases where bone selection was relevant. However, after further playing around I discovered that I had misunderstood how the selection works - I now realize that in some cases it's also possible to select bones even when the bone selection mode is switched off - so this representation might be misleading. ofc feel free to discard it or build on it, whatever you think is best. Good luck to whoever picks this up, and sorry i wasn't able to implement this myself!
No worries, thanks for getting back! Maybe someone will pick it up some day :) Maybe I will! But C code hurts my brain also :D