Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/object/object_vgroup.c
| Context not available. | |||||
| return BKE_object_is_in_editmode_vgroup(ob); | return BKE_object_is_in_editmode_vgroup(ob); | ||||
| } | } | ||||
| /* editmode _or_ weight paint vertex sel */ | static bool BKE_object_is_in_vorw_paint_select_vert(Object *ob) | ||||
| { | |||||
| if (ob->type == OB_MESH) { | |||||
| Mesh *me = ob->data; | |||||
| return ((ob->mode & (OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT)) && | |||||
| (me->edit_btmesh == NULL) && | |||||
| (ME_EDIT_PAINT_SEL_MODE(me) == SCE_SELECT_VERTEX)); | |||||
| } | |||||
| return false; | |||||
| } | |||||
| /* editmode _or_ weight paint vertex sel _or_ vertex paint */ | |||||
| static int vertex_group_vert_select_poll(bContext *C) | static int vertex_group_vert_select_poll(bContext *C) | ||||
| { | { | ||||
| Object *ob = ED_object_context(C); | Object *ob = ED_object_context(C); | ||||
campbellbarton: texture paint doesn't do vertex selection. | |||||
Not Done Inline Actionscode above checks for editmesh, this isnt needed. campbellbarton: code above checks for editmesh, this isnt needed. | |||||
| Context not available. | |||||
| if (!(ob && !ob->id.lib && data && !data->lib)) | if (!(ob && !ob->id.lib && data && !data->lib)) | ||||
| return 0; | return 0; | ||||
| return (BKE_object_is_in_editmode_vgroup(ob) || | if (BKE_object_is_in_editmode_vgroup(ob)) | ||||
| BKE_object_is_in_wpaint_select_vert(ob)); | return 1; | ||||
| return (BKE_object_is_in_editmode_vgroup(ob) || | |||||
| BKE_object_is_in_vorw_paint_select_vert(ob)); | |||||
| } | } | ||||
| /* editmode _or_ weight paint vertex sel and active group unlocked */ | /* editmode _or_ weight paint vertex sel and active group unlocked */ | ||||
| Context not available. | |||||
| return 0; | return 0; | ||||
| if (!(BKE_object_is_in_editmode_vgroup(ob) || | if (!(BKE_object_is_in_editmode_vgroup(ob) || | ||||
| BKE_object_is_in_wpaint_select_vert(ob))) | BKE_object_is_in_vorw_paint_select_vert(ob))) | ||||
| { | { | ||||
| return 0; | return 0; | ||||
| } | } | ||||
| Context not available. | |||||
| ot->description = "Assign the selected vertices to a new vertex group"; | ot->description = "Assign the selected vertices to a new vertex group"; | ||||
| /* api callbacks */ | /* api callbacks */ | ||||
| ot->poll = vertex_group_vert_select_poll; | ot->poll = vertex_group_vert_select_poll; | ||||
| ot->exec = vertex_group_assign_new_exec; | ot->exec = vertex_group_assign_new_exec; | ||||
| /* flags */ | /* flags */ | ||||
| Context not available. | |||||
texture paint doesn't do vertex selection.