Animation: Weight Paint select more/less for vertices #105633

Merged
Christoph Lendenfeld merged 14 commits from ChrisLend/blender:weight_paint_grow_sel_vert into main 2023-03-31 14:48:09 +02:00
3 changed files with 13 additions and 9 deletions
Showing only changes of commit 3d296f327e - Show all commits

View File

@ -444,7 +444,7 @@ void paintvert_select_linked_pick(struct bContext *C,
struct Object *ob,
const int region_coordinates[2],
bool select);
void paintvert_select_more(struct bContext *C, struct Object *ob, bool face_step);
void paintvert_select_more(struct Mesh *mesh, bool face_step);
void paintvert_select_less(struct bContext *C, struct Object *ob, bool face_step);
void paintvert_hide(struct bContext *C, struct Object *ob, bool unselected);
void paintvert_reveal(struct bContext *C, struct Object *ob, bool select);

View File

@ -660,13 +660,9 @@ void paintvert_select_linked(bContext *C, Object *ob)
paintvert_select_linked_vertices(C, ob, indices, true);
}
void paintvert_select_more(bContext *C, Object *ob, const bool face_step)
void paintvert_select_more(Mesh *mesh, const bool face_step)
{
using namespace blender;
Mesh *mesh = BKE_mesh_from_object(ob);
if (mesh == nullptr || mesh->totpoly == 0) {
return;
}
bke::MutableAttributeAccessor attributes = mesh->attributes_for_write();
bke::SpanAttributeWriter<bool> select_vert = attributes.lookup_or_add_for_write_span<bool>(
@ -716,8 +712,6 @@ void paintvert_select_more(bContext *C, Object *ob, const bool face_step)
}
select_vert.finish();
paintvert_flush_flags(ob);
paintvert_tag_select_update(C, ob);
}
void paintvert_select_less(bContext *C, Object *ob, const bool face_step)

View File

@ -798,9 +798,19 @@ void PAINT_OT_vert_select_linked_pick(wmOperatorType *ot)
static int paintvert_select_more_exec(bContext *C, wmOperator *op)
{
Object *ob = CTX_data_active_object(C);
Mesh *mesh = BKE_mesh_from_object(ob);
if (mesh == NULL || mesh->totpoly == 0) {
return OPERATOR_CANCELLED;
}
const bool face_step = RNA_boolean_get(op->ptr, "face_step");
paintvert_select_more(C, CTX_data_active_object(C), face_step);
paintvert_select_more(mesh, face_step);
paintvert_flush_flags(ob);
paintvert_tag_select_update(C, ob);
ED_region_tag_redraw(CTX_wm_region(C));
return OPERATOR_FINISHED;
}