43 int total_number_of_drawings = 0;
46 for (
const int i : trans_data_contrainers.
index_range()) {
56 drawings[info_i].layer_index);
57 const int current_frame = scene->
r.
cfra;
58 std::optional<int> start_frame = target_layer.
start_frame_at(current_frame);
59 if (start_frame.has_value() && (start_frame.value() != current_frame)) {
60 grease_pencil.insert_duplicate_frame(
61 target_layer, *target_layer.
start_frame_at(current_frame), current_frame,
false);
67 all_drawings.
append(drawings);
68 total_number_of_drawings += drawings.
size();
76 for (
const int i : trans_data_contrainers.
index_range()) {
88 std::array<IndexMask, 3> selection_per_attribute;
91 *
object, info.drawing, info.layer_index, curves_transform_data->
memory);
93 *
object, info.drawing, info.layer_index, curves_transform_data->
memory);
95 for (
const int attribute_i : selection_attribute_names.
index_range()) {
96 const StringRef &selection_name = selection_attribute_names[attribute_i];
102 selection_per_attribute[attribute_i], editable_points, curves_transform_data->
memory);
106 curves.curve_type_counts(),
109 curves_transform_data->
memory);
111 if (!bezier_curves[layer_offset].is_empty()) {
116 handle_selection.
clear();
117 bezier_curves[layer_offset].foreach_index([&](
const int bezier_index) {
118 for (
const int point_i : points_by_curve[bezier_index]) {
119 if (selection_per_attribute[0].contains(point_i)) {
125 handle_selection.
append(point_i);
136 selection_per_attribute[1], handle_selection_mask, curves_transform_data->
memory);
138 selection_per_attribute[2], handle_selection_mask, curves_transform_data->
memory);
142 if (use_proportional_edit) {
143 Array<int> bezier_point_offset_data(bezier_curves[layer_offset].
size() + 1);
145 curves.points_by_curve(), bezier_curves[layer_offset], bezier_point_offset_data);
147 const int bezier_point_count = bezier_offsets.
total_size();
149 points_to_transform_per_attribute[layer_offset].append(
curves.points_range());
151 if (bezier_point_count > 0) {
154 bezier_curves[layer_offset].foreach_index(
GrainSize(512), [&](
const int bezier_curve_i) {
155 bezier_point_ranges.
append(points_by_curve[bezier_curve_i]);
158 curves_transform_data->
memory);
159 points_to_transform_per_attribute[layer_offset].append(bezier_points);
160 points_to_transform_per_attribute[layer_offset].append(bezier_points);
164 for (
const int selection_i : selection_attribute_names.
index_range()) {
165 points_to_transform_per_attribute[layer_offset].append(
166 selection_per_attribute[selection_i]);
167 tc.
data_len += points_to_transform_per_attribute[layer_offset][selection_i].
size();
175 tc.
data = MEM_cnew_array<TransData>(tc.
data_len, __func__);
188 for (
const int i : trans_data_contrainers.
index_range()) {
204 std::optional<MutableSpan<float>> value_attribute;
205 if (is_scale_thickness) {
207 value_attribute = radii;
211 value_attribute = opacities;
214 const IndexMask affected_strokes = use_proportional_edit ?
225 layer_space_to_world_space,
227 points_to_transform_per_attribute[layer_offset],
230 bezier_curves[layer_offset],