Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/object/object_vgroup.c
| Show First 20 Lines • Show All 687 Lines • ▼ Show 20 Lines | static const EnumPropertyItem WT_vertex_group_select_item[] = { | ||||
| "Deform Pose Bones", | "Deform Pose Bones", | ||||
| "All Vertex Groups assigned to Deform Bones"}, | "All Vertex Groups assigned to Deform Bones"}, | ||||
| {WT_VGROUP_ALL, "ALL", 0, "All Groups", "All Vertex Groups"}, | {WT_VGROUP_ALL, "ALL", 0, "All Groups", "All Vertex Groups"}, | ||||
| {0, NULL, 0, NULL, NULL}, | {0, NULL, 0, NULL, NULL}, | ||||
| }; | }; | ||||
| const EnumPropertyItem *ED_object_vgroup_selection_itemf_helper(const bContext *C, | const EnumPropertyItem *ED_object_vgroup_selection_itemf_helper(const bContext *C, | ||||
| PointerRNA *UNUSED(ptr), | PointerRNA *UNUSED(ptr), | ||||
| PropertyRNA *UNUSED(prop), | PropertyRNA *prop, | ||||
| bool *r_free, | bool *r_free, | ||||
| const uint selection_mask) | const uint selection_mask) | ||||
| { | { | ||||
| Object *ob; | Object *ob; | ||||
| EnumPropertyItem *item = NULL; | EnumPropertyItem *item = NULL; | ||||
| int totitem = 0; | int totitem = 0; | ||||
| if (C == NULL) { | if (C == NULL) { | ||||
| Show All 21 Lines | if (BKE_modifiers_is_deformed_by_armature(ob)) { | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| if (selection_mask & (1 << WT_VGROUP_ALL)) { | if (selection_mask & (1 << WT_VGROUP_ALL)) { | ||||
| RNA_enum_items_add_value(&item, &totitem, WT_vertex_group_select_item, WT_VGROUP_ALL); | RNA_enum_items_add_value(&item, &totitem, WT_vertex_group_select_item, WT_VGROUP_ALL); | ||||
| } | } | ||||
| /* Set `Deform Bone` as default selection if armature is present. */ | |||||
sybren: This explains the //what//, but not //why// this is done. The patch title and description also… | |||||
| RNA_def_property_enum_default( | |||||
| prop, BKE_modifiers_is_deformed_by_armature(ob) ? WT_VGROUP_BONE_DEFORM : WT_VGROUP_ALL); | |||||
| RNA_enum_item_end(&item, &totitem); | RNA_enum_item_end(&item, &totitem); | ||||
| *r_free = true; | *r_free = true; | ||||
| return item; | return item; | ||||
| } | } | ||||
| static const EnumPropertyItem *rna_vertex_group_with_single_itemf(bContext *C, | static const EnumPropertyItem *rna_vertex_group_with_single_itemf(bContext *C, | ||||
| PointerRNA *ptr, | PointerRNA *ptr, | ||||
| ▲ Show 20 Lines • Show All 3,823 Lines • Show Last 20 Lines | |||||
This explains the what, but not why this is done. The patch title and description also don't explain this, so for future developers it becomes tricky to figure out the motivation.