GPv3: Select Alternate #109240

Merged
Falk David merged 6 commits from Lorenzo-Carpaneto/blender:gpv3-select-alternate into main 2023-06-23 11:34:06 +02:00
1 changed files with 4 additions and 0 deletions
Showing only changes of commit b6523945bc - Show all commits

View File

@ -274,6 +274,10 @@ void select_linked(bke::CurvesGeometry &curves)
void select_alternate(bke::CurvesGeometry &curves, const bool deselect_ends)
{
if (!has_anything_selected(curves)) {
return;
}
const OffsetIndices points_by_curve = curves.points_by_curve();
Lorenzo-Carpaneto marked this conversation as resolved Outdated

The ensure_selection_attribute call already makes sure we have a bool attribute. No need for the assert here.

The `ensure_selection_attribute` call already makes sure we have a `bool` attribute. No need for the assert here.

It doesn't actually. The type argument is only used when the selection attribute doesn't exist yet. So if the selection already has a float type, this operator will have to support that or change the attribute's type to boolean.

It doesn't actually. The type argument is only used when the selection attribute doesn't exist yet. So if the selection already has a float type, this operator will have to support that or change the attribute's type to boolean.

what do we want to do? We could template the function and support both selection; we could change the selection type, we could do nothing and prevent the user to use this if the type of selection isn't bool...

what do we want to do? We could template the function and support both selection; we could change the selection type, we could do nothing and prevent the user to use this if the type of selection isn't bool...

Since there is no exposed way of creating a float selection at the moment, I would just remove the assert and leave it as is.

Since there is no exposed way of creating a `float` selection at the moment, I would just remove the assert and leave it as is.

Then we are ready to merge this pr I think :)

Then we are ready to merge this pr I think :)
bke::GSpanAttributeWriter selection = ensure_selection_attribute(
curves, ATTR_DOMAIN_POINT, CD_PROP_BOOL);
Lorenzo-Carpaneto marked this conversation as resolved
Review

Hi, looks like this operator is only supported in point selection mode.
In that case, we could change the poll function to editable_grease_pencil_point_selection_poll

Hi, looks like this operator is only supported in point selection mode. In that case, we could change the poll function to `editable_grease_pencil_point_selection_poll`
Review

That is correct, yes. Should be changed.

That is correct, yes. Should be changed.
Review

I'll commit then directly? (or want a PR again?)

Edit: pushed to main: 51a5be8913

I'll commit then directly? (or want a PR again?) Edit: pushed to main: 51a5be891308e174e2bd8bc862bdde41545b08d1
Review

Thank you @PratikPB2123

Thank you @PratikPB2123