104 if (!(smooth_position || smooth_radius || smooth_opacity)) {
109 bool changed =
false;
130 if (smooth_position) {
186 ot->name =
"Smooth Stroke";
187 ot->idname =
"GREASE_PENCIL_OT_stroke_smooth";
188 ot->description =
"Smooth selected strokes";
195 prop =
RNA_def_int(
ot->srna,
"iterations", 10, 1, 100,
"Iterations",
"", 1, 30);
197 RNA_def_float(
ot->srna,
"factor", 1.0f, 0.0f, 1.0f,
"Factor",
"", 0.0f, 1.0f);
224 "Delete alternating vertices in the stroke, except extremes"},
229 "Use a Ramer-Douglas-Peucker algorithm to simplify the stroke preserving main shape"},
234 "Re-sample the stroke with segments of the specified length"},
239 "Simplify the stroke by merging vertices closer than a given distance"},
240 {0,
nullptr, 0,
nullptr,
nullptr},
252 points_by_curve, stroke_selection, memory);
257 const int curve_i = point_to_curve_map[
i];
258 const IndexRange points = points_by_curve[curve_i];
259 if (points.
size() <= 2) {
262 const int local_i =
i - points.
start();
268 {selected_to_keep, selected_points.
complement(
curves.points_range(), memory)}, memory);
279 bool changed =
false;
302 if (points_to_keep.
size() ==
curves.points_num()) {
306 curves, points_to_keep, {});
341 const int curve_i = point_to_curve_map[
i];
342 const IndexRange points = points_by_curve[curve_i];
349 curves, merge_distance, filtered_points, {});
402 ot->name =
"Simplify Stroke";
403 ot->idname =
"GREASE_PENCIL_OT_stroke_simplify";
404 ot->description =
"Simplify selected strokes";
413 prop =
RNA_def_float(
ot->srna,
"factor", 0.01f, 0.0f, 100.0f,
"Factor",
"", 0.0f, 100.0f);
415 prop =
RNA_def_float(
ot->srna,
"length", 0.05f, 0.01f, 100.0f,
"Length",
"", 0.01f, 1.0f);
417 prop =
RNA_def_float(
ot->srna,
"distance", 0.01f, 0.0f, 100.0f,
"Distance",
"", 0.0f, 1.0f);
419 prop =
RNA_def_int(
ot->srna,
"steps", 1, 0, 50,
"Steps",
"", 0.0f, 10);
426 "Method used for simplifying stroke points");
445 bool changed =
false;
457 curves.remove_curves(elements, {});
476 ot->idname =
"GREASE_PENCIL_OT_delete";
477 ot->description =
"Delete selected strokes or points";
506 "Dissolve points between selected points"},
511 "Dissolve all unselected points"},
512 {0,
nullptr, 0,
nullptr,
nullptr},
526 return points_to_dissolve;
538 for (const int64_t curve_i : range) {
539 const IndexRange points = points_by_curve[curve_i];
540 const Span<bool> curve_selection = points_to_dissolve.as_span().slice(points);
542 if (!curve_selection.contains(true)) {
543 points_to_keep.slice(points).fill(true);
549 if (mode != DissolveMode::BETWEEN) {
553 const Vector<IndexRange> deselection_ranges = array_utils::find_all_ranges(curve_selection,
556 if (deselection_ranges.size() != 0) {
557 const IndexRange first_range = deselection_ranges.first().shift(points.first());
558 const IndexRange last_range = deselection_ranges.last().shift(points.first());
562 if (first_range.first() == points.first()) {
563 points_to_keep.slice(first_range).fill(true);
565 if (last_range.last() == points.last()) {
566 points_to_keep.slice(last_range).fill(true);
574 return points_to_dissolve;
585 bool changed =
false;
601 if (points_to_dissolve.
as_span().contains(
true)) {
619 ot->name =
"Dissolve";
620 ot->idname =
"GREASE_PENCIL_OT_dissolve";
621 ot->description =
"Delete selected points without splitting strokes";
634 "Method used for dissolving stroke points");
657 "Deletes current frame in the active layer"},
662 "Delete active frames for all layers"},
663 {0,
nullptr, 0,
nullptr,
nullptr},
671 const int current_frame = scene->
r.
cfra;
675 bool changed =
false;
679 changed |= grease_pencil.remove_frames(layer, {*layer.
start_frame_at(current_frame)});
684 if (layer->is_editable() && layer->start_frame_at(current_frame)) {
685 changed |= grease_pencil.remove_frames(*layer, {*layer->start_frame_at(current_frame)});
703 ot->name =
"Delete Frame";
704 ot->idname =
"GREASE_PENCIL_OT_delete_frame";
705 ot->description =
"Delete Grease Pencil Frame(s)";
718 "Method used for deleting Grease Pencil frames");
738 int material_index =
object->actcol - 1;
740 if (name[0] !=
'\0') {
751 if (material_index == -1) {
766 curves.attributes_for_write().lookup_or_add_for_write_span<
int>(
"material_index",
780 ot->name =
"Assign Material";
781 ot->idname =
"GREASE_PENCIL_OT_stroke_material_set";
782 ot->description =
"Assign the active material slot to the selected strokes";
790 ot->srna,
"material",
nullptr,
MAX_ID_NAME - 2,
"Material",
"Name of the material");
812 {0,
nullptr, 0,
nullptr,
nullptr},
820 curves.ensure_evaluated_lengths();
826 if (cyclic[curve_i]) {
827 const IndexRange points = points_by_curve[curve_i];
829 positions[points.
last()]);
832 const float curve_length =
curves.evaluated_length_total_for_curve(curve_i,
true) -
836 const float point_density = float(points.
size()) / curve_length;
837 use_cuts[points.
last()] = int(point_density * end_distance);
853 const bool subdivide_cyclic_segment =
RNA_boolean_get(op->
ptr,
"subdivide_cyclic_segment");
855 bool changed =
false;
887 curves.attributes_for_write().remove(
"cyclic");
891 if (subdivide_cyclic_segment) {
893 curves.tag_topology_changed();
912 ot->name =
"Set Cyclical State";
913 ot->idname =
"GREASE_PENCIL_OT_cyclical_set";
914 ot->description =
"Close or open the selected stroke adding a segment from last to first point";
926 "subdivide_cyclic_segment",
928 "Match Point Density",
929 "Add point in the new segment to keep the same density");
944 if (
object->totcol == 0) {
952 *
object, info.drawing, info.layer_index, memory);
960 object->actcol = materials[strokes.
first()] + 1;
971 ot->name =
"Set Active Material";
972 ot->idname =
"GREASE_PENCIL_OT_set_active_material";
973 ot->description =
"Set the selected stroke material as the active material";
995 bool changed =
false;
1022 ot->name =
"Set Uniform Thickness";
1023 ot->idname =
"GREASE_PENCIL_OT_set_uniform_thickness";
1024 ot->description =
"Set all stroke points to same thickness";
1032 ot->srna,
"thickness", 0.1f, 0.0f, 1000.0f,
"Thickness",
"Thickness", 0.0f, 1000.0f);
1051 bool changed =
false;
1071 fill_opacities.span[curve] = opacity_fill;
1088 ot->name =
"Set Uniform Opacity";
1089 ot->idname =
"GREASE_PENCIL_OT_set_uniform_opacity";
1090 ot->description =
"Set all stroke points to same opacity";
1099 RNA_def_float(
ot->srna,
"opacity_stroke", 1.0f, 0.0f, 1.0f,
"Stroke Opacity",
"", 0.0f, 1.0f);
1100 RNA_def_float(
ot->srna,
"opacity_fill", 0.5f, 0.0f, 1.0f,
"Fill Opacity",
"", 0.0f, 1.0f);
1116 bool changed =
false;
1128 curves.reverse_curves(strokes);
1144 ot->name =
"Switch Direction";
1145 ot->idname =
"GREASE_PENCIL_OT_stroke_switch_direction";
1146 ot->description =
"Change direction of the points of the selected strokes";
1177 for (const int curve_i : range) {
1178 const IndexRange points = points_by_curve[curve_i];
1179 const Span<bool> curve_i_selected_points = start_set_points.as_span().slice(points);
1180 const int first_selected = curve_i_selected_points.first_index_try(true);
1182 MutableSpan<int> dst_to_src_slice = dst_to_src_point.as_mutable_span().slice(points);
1184 array_utils::fill_index_range<int>(dst_to_src_slice, points.start());
1186 if (first_selected == -1 || src_cyclic[curve_i] == false) {
1190 std::rotate(dst_to_src_slice.begin(),
1191 dst_to_src_slice.begin() + first_selected,
1192 dst_to_src_slice.end());
1220 dst_curves.update_curve_types();
1222 if (
curves.nurbs_has_custom_knots()) {
1236 std::atomic<bool> changed =
false;
1261 ot->name =
"Set Start Point";
1262 ot->idname =
"GREASE_PENCIL_OT_set_start_point";
1263 ot->description =
"Select which point is the beginning of the curve";
1308 bool changed =
false;
1328 start_caps.finish();
1379 {int(
CapsMode::ROUND),
"ROUND", 0,
"Rounded",
"Set as default rounded"},
1384 {0,
nullptr, 0,
nullptr,
nullptr},
1387 ot->name =
"Set Curve Caps";
1388 ot->idname =
"GREASE_PENCIL_OT_caps_set";
1389 ot->description =
"Change curve caps mode (rounded or flat)";
1416 if (ob ==
nullptr) {
1423 item_tmp.identifier = ma->id.name + 2;
1424 item_tmp.name = ma->id.name + 2;
1425 item_tmp.value =
i + 1;
1426 item_tmp.icon = ma->preview ? ma->preview->runtime->icon_id : ICON_NONE;
1444 if ((slot < 1) || (slot >
object->totcol)) {
1449 object->actcol = slot;
1458 ot->name =
"Set Active Material";
1459 ot->idname =
"GREASE_PENCIL_OT_set_material";
1460 ot->description =
"Set active material";
1486 std::atomic<bool> changed =
false;
1504 changed.store(
true, std::memory_order_relaxed);
1516 ot->name =
"Duplicate";
1517 ot->idname =
"GREASE_PENCIL_OT_duplicate";
1518 ot->description =
"Duplicate the selected points";
1544 editable_strokes,
GrainSize(4096), memory, [&](
const int i) {
1545 return points_by_curve[
i].
size() <= limit;
1548 curves.remove_curves(curves_to_delete, {});
1562 C, op, event,
IFACE_(
"Remove Loose Points"),
IFACE_(
"Delete"));
1567 ot->name =
"Clean Loose Points";
1568 ot->idname =
"GREASE_PENCIL_OT_clean_loose";
1569 ot->description =
"Remove loose points";
1583 "Number of points to consider stroke as loose",
1599 std::atomic<bool> changed =
false;
1637 for (
const int curve :
curves.curves_range()) {
1640 for (
const int point : points_by_curve[curve].drop_back(1)) {
1642 if (!selection[point]) {
1646 if (selection[point + 1]) {
1647 use_cuts[point] = cuts;
1651 if (cyclic[curve]) {
1652 const int first_point = points_by_curve[curve].first();
1653 const int last_point = points_by_curve[curve].last();
1654 if (selection[first_point] && selection[last_point]) {
1655 use_cuts[last_point] = cuts;
1664 changed.store(
true, std::memory_order_relaxed);
1679 ot->name =
"Subdivide Stroke";
1680 ot->idname =
"GREASE_PENCIL_OT_stroke_subdivide";
1682 "Subdivide between continuous selected points of the stroke adding a point half way "
1691 prop =
RNA_def_int(
ot->srna,
"number_cuts", 1, 1, 32,
"Number of Cuts",
"", 1, 5);
1699 "Smooth only selected points in the stroke");
1758 A.to_indices(
indices.as_mutable_span().take_front(
A.size()));
1759 B.to_indices(
indices.as_mutable_span().take_back(
B.size()));
1764 if (curve_i !=
pos) {
1778 const int curve_i = selected_indices[
pos];
1781 if (curve_i != universe.
last(
i)) {
1799 std::atomic<bool> changed =
false;
1819 changed.store(
true, std::memory_order_relaxed);
1838 {0,
nullptr, 0,
nullptr,
nullptr},
1841 ot->name =
"Reorder";
1842 ot->idname =
"GREASE_PENCIL_OT_reorder";
1843 ot->description =
"Change the display order of the selected strokes";
1864 bool changed =
false;
1869 int target_layer_name_length;
1871 op->
ptr,
"target_layer_name",
nullptr, 0, &target_layer_name_length);
1876 if (add_new_layer) {
1877 target_node = &grease_pencil.add_layer(target_layer_name).as_node();
1880 target_node = grease_pencil.find_node_by_name(target_layer_name);
1883 if (target_node ==
nullptr || !target_node->
is_layer()) {
1889 if (layer_dst.is_locked()) {
1907 Drawing &drawing_dst = *grease_pencil.insert_frame(layer_dst, info.frame_number);
1909 curves_src, selected_strokes, {});
1914 else if (
Drawing *drawing_dst = grease_pencil.get_drawing_at(layer_dst, info.frame_number)) {
1917 curves_src, selected_strokes, {});
1920 std::array<bke::GeometrySet, 2> geometry_sets{
1928 drawing_dst->tag_topology_changed();
1931 info.drawing.tag_topology_changed();
1949 if (add_new_layer) {
1953 const std::string
unique_name = grease_pencil.unique_layer_name(
"Layer");
1957 C, op, event,
IFACE_(
"Move to New Layer"),
IFACE_(
"Create"));
1975 ot->name =
"Move to Layer";
1976 ot->idname =
"GREASE_PENCIL_OT_move_to_layer";
1977 ot->description =
"Move selected strokes to another layer";
1986 ot->srna,
"target_layer_name",
nullptr,
INT16_MAX,
"Name",
"Target Grease Pencil Layer");
1989 ot->srna,
"add_new_layer",
false,
"New Layer",
"Move selection to a new layer");
2012 {0,
nullptr, 0,
nullptr,
nullptr},
2017 int actcol =
object->actcol;
2018 for (
int slot = 1; slot <=
object->totcol; slot++) {
2020 object->actcol = slot;
2025 if (actcol >= slot) {
2030 object->actcol = actcol;
2045 object_dst->
data = grease_pencil_dst;
2051 const int layer_index,
2059 const Layer &layer_src = grease_pencil_src.layer(layer_index);
2060 if (
TreeNode *node = grease_pencil_dst.find_node_by_name(layer_src.name())) {
2061 return node->as_layer();
2065 Layer &new_layer = grease_pencil_dst.add_layer(layer_src.name());
2067 src_to_dst_layer_indices.
append(layer_index);
2080 bool changed =
false;
2084 &bmain, &scene, &view_layer, &base_prev, grease_pencil_src);
2101 info.layer_index, grease_pencil_src, grease_pencil_dst, src_to_dst_layer_indices);
2103 Drawing *drawing_dst = grease_pencil_dst.insert_frame(layer_dst, info.frame_number);
2108 curves_src, selected_points, {});
2111 info.drawing.tag_topology_changed();
2123 src_to_dst_layer_indices.
as_span(),
2124 grease_pencil_dst.attributes_for_write());
2127 if (grease_pencil_src.has_active_layer()) {
2128 const Layer &active_layer_src = *grease_pencil_src.get_active_layer();
2129 TreeNode *active_layer_dst = grease_pencil_dst.find_node_by_name(active_layer_src.name());
2130 if (active_layer_dst && active_layer_dst->
is_layer()) {
2131 grease_pencil_dst.set_active_layer(&active_layer_dst->
as_layer());
2157 bool changed =
false;
2162 for (
const int layer_i : grease_pencil_src.layers().index_range()) {
2163 Layer &layer_src = grease_pencil_src.layer(layer_i);
2164 if (layer_src.is_locked()) {
2169 &bmain, &scene, &view_layer, &base_prev, grease_pencil_src);
2173 layer_i, grease_pencil_src, grease_pencil_dst, src_to_dst_layer_indices);
2177 scene, grease_pencil_src, layer_src);
2182 object_src, info.drawing, info.layer_index, memory);
2195 Drawing *drawing_dst = grease_pencil_dst.insert_frame(layer_dst, info.frame_number);
2201 info.drawing.strokes(), strokes, {});
2204 info.drawing.tag_topology_changed();
2215 src_to_dst_layer_indices.
as_span(),
2216 grease_pencil_dst.attributes_for_write());
2236 bool changed =
false;
2247 &bmain, &scene, &view_layer, &base_prev, grease_pencil_src);
2265 object_src, info.drawing, mat_i, memory);
2272 info.layer_index, grease_pencil_src, grease_pencil_dst, src_to_dst_layer_indices);
2274 Drawing *drawing_dst = grease_pencil_dst.insert_frame(layer_dst, info.frame_number);
2282 info.drawing.tag_topology_changed();
2293 src_to_dst_layer_indices.
as_span(),
2294 grease_pencil_dst.attributes_for_write());
2320 bool changed =
false;
2329 const bool has_selection = std::any_of(
2331 return ed::curves::has_anything_selected(info.drawing.strokes());
2333 if (!has_selection) {
2340 *
C, *bmain, *scene, *view_layer, *base_prev, *object_src);
2345 if (object_src->
totcol == 1) {
2352 *
C, *bmain, *scene, *view_layer, *base_prev, *object_src);
2357 if (grease_pencil_src.layers().size() == 1) {
2363 *
C, *bmain, *scene, *view_layer, *base_prev, *object_src);
2380 ot->name =
"Separate";
2381 ot->idname =
"GREASE_PENCIL_OT_separate";
2382 ot->description =
"Separate the selected geometry into a new Grease Pencil object";
2415} *grease_pencil_clipboard =
nullptr;
2447 scene_materials.
add(material->id.session_uid, material);
2460 clipboard_material_remap[clipboard.
materials[
i].second] = target_index;
2466 clipboard_material_remap[clipboard.
materials[
i].second] = target_index;
2469 return clipboard_material_remap;
2477 std::unique_ptr<bke::Instances> instances = std::make_unique<bke::Instances>();
2478 instances->resize(geometries.
size());
2479 transforms.
materialize(instances->transforms_for_write());
2486 options.keep_original_ids =
true;
2487 options.realize_instance_attributes =
false;
2509 int num_elements_copied = 0;
2516 const Layer &layer = grease_pencil.layer(drawing_info.layer_index);
2532 num_elements_copied += copied_curves.
curves_num();
2538 num_elements_copied += copied_curves.
points_num();
2546 if (copied_curves_per_layer.
is_empty()) {
2547 clipboard.
layers.reinitialize(0);
2551 clipboard.
layers.reinitialize(copied_curves_per_layer.
size());
2554 for (
auto const &[layer, geometries] : copied_curves_per_layer.
items()) {
2555 const float4x4 layer_to_object = layer->to_object_space(*
object);
2561 cliplayer.
name = layer->name();
2571 const auto is_material_index_used = [&](
const int material_index) ->
bool {
2576 if (material_indices.
contains(material_index)) {
2584 if (!is_material_index_used(material_index)) {
2604 ot->name =
"Copy Strokes";
2605 ot->idname =
"GREASE_PENCIL_OT_copy";
2606 ot->description =
"Copy the selected Grease Pencil points or strokes to the internal clipboard";
2617 const float4x4 &object_to_paste_layer,
2618 const float4x4 &clipboard_to_world,
2619 const bool keep_world_transform,
2620 const bool paste_back,
2641 (keep_world_transform ?
2642 object.world_to_object() * clipboard_to_world :
2651 if (!clipboard_material_remap.
is_empty()) {
2656 if (material_indices) {
2657 for (
const int i : pasted_curves_range) {
2658 material_indices.
span[
i] = clipboard_material_remap[material_indices.
span[
i]];
2660 material_indices.
finish();
2666 return pasted_curves_range;
2690 if (clipboard.
layers.is_empty()) {
2696 bke::GSpanAttributeWriter selection = ed::curves::ensure_selection_attribute(
2697 layer.curves, selection_domain, CD_PROP_BOOL);
2702 Layer *active_layer = grease_pencil.get_active_layer();
2703 if (!active_layer) {
2707 if (!active_layer->is_editable()) {
2719 selection_in_target.
finish();
2725 bool inserted_keyframe =
false;
2733 scene, grease_pencil, *active_layer);
2736 *bmain, *
object, object_to_layer, keep_world_transform, paste_on_back, info.
drawing);
2739 if (inserted_keyframe) {
2744 Layer *active_layer = grease_pencil.get_active_layer();
2747 for (
const int clip_layer_i : clipboard.
layers.index_range()) {
2750 const bool found_layer = node && node->
is_layer() && node->
as_layer().is_editable();
2752 layers_to_paste_into[clip_layer_i] = &node->
as_layer();
2755 if (active_layer && active_layer->is_editable()) {
2758 op->
reports,
RPT_WARNING,
"Couldn't find matching layer, pasting into active layer");
2759 layers_to_paste_into[clip_layer_i] = active_layer;
2763 if (!active_layer) {
2766 if (!active_layer->is_editable()) {
2779 selection_in_target.
finish();
2782 for (
const int clip_layer_i : clipboard.
layers.index_range()) {
2786 BLI_assert(layers_to_paste_into[clip_layer_i] !=
nullptr);
2787 Layer &paste_layer = *layers_to_paste_into[clip_layer_i];
2791 bool inserted_keyframe =
false;
2799 scene, grease_pencil, paste_layer);
2804 object_to_paste_layer,
2806 keep_world_transform,
2811 if (inserted_keyframe) {
2844 {0,
nullptr, 0,
nullptr,
nullptr},
2847 ot->name =
"Paste Strokes";
2848 ot->idname =
"GREASE_PENCIL_OT_paste";
2850 "Paste Grease Pencil points or strokes from the internal clipboard to the active layer";
2860 ot->srna,
"paste_back",
false,
"Paste on Back",
"Add pasted strokes behind all strokes");
2864 "keep_world_transform",
2866 "Keep World Transform",
2867 "Keep the world transform of strokes from the clipboard unchanged");
2875 const float4x4 &object_to_paste_layer,
2876 const bool keep_world_transform,
2877 const bool paste_back,
2881 if (clipboard.
layers.is_empty()) {
2897 joined_clipboard_curves,
2898 object_to_paste_layer,
2900 keep_world_transform,
2917 std::atomic<bool> changed =
false;
2923 const IndexMask points = use_unselected ?
2932 drawing.
strokes(), threshold, points, {});
2934 changed.store(
true, std::memory_order_relaxed);
2947 ot->name =
"Merge by Distance";
2948 ot->idname =
"GREASE_PENCIL_OT_stroke_merge_by_distance";
2949 ot->description =
"Merge points by distance";
2956 prop =
RNA_def_float(
ot->srna,
"threshold", 0.001f, 0.0f, 100.0f,
"Threshold",
"", 0.0f, 100.0f);
2964 "Use whole stroke, not only selected points");
2997 int point_offset = 0;
2999 const IndexRange curve_points = points_by_curve[curve_index];
3001 const bool curve_cyclic = src_cyclic[curve_index];
3003 curve_points_to_extrude.
foreach_index([&](
const int src_point_index) {
3004 if (!curve_cyclic && (src_point_index == curve_points.
first())) {
3007 dst_to_src_points.
insert(src_point_index + point_offset, src_point_index);
3008 dst_selected.
insert(src_point_index + point_offset,
true);
3009 ++dst_curve_counts[curve_index];
3013 if (!curve_cyclic && (src_point_index == curve_points.
last())) {
3016 dst_to_src_points.
insert(src_point_index + point_offset + 1, src_point_index);
3017 dst_selected.
insert(src_point_index + point_offset + 1,
true);
3018 ++dst_curve_counts[curve_index];
3026 dst_to_src_points.
append(src_point_index);
3027 dst_selected.
append(
false);
3028 dst_to_src_points.
append(src_point_index);
3029 dst_selected.
append(
true);
3030 dst_to_src_curves.
append(curve_index);
3031 dst_curve_counts.
append(2);
3035 const int new_points_num = dst_to_src_points.
size();
3036 const int new_curves_num = dst_to_src_curves.
size();
3056 for (
const StringRef selection_attribute_name :
3079 {
".selection",
".selection_handle_left",
".selection_handle_right"}),
3093 points_by_curve[curve_index].
size() == dst_points_by_curve[curve_index].
size();
3111 std::atomic<bool> changed =
false;
3117 if (points_to_extrude.
is_empty()) {
3125 changed.store(
true, std::memory_order_relaxed);
3138 ot->name =
"Extrude Stroke Points";
3139 ot->idname =
"GREASE_PENCIL_OT_extrude";
3140 ot->description =
"Extrude the selected points";
3198 if (keep_original) {
3222 std::atomic<bool> changed =
false;
3226 if (drawings.is_empty()) {
3229 const int current_frame_number = drawings.first().frame_number;
3232 scene.
r.
cfra = current_frame_number;
3248 curves, selection_name, memory);
3250 editable_points, selected_points, memory);
3252 if (points_to_reproject.
is_empty()) {
3257 if (selection_name ==
".selection_handle_left") {
3258 positions =
curves.handle_positions_left_for_write();
3260 else if (selection_name ==
".selection_handle_right") {
3261 positions =
curves.handle_positions_right_for_write();
3269 float3 &position = positions[point_i];
3278 float3 ray_start, ray_direction;
3280 depsgraph, region, v3d, screen_co, ray_start, ray_direction,
true))
3285 float hit_depth = std::numeric_limits<float>::max();
3286 float3 hit_position(0.0f);
3304 world_space_to_layer_space,
3307 if (selection_name ==
".selection") {
3316 scene, *region, *v3d, *
object, &layer, mode, offset,
nullptr);
3318 const float3 new_pos = drawing_placement.
reproject(positions[point_i]);
3319 if (selection_name ==
".selection") {
3321 rv3d, positions[point_i], new_pos);
3323 positions[point_i] = new_pos;
3328 changed.store(
true, std::memory_order_relaxed);
3334 if (snap_context !=
nullptr) {
3340 scene.
r.
cfra = oldframe;
3361 row = &layout->
row(
true);
3365 row = &layout->
row(
true);
3368 row = &layout->
row(
true);
3379 "Reproject the strokes using the X-Z plane"},
3380 {int(
ReprojectMode::Side),
"SIDE", 0,
"Side",
"Reproject the strokes using the Y-Z plane"},
3381 {int(
ReprojectMode::Top),
"TOP", 0,
"Top",
"Reproject the strokes using the X-Y plane"},
3386 "Reproject the strokes to end up on the same plane, as if drawn from the current "
3388 "using 'Cursor' Stroke Placement"},
3393 "Reproject the strokes on to the scene geometry, as if drawn using 'Surface' placement"},
3398 "Reproject the strokes using the orientation of 3D cursor"},
3399 {0,
nullptr, 0,
nullptr,
nullptr},
3403 ot->name =
"Reproject Strokes";
3404 ot->idname =
"GREASE_PENCIL_OT_reproject";
3406 "Reproject the selected strokes from the current viewpoint as if they had been newly "
3408 "(e.g. to fix problems from accidental 3D cursor movement or accidental viewport changes, "
3409 "or for matching deforming geometry)";
3429 "Keep original strokes and create a copy before reprojecting");
3432 RNA_def_float(
ot->srna,
"offset", 0.0f, 0.0f, 10.0f,
"Surface Offset",
"", 0.0f, 10.0f);
3487 curves, selection_name, memory);
3489 const Layer &layer = grease_pencil.layer(drawing_info.layer_index);
3494 if (selection_name ==
".selection_handle_left") {
3495 positions =
curves.handle_positions_left_for_write();
3497 else if (selection_name ==
".selection_handle_right") {
3498 positions =
curves.handle_positions_right_for_write();
3502 const float3 pos_snapped = grid_size *
math::floor(pos_world / grid_size + 0.5f);
3507 drawing_info.drawing.tag_positions_changed();
3519 ot->name =
"Snap Selection to Grid";
3520 ot->idname =
"GREASE_PENCIL_OT_snap_to_grid";
3521 ot->description =
"Snap selected points to the nearest grid points";
3557 selected_points_memory);
3559 const Layer &layer = grease_pencil.layer(drawing_info.layer_index);
3569 curves, selected_curves_memory);
3572 const IndexRange points = points_by_curve[curve_i];
3575 const float3 offset = cursor_layer - positions[points.
first()];
3577 GrainSize(4096), [&](
const int point_i) { positions[point_i] += offset; });
3585 curves.calculate_bezier_auto_handles();
3586 drawing_info.drawing.tag_positions_changed();
3599 ot->name =
"Snap Selection to Cursor";
3600 ot->idname =
"GREASE_PENCIL_OT_snap_to_cursor";
3601 ot->description =
"Snap selected points/strokes to the cursor";
3615 "Offset the entire stroke instead of selected points only");
3633 int num_selected = 0;
3634 r_centroid =
float3(0.0f);
3635 r_min =
float3(std::numeric_limits<float>::max());
3636 r_max =
float3(std::numeric_limits<float>::lowest());
3639 for (
const DrawingInfo &drawing_info : drawings) {
3640 const Layer &layer = grease_pencil.layer(drawing_info.layer_index);
3641 if (layer.is_locked()) {
3654 selected_points_memory);
3660 r_centroid += pos_world;
3663 num_selected += selected_points.
size();
3665 if (num_selected == 0) {
3666 r_min = r_max =
float3(0.0f);
3670 r_centroid /= num_selected;
3681 float3 centroid, points_min, points_max;
3683 scene,
object, grease_pencil, centroid, points_min, points_max))
3711 ot->name =
"Snap Cursor to Selected Points";
3712 ot->idname =
"GREASE_PENCIL_OT_snap_cursor_to_selected";
3713 ot->description =
"Snap cursor to center of selected points";
3737 strokemat4x3[2][2] = 0.0f;
3738 strokemat4x3[3][2] = 1.0f;
3740 return strokemat4x3;
3750 std::atomic<bool> changed =
false;
3766 const float2 screen_direction = screen_end - screen_start;
3767 const float2 screen_tangent = screen_start +
float2(-screen_direction[1], screen_direction[0]);
3779 const int material_index = materials[curve_i];
3782 material_index + 1);
3793 positions[points_by_curve[curve_i].first()]);
3806 const float3 origin = start;
3812 if (
math::dot(tangent - start, v_dir) < 0.0f) {
3824 offset_matrix *= 0.5f;
3825 offset_matrix[2] +=
float2(0.5f, 0.5f);
3829 offset_matrix[2] -=
float2(0.5f, 0.5f);
3832 offset_matrix = texture_rotation * offset_matrix;
3833 offset_matrix[2] -= texture_offset;
3836 layer_space_to_world_space;
3841 changed.store(
true, std::memory_order_relaxed);
3892 ot->name =
"Texture Gradient";
3893 ot->idname =
"GREASE_PENCIL_OT_texture_gradient";
3894 ot->description =
"Draw a line to set the fill material gradient for the selected strokes";
3924 bool changed =
false;
3936 options.convert_bezier_handles_to_poly_points = use_handles;
3937 options.convert_bezier_handles_to_catmull_rom_points = use_handles;
3938 options.keep_bezier_shape_as_nurbs = use_handles;
3939 options.keep_catmull_rom_shape_as_nurbs = use_handles;
3957 ot->name =
"Set Curve Type";
3958 ot->idname =
"GREASE_PENCIL_OT_set_curve_type";
3959 ot->description =
"Set type of selected curves";
3974 "Take handle information into account in the conversion");
3991 bool changed =
false;
4016 const IndexRange points = points_by_curve[curve_i];
4017 for (
const int point_i : points) {
4018 if (selection_left[point_i] || selection[point_i]) {
4019 handle_types_left[point_i] = int8_t(dst_handle_type);
4021 if (selection_right[point_i] || selection[point_i]) {
4022 handle_types_right[point_i] = int8_t(dst_handle_type);
4027 curves.calculate_bezier_auto_handles();
4028 curves.tag_topology_changed();
4044 ot->name =
"Set Handle Type";
4045 ot->idname =
"GREASE_PENCIL_OT_set_handle_type";
4046 ot->description =
"Set the handle type for bezier curves";
4072 bool changed =
false;
4102 ot->name =
"Set Curve Resolution";
4103 ot->idname =
"GREASE_PENCIL_OT_set_curve_resolution";
4104 ot->description =
"Set resolution of selected curves";
4117 "The resolution to use for each curve segment",
4134 bool changed =
false;
4146 if (attributes.
contains(
"uv_rotation")) {
4147 if (editable_strokes.
size() ==
curves.curves_num()) {
4148 attributes.
remove(
"uv_rotation");
4158 if (attributes.
contains(
"uv_translation")) {
4159 if (editable_strokes.
size() ==
curves.curves_num()) {
4160 attributes.
remove(
"uv_translation");
4166 uv_translations.
finish();
4170 if (attributes.
contains(
"uv_scale")) {
4171 if (editable_strokes.
size() ==
curves.curves_num()) {
4172 attributes.
remove(
"uv_scale");
4182 if (attributes.
contains(
"uv_shear")) {
4183 if (editable_strokes.
size() ==
curves.curves_num()) {
4184 attributes.
remove(
"uv_shear");
4209 ot->name =
"Reset UVs";
4210 ot->idname =
"GREASE_PENCIL_OT_reset_uvs";
4211 ot->description =
"Reset UV transformation to default values";
4225 std::atomic<bool> changed =
false;
4241 changed.store(
true, std::memory_order_relaxed);
4256 ot->name =
"Split stroke";
4257 ot->idname =
"GREASE_PENCIL_OT_stroke_split";
4258 ot->description =
"Split selected points to a new stroke";
4284 std::atomic<bool> changed =
false;
4287 for (
const int layer_i : grease_pencil.layers().index_range()) {
4288 const Layer &layer = grease_pencil.layer(layer_i);
4289 if (!layer.is_editable()) {
4292 if (
Drawing *drawing = grease_pencil.get_editable_drawing_at(layer, scene.
r.
cfra)) {
4293 drawings.
append({*drawing, layer_i, scene.
r.
cfra, 1.0f});
4298 for (
const int layer_i : grease_pencil.layers().index_range()) {
4299 const Layer &layer = grease_pencil.layer(layer_i);
4300 if (!layer.is_editable()) {
4303 for (
const auto [frame_number, frame] : layer.
frames().
items()) {
4304 if (
Drawing *drawing = grease_pencil.get_editable_drawing_at(layer, frame_number)) {
4305 drawings.
append({*drawing, layer_i, frame_number, 1.0f});
4313 changed.store(
true, std::memory_order_relaxed);
4331 {0,
nullptr, 0,
nullptr,
nullptr},
4335 ot->name =
"Remove Fill Guides";
4336 ot->idname =
"GREASE_PENCIL_OT_remove_fill_guides";
4337 ot->description =
"Remove all the strokes that were created from the fill tool as guides";
4369 {0,
nullptr, 0,
nullptr,
nullptr},
4382 const int corner_subdivisions =
RNA_int_get(op->
ptr,
"corner_subdivisions");
4383 const float outline_offset = radius * offset_factor;
4384 const int mat_nr = -1;
4396 viewinv =
float4x4({1.0f, 0.0f, 0.0f, 0.0f},
4397 {0.0f, 0.0f, 1.0f, 0.0f},
4398 {0.0f, 1.0f, 0.0f, 0.0f},
4399 {0.0f, 0.0f, 0.0f, 1.0f});
4402 viewinv =
float4x4({0.0f, 0.0f, 1.0f, 0.0f},
4403 {0.0f, 1.0f, 0.0f, 0.0f},
4404 {1.0f, 0.0f, 0.0f, 0.0f},
4405 {0.0f, 0.0f, 0.0f, 1.0f});
4415 viewinv = scene->
camera->world_to_object();
4422 bool changed =
false;
4438 corner_subdivisions,
4449 const std::array<bke::GeometrySet, 2> geometry_sets = {
4470 ot->name =
"Outline";
4471 ot->idname =
"GREASE_PENCIL_OT_outline";
4472 ot->description =
"Convert selected strokes to perimeter";
4485 ot->srna,
"offset_factor", -1.0f, -1.0f, 1.0f,
"Offset Factor",
"", -1.0f, 1.0f);
4486 RNA_def_int(
ot->srna,
"corner_subdivisions", 2, 0, 10,
"Corner Subdivisions",
"", 0, 5);
4497 const float threshold)
4508 const float threshold)
4514 const IndexMask non_catmull_rom_curves_selection =
4516 .complement(selection, memory);
4525 non_catmull_rom_curves_selection,
4526 curves.points_by_curve(),
4531 curves.remove_points(points_to_remove, {});
4534 options.convert_bezier_handles_to_poly_points =
false;
4535 options.convert_bezier_handles_to_catmull_rom_points =
false;
4536 options.keep_bezier_shape_as_nurbs =
true;
4537 options.keep_catmull_rom_shape_as_nurbs =
true;
4549 .indices_for_curve_type(
4551 .complement(selection, memory);
4558 const float threshold)
4564 const IndexMask poly_curves_selection =
curves.indices_for_curve_type(
4566 if (!poly_curves_selection.
is_empty()) {
4571 options.convert_bezier_handles_to_poly_points =
false;
4572 options.convert_bezier_handles_to_catmull_rom_points =
false;
4573 options.keep_bezier_shape_as_nurbs =
true;
4574 options.keep_catmull_rom_shape_as_nurbs =
true;
4580 const float threshold)
4587 const IndexMask poly_curves_selection =
curves.indices_for_curve_type(
4589 if (!poly_curves_selection.
is_empty()) {
4594 options.convert_bezier_handles_to_poly_points =
false;
4595 options.convert_bezier_handles_to_catmull_rom_points =
false;
4596 options.keep_bezier_shape_as_nurbs =
true;
4597 options.keep_catmull_rom_shape_as_nurbs =
true;
4610 std::atomic<bool> changed =
false;
4637 changed.store(
true, std::memory_order_relaxed);
4671 ot->name =
"Convert Curve Type";
4672 ot->idname =
"GREASE_PENCIL_OT_convert_curve_type";
4673 ot->description =
"Convert type of selected curves";
4693 "The distance that the resulting points are allowed to be within",
4760 Layer &layer_dst = grease_pencil_dst.add_layer(group_dst, layer_src.name());
4783 switch (child->type) {
4786 Layer &layer_dst =
copy_layer(grease_pencil_dst, group_dst, layer_src);
4787 layer_name_map.
add_new(layer_src.name(), layer_dst.name());
4819 if (material !=
nullptr) {
4823 material_index_map[
i] = 0;
4826 return material_index_map;
4838 for (const int curve_i : range) {
4839 material_writer.span[curve_i] = material_index_map[material_writer.span[curve_i]];
4842 material_writer.
finish();
4847 const ListBase &vertex_group_names)
4856 return vertex_group_map;
4863 STRNCPY(dg->name, vertex_group_map.
lookup(dg->name).c_str());
4887 const int orig_layers_num = grease_pencil_dst.layers().size();
4909 grease_pencil_dst.resize_drawings(0);
4917 grease_pencil_dst.root_group(),
4918 grease_pencil_src.root_group(),
4926 grease_pencil_dst.layers().size());
4931 grease_pencil_src.layers().size());
4934 for (
const int layer_index : grease_pencil_dst.layers().index_range()) {
4935 Layer &layer = *grease_pencil_dst.layers_for_write()[layer_index];
4936 const bool is_orig_layer = (layer_index < orig_layers_num);
4941 if (!is_orig_layer) {
4945 if (new_mask_name) {
4953 drawing_index = new_drawings_src[drawing_index];
4978 if (!is_orig_layer) {
4987 if (
id == &grease_pencil_src.
id && fcu->
rna_path && strstr(fcu->
rna_path,
"layers[")) {
4989 for (
auto [name_src, name_dst] : layer_name_map.
items()) {
4990 if (name_dst != name_src) {
4991 const char *old_path = fcu->
rna_path;
4993 id, fcu->
rna_path,
"layers", name_src.c_str(), name_dst.c_str(), 0, 0,
false);
5006 if (dtar->id != &grease_pencil_src.
id) {
5009 dtar->id = &grease_pencil_dst.
id;
5011 if (dtar->rna_path && strstr(dtar->rna_path,
"layers[")) {
5012 for (
auto [name_src, name_dst] : layer_name_map.
items()) {
5013 if (name_dst != name_src) {
5014 const char *old_path = fcu->
rna_path;
5016 id, dtar->rna_path,
"layers", name_src.c_str(), name_dst.c_str(), 0, 0,
false);
5017 if (old_path != dtar->rna_path) {
5031 if (ob_dst.
adt ==
nullptr) {
5042 if (grease_pencil_src.
adt) {
5043 if (grease_pencil_dst.
adt ==
nullptr) {
5072 if (ob_iter == ob_active) {
5084 Object *ob_dst = ob_active;
5089 *ob_dst, materials);
void BKE_animdata_merge_copy(Main *bmain, ID *dst_id, ID *src_id, eAnimData_MergeCopy_Modes action_mode, bool fix_drivers)
AnimData * BKE_animdata_copy(Main *bmain, AnimData *adt, int flag)
void BKE_fcurves_main_cb(struct Main *bmain, blender::FunctionRef< void(ID *, FCurve *)> func)
char * BKE_animsys_fix_rna_path_rename(struct ID *owner_id, char *old_path, const char *prefix, const char *oldName, const char *newName, int oldSubscript, int newSubscript, bool verify_paths)
#define CTX_DATA_BEGIN(C, Type, instance, member)
Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
ScrArea * CTX_wm_area(const bContext *C)
Object * CTX_data_active_object(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
Base * CTX_data_active_base(const bContext *C)
Main * CTX_data_main(const bContext *C)
RegionView3D * CTX_wm_region_view3d(const bContext *C)
ARegion * CTX_wm_region(const bContext *C)
wmWindowManager * CTX_wm_manager(const bContext *C)
View3D * CTX_wm_view3d(const bContext *C)
ViewLayer * CTX_data_view_layer(const bContext *C)
Low-level operations for curves.
CustomData interface, see also DNA_customdata_types.h.
void CustomData_copy_data(const CustomData *source, CustomData *dest, int source_index, int dest_index, int count)
bool CustomData_merge_layout(const CustomData *source, CustomData *dest, eCustomDataMask mask, eCDAllocType alloctype, int totelem)
#define DRIVER_TARGETS_USED_LOOPER_BEGIN(dvar)
#define DRIVER_TARGETS_LOOPER_END
Low-level operations for grease pencil.
void BKE_grease_pencil_copy_parameters(const GreasePencil &src, GreasePencil &dst)
Material * BKE_grease_pencil_object_material_new(Main *bmain, Object *ob, const char *name, int *r_index)
GreasePencil * BKE_grease_pencil_add(Main *bmain, const char *name)
void BKE_grease_pencil_copy_layer_parameters(const blender::bke::greasepencil::Layer &src, blender::bke::greasepencil::Layer &dst)
void BKE_grease_pencil_copy_layer_group_parameters(const blender::bke::greasepencil::LayerGroup &src, blender::bke::greasepencil::LayerGroup &dst)
ID * BKE_libblock_find_name(Main *bmain, short type, const char *name, const std::optional< Library * > lib=std::nullopt) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
General operations, lookup, etc. for materials.
short * BKE_object_material_len_p(Object *ob)
MaterialGPencilStyle * BKE_gpencil_material_settings(Object *ob, short act)
void BKE_object_material_array_assign(Main *bmain, Object *ob, Material ***matar, int totcol, bool to_object_only)
bool BKE_object_material_slot_used(Object *object, short actcol)
int BKE_object_material_ensure(Main *bmain, Object *ob, Material *material)
Material * BKE_object_material_get(Object *ob, short act)
int BKE_object_material_index_get(Object *ob, const Material *ma)
Material *** BKE_object_material_array_p(Object *ob)
bool BKE_object_material_slot_remove(Main *bmain, Object *ob)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_report(ReportList *reports, eReportType type, const char *message)
void BKE_scene_graph_update_for_newframe(Depsgraph *depsgraph)
#define BLI_assert_unreachable()
#define LISTBASE_FOREACH(type, var, list)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
#define BLI_SCOPED_DEFER(function_to_defer)
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC
char * STRNCPY(char(&dst)[N], const char *src)
#define BLT_I18NCONTEXT_ID_GPENCIL
#define BLT_I18NCONTEXT_ID_MOVIECLIP
void DEG_id_tag_update(ID *id, unsigned int flags)
void DEG_relations_tag_update(Main *bmain)
float DEG_get_ctime(const Depsgraph *graph)
T * DEG_get_original(T *id)
@ ID_RECALC_ANIMATION_NO_FLUSH
@ NURBS_KNOT_MODE_ENDPOINT
@ GP_STROKE_CAP_TYPE_FLAT
@ GP_STROKE_CAP_TYPE_ROUND
@ GP_MATERIAL_GRADIENT_RADIAL
Object is a sort of wrapper for general info.
@ V3D_AROUND_CENTER_BOUNDS
@ V3D_AROUND_CENTER_MEDIAN
@ V3D_AROUND_LOCAL_ORIGINS
bool ED_view3d_win_to_ray_clipped(Depsgraph *depsgraph, const ARegion *region, const View3D *v3d, const float mval[2], float r_ray_start[3], float r_ray_normal[3], bool do_clip_planes)
float ED_view3d_grid_view_scale(const Scene *scene, const View3D *v3d, const ARegion *region, const char **r_grid_unit)
bool ED_view3d_win_to_3d_on_plane(const ARegion *region, const float plane[4], const float mval[2], bool do_clip, float r_out[3])
eV3DProjStatus ED_view3d_project_float_global(const ARegion *region, const float co[3], float r_co[2], eV3DProjTest flag)
static void View(GHOST_IWindow *window, bool stereo, int eye=0)
#define RNA_ENUM_ITEM_SEPR
void uiLayoutSetPropSep(uiLayout *layout, bool is_sep)
void uiLayoutSetPropDecorate(uiLayout *layout, bool is_sep)
BPy_StructRNA * depsgraph
static IndexMask from_predicate(const IndexMask &universe, GrainSize grain_size, IndexMaskMemory &memory, Fn &&predicate)
static IndexMask from_intersection(const IndexMask &mask_a, const IndexMask &mask_b, IndexMaskMemory &memory)
static constexpr IndexRange from_begin_size(const int64_t begin, const int64_t size)
const Value * lookup_ptr(const Key &key) const
const Value & lookup(const Key &key) const
KeyIterator keys() const &
ItemIterator items() const &
constexpr MutableSpan drop_front(const int64_t n) const
static VArray ForContainer(ContainerT container)
static VArray ForSingle(T value, const int64_t size)
static VArray ForSpan(Span< T > values)
void append(const T &value)
IndexRange index_range() const
Span< T > as_span() const
MutableSpan< T > as_mutable_span()
IndexRange index_range() const
void copy_from(GSpan values)
static IndexMask from_predicate(const IndexMask &universe, GrainSize grain_size, IndexMaskMemory &memory, Fn &&predicate)
static IndexMask from_union(const IndexMask &mask_a, const IndexMask &mask_b, IndexMaskMemory &memory)
static IndexMask from_ranges(OffsetIndices< T > offsets, const IndexMask &mask, IndexMaskMemory &memory)
static IndexMask from_bools(Span< bool > bools, IndexMaskMemory &memory)
constexpr int64_t first() const
constexpr IndexRange drop_back(int64_t n) const
constexpr int64_t last(const int64_t n=0) const
constexpr int64_t size() const
constexpr int64_t start() const
constexpr bool contains(int64_t value) const
constexpr IndexRange drop_front(int64_t n) const
const Value * lookup_ptr(const Key &key) const
Value & lookup_or_add_default(const Key &key)
bool add(const Key &key, const Value &value)
const Value & lookup(const Key &key) const
Value lookup_default(const Key &key, const Value &default_value) const
void add_new(const Key &key, const Value &value)
ItemIterator items() const &
constexpr MutableSpan slice(const int64_t start, const int64_t size) const
constexpr MutableSpan drop_back(const int64_t n) const
constexpr void fill(const T &value) const
constexpr int64_t size() const
constexpr IndexRange index_range() const
constexpr bool contains(const T &value) const
constexpr const char * c_str() const
void materialize(MutableSpan< T > r_span) const
static VArray ForContainer(ContainerT container)
static VArray ForSingle(T value, const int64_t size)
int64_t index_of_or_add(const Key &key)
void append(const T &value)
void insert(const int64_t insert_index, const T &value)
MutableSpan< T > as_mutable_span()
Span< T > as_span() const
bool contains(StringRef attribute_id) const
GAttributeReader lookup_or_default(StringRef attribute_id, AttrDomain domain, eCustomDataType data_type, const void *default_value=nullptr) const
OffsetIndices< int > points_by_curve() const
IndexRange curves_range() const
void update_curve_types()
MutableAttributeAccessor attributes_for_write()
VArray< int8_t > nurbs_knots_modes() const
void remove_curves(const IndexMask &curves_to_delete, const AttributeFilter &attribute_filter)
AttributeAccessor attributes() const
MutableSpan< int > offsets_for_write()
void remove_points(const IndexMask &points_to_delete, const AttributeFilter &attribute_filter)
bool nurbs_has_custom_knots() const
VArray< int8_t > curve_types() const
VArray< bool > cyclic() const
MutableSpan< bool > cyclic_for_write()
GSpanAttributeWriter lookup_or_add_for_write_span(StringRef attribute_id, AttrDomain domain, eCustomDataType data_type, const AttributeInit &initializer=AttributeInitDefaultValue())
bool remove(const StringRef attribute_id)
GSpanAttributeWriter lookup_for_write_span(StringRef attribute_id)
Span< float3 > curve_plane_normals() const
MutableSpan< float > opacities_for_write()
MutableSpan< float > radii_for_write()
bke::CurvesGeometry & strokes_for_write()
const bke::CurvesGeometry & strokes() const
VArray< float > radii() const
void tag_positions_changed()
void tag_topology_changed()
VArray< float > opacities() const
void set_texture_matrices(Span< float4x2 > matrices, const IndexMask &selection)
float4x4 to_world_space(const Object &object) const
const Map< FramesMapKeyT, GreasePencilFrame > & frames() const
void tag_frames_map_changed()
std::optional< int > start_frame_at(int frame_number) const
float4x4 to_object_space(const Object &object) const
Map< FramesMapKeyT, GreasePencilFrame > & frames_for_write()
const Layer & as_layer() const
float3 reproject(float3 pos) const
void to_indices(MutableSpan< T > r_indices) const
IndexMask slice_content(IndexRange range) const
void foreach_index_optimized(Fn &&fn) const
IndexMask complement(const IndexMask &universe, IndexMaskMemory &memory) const
void foreach_index(Fn &&fn) const
CCL_NAMESPACE_BEGIN struct Options options
static float normals[][3]
VecBase< float, 2 > float2
VecBase< float, 4 > float4
VecBase< float, 3 > float3
VecBase< float, D > step(VecOp< float, D >, VecOp< float, D >) RET
void ED_operatortypes_grease_pencil_edit()
wmOperatorStatus ED_grease_pencil_join_objects_exec(bContext *C, wmOperator *op)
blender::bke::AttrDomain ED_grease_pencil_edit_selection_domain_get(const ToolSettings *tool_settings)
void GREASE_PENCIL_OT_stroke_trim(wmOperatorType *ot)
void * MEM_malloc_arrayN(size_t len, size_t size, const char *str)
void * MEM_dupallocN(const void *vmemh)
ccl_device_inline float2 mask(const MaskType mask, const float2 a)
void invert_booleans(MutableSpan< bool > span)
void copy(const GVArray &src, GMutableSpan dst, int64_t grain_size=4096)
BooleanMix booleans_mix_calc(const VArray< bool > &varray, IndexRange range_to_check)
void fill_index_range(MutableSpan< T > span, const T start=0)
void gather_custom_knots(const bke::CurvesGeometry &src, const IndexMask &src_curves, int dst_curve_offset, bke::CurvesGeometry &dst)
void update_custom_knot_modes(const IndexMask &mask, const KnotsMode mode_for_regular, const KnotsMode mode_for_cyclic, bke::CurvesGeometry &curves)
void fill_points(OffsetIndices< int > points_by_curve, const IndexMask &curve_selection, GPointer value, GMutableSpan dst)
void copy_drawing_array(Span< const GreasePencilDrawingBase * > src_drawings, MutableSpan< GreasePencilDrawingBase * > dst_drawings)
CurvesGeometry curves_copy_curve_selection(const CurvesGeometry &curves, const IndexMask &curves_to_copy, const AttributeFilter &attribute_filter)
CurvesGeometry curves_copy_point_selection(const CurvesGeometry &curves, const IndexMask &points_to_copy, const AttributeFilter &attribute_filter)
auto attribute_filter_from_skip_ref(const Span< StringRef > skip)
void copy_attributes(const AttributeAccessor src_attributes, AttrDomain src_domain, AttrDomain dst_domain, const AttributeFilter &attribute_filter, MutableAttributeAccessor dst_attributes)
void gather_attributes(AttributeAccessor src_attributes, AttrDomain src_domain, AttrDomain dst_domain, const AttributeFilter &attribute_filter, const IndexMask &selection, MutableAttributeAccessor dst_attributes)
Curves * curves_new_nomain(int points_num, int curves_num)
static bool has_anything_selected(const Span< Curves * > curves_ids)
IndexMask retrieve_selected_curves(const bke::CurvesGeometry &curves, IndexMaskMemory &memory)
void duplicate_curves(bke::CurvesGeometry &curves, const IndexMask &mask)
void duplicate_points(bke::CurvesGeometry &curves, const IndexMask &mask)
bke::CurvesGeometry split_points(const bke::CurvesGeometry &curves, const IndexMask &points_to_split)
void fill_selection_false(GMutableSpan selection)
Span< StringRef > get_curves_selection_attribute_names(const bke::CurvesGeometry &curves)
bke::GSpanAttributeWriter ensure_selection_attribute(bke::CurvesGeometry &curves, bke::AttrDomain selection_domain, eCustomDataType create_type, StringRef attribute_name)
IndexMask retrieve_selected_points(const bke::CurvesGeometry &curves, IndexMaskMemory &memory)
static void convert_to_nurbs(bke::CurvesGeometry &curves, const IndexMask &selection, const float threshold)
IndexMask retrieve_editable_and_selected_elements(Object &object, const bke::greasepencil::Drawing &drawing, int layer_index, const bke::AttrDomain selection_domain, IndexMaskMemory &memory)
static void GREASE_PENCIL_OT_extrude(wmOperatorType *ot)
static bke::GeometrySet join_geometries_with_transforms(Span< bke::GeometrySet > geometries, const VArray< float4x4 > &transforms)
static void GREASE_PENCIL_OT_texture_gradient(wmOperatorType *ot)
bool active_grease_pencil_poll(bContext *C)
IndexMask retrieve_editable_and_selected_strokes(Object &object, const bke::greasepencil::Drawing &drawing, int layer_index, IndexMaskMemory &memory)
static wmOperatorStatus grease_pencil_convert_curve_type_exec(bContext *C, wmOperator *op)
static wmOperatorStatus grease_pencil_set_active_material_exec(bContext *C, wmOperator *)
static void GREASE_PENCIL_OT_caps_set(wmOperatorType *ot)
blender::bke::CurvesGeometry curves_merge_by_distance(const bke::CurvesGeometry &src_curves, const float merge_distance, const IndexMask &selection, const bke::AttributeFilter &attribute_filter)
static bke::greasepencil::Layer & copy_layer(GreasePencil &grease_pencil_dst, bke::greasepencil::LayerGroup &group_dst, const bke::greasepencil::Layer &layer_src)
static void grease_pencil_reproject_ui(bContext *, wmOperator *op)
static bke::greasepencil::Layer & find_or_create_layer_in_dst_by_name(const int layer_index, const GreasePencil &grease_pencil_src, GreasePencil &grease_pencil_dst, Vector< int > &src_to_dst_layer_indices)
static wmOperatorStatus grease_pencil_delete_exec(bContext *C, wmOperator *)
static wmOperatorStatus grease_pencil_stroke_material_set_exec(bContext *C, wmOperator *op)
static void GREASE_PENCIL_OT_stroke_simplify(wmOperatorType *ot)
static void convert_to_catmull_rom(bke::CurvesGeometry &curves, const IndexMask &selection, const float threshold)
static wmOperatorStatus grease_pencil_set_curve_type_exec(bContext *C, wmOperator *op)
blender::Mutex grease_pencil_clipboard_lock
static wmOperatorStatus grease_pencil_extrude_exec(bContext *C, wmOperator *)
static wmOperatorStatus grease_pencil_outline_exec(bContext *C, wmOperator *op)
static void join_object_with_active(Main &bmain, Object &ob_src, Object &ob_dst, VectorSet< Material * > &materials)
IndexMask retrieve_editable_points(Object &object, const bke::greasepencil::Drawing &drawing, int layer_index, IndexMaskMemory &memory)
static wmOperatorStatus grease_pencil_stroke_smooth_exec(bContext *C, wmOperator *op)
static wmOperatorStatus grease_pencil_move_to_layer_invoke(bContext *C, wmOperator *op, const wmEvent *event)
bool ensure_active_keyframe(const Scene &scene, GreasePencil &grease_pencil, bke::greasepencil::Layer &layer, const bool duplicate_previous_key, bool &r_inserted_keyframe)
static void convert_to_bezier(bke::CurvesGeometry &curves, const IndexMask &selection, const float threshold)
static wmOperatorStatus grease_pencil_duplicate_exec(bContext *C, wmOperator *)
static wmOperatorStatus grease_pencil_dissolve_exec(bContext *C, wmOperator *op)
static void convert_to_poly(bke::CurvesGeometry &curves, const IndexMask &selection)
static bke::CurvesGeometry set_start_point(const bke::CurvesGeometry &curves, const IndexMask &mask)
static float calculate_radius_projection_factor(const RegionView3D *rv3d, const float3 &old_pos, const float3 &new_pos)
static wmOperatorStatus grease_pencil_texture_gradient_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static void GREASE_PENCIL_OT_set_curve_type(wmOperatorType *ot)
static void toggle_caps(MutableSpan< int8_t > caps, const IndexMask &strokes)
static void GREASE_PENCIL_OT_snap_cursor_to_selected(wmOperatorType *ot)
static wmOperatorStatus grease_pencil_copy_strokes_exec(bContext *C, wmOperator *op)
static void grease_pencil_convert_curve_type_ui(bContext *C, wmOperator *op)
static const EnumPropertyItem prop_outline_modes[]
static Array< int > clipboard_materials_remap(Main &bmain, Object &object)
static wmOperatorStatus grease_pencil_stroke_merge_by_distance_exec(bContext *C, wmOperator *op)
static bool grease_pencil_paste_strokes_poll(bContext *C)
bool editable_grease_pencil_point_selection_poll(bContext *C)
static bke::CurvesGeometry extrude_grease_pencil_curves(const bke::CurvesGeometry &src, const IndexMask &points_to_extrude)
static void GREASE_PENCIL_OT_set_start_point(wmOperatorType *ot)
static wmOperatorStatus grease_pencil_reproject_exec(bContext *C, wmOperator *op)
static void GREASE_PENCIL_OT_delete(wmOperatorType *ot)
static wmOperatorStatus grease_pencil_stroke_switch_direction_exec(bContext *C, wmOperator *)
static IndexMask simplify_fixed(const bke::CurvesGeometry &curves, const int step, const IndexMask &stroke_selection, IndexMaskMemory &memory)
bool editable_grease_pencil_with_region_view3d_poll(bContext *C)
static wmOperatorStatus grease_pencil_snap_to_cursor_exec(bContext *C, wmOperator *op)
static bool grease_pencil_separate_material(bContext &C, Main &bmain, Scene &scene, ViewLayer &view_layer, Base &base_prev, Object &object_src)
static IndexRange clipboard_paste_strokes_ex(Main &bmain, Object &object, const bke::CurvesGeometry &curves_to_paste, const float4x4 &object_to_paste_layer, const float4x4 &clipboard_to_world, const bool keep_world_transform, const bool paste_back, bke::greasepencil::Drawing &drawing)
static wmOperatorStatus grease_pencil_set_handle_type_exec(bContext *C, wmOperator *op)
static void remove_unused_materials(Main *bmain, Object *object)
static void GREASE_PENCIL_OT_stroke_switch_direction(wmOperatorType *ot)
Vector< DrawingInfo > retrieve_visible_drawings(const Scene &scene, const GreasePencil &grease_pencil, const bool do_onion_skinning)
static void GREASE_PENCIL_OT_set_active_material(wmOperatorType *ot)
static Clipboard & ensure_grease_pencil_clipboard()
static void GREASE_PENCIL_OT_outline(wmOperatorType *ot)
static wmOperatorStatus grease_pencil_set_material_exec(bContext *C, wmOperator *op)
static const EnumPropertyItem prop_simplify_modes[]
static void remap_material_indices(bke::greasepencil::Drawing &drawing, const Span< int > material_index_map)
IndexMask retrieve_editable_strokes_by_material(Object &object, const bke::greasepencil::Drawing &drawing, const int mat_i, IndexMaskMemory &memory)
static wmOperatorStatus grease_pencil_reset_uvs_exec(bContext *C, wmOperator *)
static wmOperatorStatus grease_pencil_clean_loose_exec(bContext *C, wmOperator *op)
static wmOperatorStatus grease_pencil_set_curve_resolution_exec(bContext *C, wmOperator *op)
static const EnumPropertyItem prop_separate_modes[]
static void GREASE_PENCIL_OT_copy(wmOperatorType *ot)
static void GREASE_PENCIL_OT_separate(wmOperatorType *ot)
static bool grease_pencil_separate_layer(bContext &C, Main &bmain, Scene &scene, ViewLayer &view_layer, Base &base_prev, Object &object_src)
static void GREASE_PENCIL_OT_delete_frame(wmOperatorType *ot)
static bke::greasepencil::LayerGroup & copy_layer_group_recursive(GreasePencil &grease_pencil_dst, bke::greasepencil::LayerGroup &parent_dst, const bke::greasepencil::LayerGroup &group_src, Map< StringRefNull, StringRefNull > &layer_name_map)
static void GREASE_PENCIL_OT_set_curve_resolution(wmOperatorType *ot)
static float4x3 expand_4x2_mat(float4x2 strokemat)
static wmOperatorStatus grease_pencil_cyclical_set_exec(bContext *C, wmOperator *op)
bool editable_grease_pencil_poll(bContext *C)
static void remap_vertex_groups(bke::greasepencil::Drawing &drawing, const Map< StringRefNull, StringRefNull > &vertex_group_map)
static wmOperatorStatus grease_pencil_set_start_point_exec(bContext *C, wmOperator *)
static void GREASE_PENCIL_OT_set_uniform_opacity(wmOperatorType *ot)
static Array< int > add_materials_to_map(Object &object, VectorSet< Material * > &materials)
static void GREASE_PENCIL_OT_move_to_layer(wmOperatorType *ot)
static void GREASE_PENCIL_OT_snap_to_grid(wmOperatorType *ot)
static wmOperatorStatus grease_pencil_remove_fill_guides_exec(bContext *C, wmOperator *op)
static void GREASE_PENCIL_OT_clean_loose(wmOperatorType *ot)
static void GREASE_PENCIL_OT_stroke_smooth(wmOperatorType *ot)
IndexMask retrieve_editable_and_selected_points(Object &object, const bke::greasepencil::Drawing &drawing, int layer_index, IndexMaskMemory &memory)
static wmOperatorStatus grease_pencil_move_to_layer_exec(bContext *C, wmOperator *op)
static void GREASE_PENCIL_OT_remove_fill_guides(wmOperatorType *ot)
static void GREASE_PENCIL_OT_stroke_split(wmOperatorType *ot)
static wmOperatorStatus grease_pencil_snap_cursor_to_sel_exec(bContext *C, wmOperator *)
static void GREASE_PENCIL_OT_set_handle_type(wmOperatorType *ot)
static void GREASE_PENCIL_OT_stroke_reorder(wmOperatorType *ot)
static void GREASE_PENCIL_OT_stroke_merge_by_distance(wmOperatorType *ot)
static bool grease_pencil_snap_compute_centroid(const Scene &scene, const Object &object, const GreasePencil &grease_pencil, float3 &r_centroid, float3 &r_min, float3 &r_max)
static const EnumPropertyItem prop_dissolve_types[]
static wmOperatorStatus grease_pencil_set_uniform_opacity_exec(bContext *C, wmOperator *op)
Vector< MutableDrawingInfo > retrieve_editable_drawings_from_layer(const Scene &scene, GreasePencil &grease_pencil, const blender::bke::greasepencil::Layer &layer)
static wmOperatorStatus grease_pencil_clean_loose_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static void GREASE_PENCIL_OT_stroke_subdivide(wmOperatorType *ot)
static bool grease_pencil_snap_poll(bContext *C)
static wmOperatorStatus grease_pencil_caps_set_exec(bContext *C, wmOperator *op)
static wmOperatorStatus gpencil_stroke_subdivide_exec(bContext *C, wmOperator *op)
IndexRange paste_all_strokes_from_clipboard(Main &bmain, Object &object, const float4x4 &object_to_paste_layer, const bool keep_world_transform, const bool paste_back, bke::greasepencil::Drawing &drawing)
static wmOperatorStatus grease_pencil_paste_strokes_exec(bContext *C, wmOperator *op)
static void GREASE_PENCIL_OT_reproject(wmOperatorType *ot)
static Map< StringRefNull, StringRefNull > add_vertex_groups(Object &object, GreasePencil &grease_pencil, const ListBase &vertex_group_names)
static bke::CurvesGeometry subdivide_last_segement(const bke::CurvesGeometry &curves, const IndexMask &strokes)
static void copy_layer_group_content(GreasePencil &grease_pencil_dst, bke::greasepencil::LayerGroup &group_dst, const bke::greasepencil::LayerGroup &group_src, Map< StringRefNull, StringRefNull > &layer_name_map)
static wmOperatorStatus grease_pencil_texture_gradient_modal(bContext *C, wmOperator *op, const wmEvent *event)
static void GREASE_PENCIL_OT_convert_curve_type(wmOperatorType *ot)
static wmOperatorStatus grease_pencil_snap_to_grid_exec(bContext *C, wmOperator *)
static void GREASE_PENCIL_OT_snap_to_cursor(wmOperatorType *ot)
static wmOperatorStatus grease_pencil_set_uniform_thickness_exec(bContext *C, wmOperator *op)
IndexMask retrieve_editable_strokes(Object &object, const bke::greasepencil::Drawing &drawing, int layer_index, IndexMaskMemory &memory)
bool remove_fill_guides(bke::CurvesGeometry &curves)
static wmOperatorStatus grease_pencil_stroke_split_exec(bContext *C, wmOperator *)
Vector< MutableDrawingInfo > retrieve_editable_drawings(const Scene &scene, GreasePencil &grease_pencil)
static struct blender::ed::greasepencil::Clipboard * grease_pencil_clipboard
static void GREASE_PENCIL_OT_stroke_material_set(wmOperatorType *ot)
static void GREASE_PENCIL_OT_set_uniform_thickness(wmOperatorType *ot)
static void GREASE_PENCIL_OT_reset_uvs(wmOperatorType *ot)
static wmOperatorStatus grease_pencil_texture_gradient_exec(bContext *C, wmOperator *op)
static void GREASE_PENCIL_OT_duplicate(wmOperatorType *ot)
static const EnumPropertyItem * material_enum_itemf(bContext *C, PointerRNA *, PropertyRNA *, bool *r_free)
static Object * duplicate_grease_pencil_object(Main *bmain, Scene *scene, ViewLayer *view_layer, Base *base_prev, const GreasePencil &grease_pencil_src)
static void GREASE_PENCIL_OT_paste(wmOperatorType *ot)
static bke::GeometrySet join_geometries_with_transform(Span< bke::GeometrySet > geometries, const float4x4 &transform)
static const bke::CurvesGeometry fit_poly_curves(bke::CurvesGeometry &curves, const IndexMask &selection, const float threshold)
static void GREASE_PENCIL_OT_cyclical_set(wmOperatorType *ot)
Array< Vector< MutableDrawingInfo > > retrieve_editable_drawings_grouped_per_frame(const Scene &scene, GreasePencil &grease_pencil)
static wmOperatorStatus grease_pencil_stroke_simplify_exec(bContext *C, wmOperator *op)
static const EnumPropertyItem prop_cyclical_types[]
static wmOperatorStatus grease_pencil_delete_frame_exec(bContext *C, wmOperator *op)
static void GREASE_PENCIL_OT_dissolve(wmOperatorType *ot)
bool active_grease_pencil_layer_poll(bContext *C)
static wmOperatorStatus grease_pencil_separate_exec(bContext *C, wmOperator *op)
static bool grease_pencil_separate_selected(bContext &C, Main &bmain, Scene &scene, ViewLayer &view_layer, Base &base_prev, Object &object_src)
bke::CurvesGeometry create_curves_outline(const bke::greasepencil::Drawing &drawing, const IndexMask &strokes, const float4x4 &transform, const int corner_subdivisions, const float outline_radius, const float outline_offset, const int material_index)
static wmOperatorStatus grease_pencil_stroke_reorder_exec(bContext *C, wmOperator *op)
static const EnumPropertyItem prop_greasepencil_deleteframe_types[]
static void grease_pencil_simplify_ui(bContext *C, wmOperator *op)
static void GREASE_PENCIL_OT_set_material(wmOperatorType *ot)
static Array< bool > get_points_to_dissolve(bke::CurvesGeometry &curves, const IndexMask &mask, const DissolveMode mode)
static Array< int > get_reordered_indices(const IndexRange universe, const IndexMask &selected, const ReorderDirection direction)
Base * add_duplicate(Main *bmain, Scene *scene, ViewLayer *view_layer, Base *base, eDupli_ID_Flags dupflag)
void base_free_and_unlink(Main *bmain, Scene *scene, Object *ob)
bke::CurvesGeometry remove_points_and_split(const bke::CurvesGeometry &curves, const IndexMask &mask)
bke::CurvesGeometry reorder_curves_geometry(const bke::CurvesGeometry &src_curves, Span< int > old_by_new_map, const bke::AttributeFilter &attribute_filter)
void smooth_curve_attribute(const IndexMask &curves_to_smooth, const OffsetIndices< int > points_by_curve, const VArray< bool > &point_selection, const VArray< bool > &cyclic, int iterations, float influence, bool smooth_ends, bool keep_shape, GMutableSpan attribute_data)
IndexMask simplify_curve_attribute(const Span< float3 > positions, const IndexMask &curves_selection, const OffsetIndices< int > points_by_curve, const VArray< bool > &cyclic, float epsilon, GSpan attribute_data, IndexMaskMemory &memory)
bke::CurvesGeometry fit_poly_to_bezier_curves(const bke::CurvesGeometry &src_curves, const IndexMask &curve_selection, const VArray< float > &thresholds, const VArray< bool > &corners, FitMethod method, const bke::AttributeFilter &attribute_filter)
CurvesGeometry resample_to_evaluated(const CurvesGeometry &src_curves, const IndexMask &selection, const ResampleCurvesOutputAttributeIDs &output_ids={})
bke::GeometrySet join_geometries(Span< bke::GeometrySet > geometries, const bke::AttributeFilter &attribute_filter, const std::optional< Span< bke::GeometryComponent::Type > > &component_types_to_join=std::nullopt)
CurvesGeometry resample_to_length(const CurvesGeometry &src_curves, const IndexMask &selection, const VArray< float > &sample_lengths, const ResampleCurvesOutputAttributeIDs &output_ids={}, bool keep_last_segment=false)
bke::CurvesGeometry subdivide_curves(const bke::CurvesGeometry &src_curves, const IndexMask &selection, const VArray< int > &cuts, const bke::AttributeFilter &attribute_filter={})
bke::CurvesGeometry convert_curves(const bke::CurvesGeometry &src_curves, const IndexMask &selection, CurveType dst_type, const bke::AttributeFilter &attribute_filter, const ConvertCurvesOptions &options={})
void masked_fill(MutableSpan< T > data, const T &value, const IndexMask &mask)
AngleRadianBase< float > AngleRadian
T length_squared(const VecBase< T, Size > &a)
MatBase< T, NumCol, NumRow > transpose(const MatBase< T, NumRow, NumCol > &mat)
T pow(const T &x, const T &power)
T distance(const T &a, const T &b)
T length(const VecBase< T, Size > &a)
T dot(const QuaternionBase< T > &a, const QuaternionBase< T > &b)
CartesianBasis invert(const CartesianBasis &basis)
T midpoint(const T &a, const T &b)
AxisSigned cross(const AxisSigned a, const AxisSigned b)
MatT from_scale(const VecBase< typename MatT::base_type, ScaleDim > &scale)
void min_max(const T &value, T &min, T &max)
MatBase< T, NumCol, NumRow > normalize(const MatBase< T, NumCol, NumRow > &a)
VecBase< T, 3 > transform_direction(const MatBase< T, 3, 3 > &mat, const VecBase< T, 3 > &direction)
MatT from_rotation(const RotationT &rotation)
VecBase< T, 3 > transform_point(const CartesianBasis &basis, const VecBase< T, 3 > &v)
void copy_group_sizes(OffsetIndices< int > offsets, const IndexMask &mask, MutableSpan< int > sizes)
OffsetIndices< int > accumulate_counts_to_offsets(MutableSpan< int > counts_to_offsets, int start_offset=0)
void parallel_for_each(Range &&range, const Function &function)
void parallel_for(const IndexRange range, const int64_t grain_size, const Function &function, const TaskSizeHints &size_hints=detail::TaskSizeHints_Static(1))
MatBase< float, 2, 2 > float2x2
MatBase< float, 4, 4 > float4x4
VecBase< float, 4 > float4
VecBase< float, 2 > float2
MatBase< float, 4, 2 > float4x2
MatBase< float, 3, 2 > float3x2
MatBase< float, 4, 3 > float4x3
VecBase< float, 3 > float3
float wrap(float value, float max, float min)
static void unique_name(bNode *node)
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
bool RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
void RNA_string_get(PointerRNA *ptr, const char *name, char *value)
int RNA_int_get(PointerRNA *ptr, const char *name)
char * RNA_string_get_alloc(PointerRNA *ptr, const char *name, char *fixedbuf, int fixedlen, int *r_len)
float RNA_float_get(PointerRNA *ptr, const char *name)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
int RNA_enum_get(PointerRNA *ptr, const char *name)
const EnumPropertyItem rna_enum_curves_handle_type_items[]
const EnumPropertyItem rna_enum_curves_type_items[]
PropertyRNA * RNA_def_float_factor(StructOrFunctionRNA *cont_, const char *identifier, const float default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, const int maxlen, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_float_distance(StructOrFunctionRNA *cont_, const char *identifier, const float default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
PropertyRNA * RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, const float default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
void RNA_enum_item_end(EnumPropertyItem **items, int *totitem)
void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_enum_funcs(PropertyRNA *prop, EnumPropertyItemFunc itemfunc)
void RNA_def_property_subtype(PropertyRNA *prop, PropertySubType subtype)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, const int default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
const EnumPropertyItem rna_enum_dummy_DEFAULT_items[]
ListBase vertex_group_names
GreasePencilLayerTreeNode base
ListBase vertex_group_names
GreasePencilDrawingBase ** drawing_array
struct ToolSettings * toolsettings
static MatBase identity()
static GeometrySet from_instances(Instances *instances, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
static GeometrySet from_curves(Curves *curves, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
Curves * get_curves_for_write()
const Curves * get_curves() const
MutableVArraySpan< T > span
bke::CurvesGeometry curves
Vector< std::pair< uint, int > > materials
Array< ClipboardLayer > layers
int materials_in_source_num
bke::greasepencil::Drawing & drawing
uiLayout & row(bool align)
void prop(PointerRNA *ptr, PropertyRNA *prop, int index, int value, eUI_Item_Flag flag, std::optional< blender::StringRef > name_opt, int icon, std::optional< blender::StringRef > placeholder=std::nullopt)
struct ReportList * reports
struct wmOperatorType * type
void WM_cursor_wait(bool val)
void WM_menu_name_call(bContext *C, const char *menu_name, short context)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
void WM_gesture_straightline_cancel(bContext *C, wmOperator *op)
wmOperatorStatus WM_gesture_straightline_invoke(bContext *C, wmOperator *op, const wmEvent *event)
wmOperatorStatus WM_gesture_straightline_modal(bContext *C, wmOperator *op, const wmEvent *event)
void WM_operator_properties_gesture_straightline(wmOperatorType *ot, int cursor)
void WM_operatortype_append(void(*opfunc)(wmOperatorType *))
wmOperatorStatus WM_operator_props_popup_confirm_ex(bContext *C, wmOperator *op, const wmEvent *, std::optional< std::string > title, std::optional< std::string > confirm_text, const bool cancel_default)
wmOperatorStatus WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *)