Commit: ad7682ffdb3db5d368fd5d16f1649da780cc069f
Author: Gaia Clary
Date:   Wed Dec 16 20:37:29 2020 +0100
Branches: master
https://developer.blender.org/rBad7682ffdb3db5d368fd5d16f1649da780cc069f

Allow vertex tools to operate on weight groups when armature is in object mode

Since a few versions (even before 2.79) we have an option that allows to 
restrict the vertex tools to operate only on deform groups. This was originally 
implemented for working with vertex groups for skeletal animation. In that case 
it is fortunate to have weight tools operate only on deforming vertext groups 
(vgroups assigned to bones)

In previous versions of Blender (up to 2.79) we have been able to use this 
option in Mesh Edit mode regardless of the armature mode. The current 
implementation (since 2.80 as far as i know) enables this option only when the 
associated armature is in pose mode. this has a bad consequence:

It is not at all intuitive that you have to put the armature into Pose mode 
before you can make use of the option in mesh edit mode.
Besides this it is not even necessary in the case when the user wants to 
restrict the tool only to all pose bones. In that case the armature can safely 
be kept in Object mode. However, when the tool shall apply only to selected 
pose bones, then it actually makes sense to have the armature in pose mode (as 
it is implemented right now)

I do not know why this feature has been restricted as described above. It must 
have got lost somewhere on the way to Blender 2.90

This patch fixes the issue as it allows to select the "restrict to pose bones" 
option when the armature is in any mode. I see no downsides of this change, 
actually this is a fix for a feature that once worked and apparently got 
forgotten in newer releases.

Reviewed By: sybren, campbellbarton

Differential Revision: https://developer.blender.org/D9658

===================================================================

M       source/blender/editors/object/object_vgroup.c

===================================================================

diff --git a/source/blender/editors/object/object_vgroup.c 
b/source/blender/editors/object/object_vgroup.c
index 3d6a6abfe0d..23f1718cb2e 100644
--- a/source/blender/editors/object/object_vgroup.c
+++ b/source/blender/editors/object/object_vgroup.c
@@ -741,6 +741,9 @@ const EnumPropertyItem 
*ED_object_vgroup_selection_itemf_helper(const bContext *
       RNA_enum_items_add_value(
           &item, &totitem, WT_vertex_group_select_item, WT_VGROUP_BONE_SELECT);
     }
+  }
+
+  if (BKE_modifiers_is_deformed_by_armature(ob)) {
     if (selection_mask & (1 << WT_VGROUP_BONE_DEFORM)) {
       RNA_enum_items_add_value(
           &item, &totitem, WT_vertex_group_select_item, WT_VGROUP_BONE_DEFORM);

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to