44 int total_number_of_drawings = 0;
47 for (
const int i : trans_data_contrainers.
index_range()) {
55 *scene, grease_pencil);
58 for (
const int info_i : curves_transform_data->
drawings.index_range()) {
60 curves_transform_data->
drawings[info_i].layer_index);
61 const int current_frame = scene->
r.
cfra;
62 std::optional<int> start_frame = target_layer.
start_frame_at(current_frame);
63 if (start_frame.has_value() && (start_frame.value() != current_frame)) {
64 grease_pencil.insert_duplicate_frame(
65 target_layer, *target_layer.
start_frame_at(current_frame), current_frame,
false);
69 *scene, grease_pencil);
72 all_curves_transform_data.
append(curves_transform_data);
73 total_number_of_drawings += curves_transform_data->
drawings.size();
81 for (
const int i : trans_data_contrainers.
index_range()) {
87 curves_transform_data.
drawings.as_span();
94 std::array<IndexMask, 3> selection_per_attribute;
97 *
object, info.drawing, info.layer_index, curves_transform_data.
memory);
99 *
object, info.drawing, info.layer_index, curves_transform_data.
memory);
102 curves.curve_type_counts(),
105 curves_transform_data.
memory);
108 points_by_curve, bezier_curves[layer_offset], curves_transform_data.
memory);
110 for (
const int attribute_i : selection_attribute_names.
index_range()) {
111 const StringRef &selection_name = selection_attribute_names[attribute_i];
113 curves, selection_name, bezier_points, curves_transform_data.
memory);
117 selection_per_attribute[attribute_i], editable_points, curves_transform_data.
memory);
123 t->
mode, selection_per_attribute, bezier_points,
curves))
125 info.drawing.tag_topology_changed();
130 {&bezier_points, &selection_per_attribute[0]});
134 selection_per_attribute[1] = evaluate_expression(
135 builder.
merge({&selection_per_attribute[1], &selected_bezier_points}),
136 curves_transform_data.
memory);
137 selection_per_attribute[2] = evaluate_expression(
138 builder.
merge({&selection_per_attribute[2], &selected_bezier_points}),
139 curves_transform_data.
memory);
142 if (use_proportional_edit) {
144 editable_points, bezier_points, curves_transform_data.
memory);
146 points_to_transform_per_attribute[layer_offset].append(editable_points);
148 if (selection_attribute_names.
size() > 1) {
149 points_to_transform_per_attribute[layer_offset].append(editable_bezier_points);
150 points_to_transform_per_attribute[layer_offset].append(editable_bezier_points);
154 for (
const int selection_i : selection_attribute_names.
index_range()) {
155 points_to_transform_per_attribute[layer_offset].append(
156 selection_per_attribute[selection_i]);
157 tc.
data_len += points_to_transform_per_attribute[layer_offset][selection_i].
size();
178 for (
const int i : trans_data_contrainers.
index_range()) {
202 std::optional<MutableSpan<float>> value_attribute;
205 value_attribute = opacities;
207 else if (is_scale_thickness) {
209 value_attribute = radii;
212 const IndexMask affected_strokes = use_proportional_edit || use_individual_origins ?
224 layer_space_to_world_space,
227 points_to_transform_per_attribute[layer_offset],
230 bezier_curves[layer_offset],
233 curves, points_to_transform_per_attribute[layer_offset], drawing, tc.
custom.
type);
Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
Object * CTX_data_active_object(const bContext *C)
Scene * CTX_data_scene(const bContext *C)