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()) {
87 std::array<IndexMask, 3> selection_per_attribute;
90 *
object, info.drawing, info.layer_index, curves_transform_data->
memory);
91 const IndexMask selected_editable_strokes =
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];
98 curves, selection_name, curves_transform_data->
memory);
102 selection_per_attribute[attribute_i], editable_points, curves_transform_data->
memory);
106 curves.curve_type_counts(),
108 selected_editable_strokes,
109 curves_transform_data->
memory);
111 if (!bezier_curves[layer_offset].is_empty()) {
113 const VArray<int8_t> handle_types_left = curves.handle_types_left();
114 const VArray<int8_t> handle_types_right = curves.handle_types_right();
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();
148 tc.
data_len += curves.points_num() + 2 * bezier_point_count;
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()) {
200 const float4x4 layer_space_to_world_space = layer.to_world_space(*object_eval);
203 std::optional<MutableSpan<float>> value_attribute;
204 if (is_scale_thickness) {
206 value_attribute = radii;
210 value_attribute = opacities;
213 const IndexMask affected_strokes = use_proportional_edit ?
215 *
object, info.drawing, info.layer_index, memory) :
219 layer_space_to_world_space,
221 points_to_transform_per_attribute[layer_offset],
224 bezier_curves[layer_offset]);