Fix: GPv3: Layer settings not copied when duplicating a layer

Pull Request: https://projects.blender.org/blender/blender/pulls/119821
This commit is contained in:
Sietse Brouwer
2024-03-25 15:32:42 +01:00
committed by Gitea
parent ab84f9eaf0
commit a02b429324

View File

@@ -483,9 +483,12 @@ static int grease_pencil_layer_duplicate_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
/* Duplicate layer. */
Layer &active_layer = *grease_pencil.get_active_layer();
Layer &new_layer = grease_pencil.add_layer(active_layer.name());
Layer &new_layer = grease_pencil.add_layer(active_layer);
/* Clear source keyframes and recreate them with duplicated drawings. */
new_layer.frames_for_write().clear();
for (auto [key, frame] : active_layer.frames().items()) {
const int duration = frame.is_implicit_hold() ? 0 : active_layer.get_frame_duration_at(key);
const int drawing_index = grease_pencil.drawings().size();