GPv3: Cyclical set operator #111904

Merged
Falk David merged 16 commits from casey-bianco-davis/blender:GPv3-cyclical-set-operator into main 2023-10-20 10:12:34 +02:00
Showing only changes of commit a56851b9e6 - Show all commits

View File

@ -891,6 +891,11 @@ static int grease_pencil_cyclical_set_exec(bContext *C, wmOperator *op)
return;
}
/* Return to stop from creating unneeded attribute. */
if (mode == CyclicalMode::OPEN && !curves.attributes().contains("cyclic")) {
return;
}
MutableSpan<bool> cyclic = curves.cyclic_for_write();
IndexMaskMemory memory;
@ -908,6 +913,11 @@ static int grease_pencil_cyclical_set_exec(bContext *C, wmOperator *op)
break;
}
/* Remove the attribute if it is empty. */
if (!ed::curves::has_anything_selected(curves.cyclic(), curves.curves_range())) {
casey-bianco-davis marked this conversation as resolved Outdated

This doesn't need to run in "Close" mode.

This doesn't need to run in "Close" mode.
curves.attributes_for_write().remove("cyclic");
}
changed = true;
});