103 if (!(smooth_position || smooth_radius || smooth_opacity)) {
108 bool changed =
false;
129 if (smooth_position) {
185 ot->name =
"Smooth Stroke";
186 ot->idname =
"GREASE_PENCIL_OT_stroke_smooth";
187 ot->description =
"Smooth selected strokes";
194 prop =
RNA_def_int(
ot->srna,
"iterations", 10, 1, 100,
"Iterations",
"", 1, 30);
196 RNA_def_float(
ot->srna,
"factor", 1.0f, 0.0f, 1.0f,
"Factor",
"", 0.0f, 1.0f);
223 "Delete alternating vertices in the stroke, except extremes"},
228 "Use a Ramer-Douglas-Peucker algorithm to simplify the stroke preserving main shape"},
233 "Re-sample the stroke with segments of the specified length"},
238 "Simplify the stroke by merging vertices closer than a given distance"},
239 {0,
nullptr, 0,
nullptr,
nullptr},
251 points_by_curve, stroke_selection, memory);
256 const int curve_i = point_to_curve_map[
i];
257 const IndexRange points = points_by_curve[curve_i];
258 if (points.
size() <= 2) {
261 const int local_i =
i - points.
start();
267 {selected_to_keep, selected_points.
complement(
curves.points_range(), memory)}, memory);
278 bool changed =
false;
301 if (points_to_keep.
size() ==
curves.points_num()) {
305 curves, points_to_keep, {});
340 const int curve_i = point_to_curve_map[
i];
341 const IndexRange points = points_by_curve[curve_i];
348 curves, merge_distance, filtered_points, {});
401 ot->name =
"Simplify Stroke";
402 ot->idname =
"GREASE_PENCIL_OT_stroke_simplify";
403 ot->description =
"Simplify selected strokes";
412 prop =
RNA_def_float(
ot->srna,
"factor", 0.01f, 0.0f, 100.0f,
"Factor",
"", 0.0f, 100.0f);
414 prop =
RNA_def_float(
ot->srna,
"length", 0.05f, 0.01f, 100.0f,
"Length",
"", 0.01f, 1.0f);
416 prop =
RNA_def_float(
ot->srna,
"distance", 0.01f, 0.0f, 100.0f,
"Distance",
"", 0.0f, 1.0f);
418 prop =
RNA_def_int(
ot->srna,
"steps", 1, 0, 50,
"Steps",
"", 0.0f, 10);
425 "Method used for simplifying stroke points");
444 bool changed =
false;
456 curves.remove_curves(elements, {});
475 ot->idname =
"GREASE_PENCIL_OT_delete";
476 ot->description =
"Delete selected strokes or points";
505 "Dissolve points between selected points"},
510 "Dissolve all unselected points"},
511 {0,
nullptr, 0,
nullptr,
nullptr},
525 return points_to_dissolve;
537 for (const int64_t curve_i : range) {
538 const IndexRange points = points_by_curve[curve_i];
539 const Span<bool> curve_selection = points_to_dissolve.as_span().slice(points);
541 if (!curve_selection.contains(true)) {
542 points_to_keep.slice(points).fill(true);
548 if (mode != DissolveMode::BETWEEN) {
552 const Vector<IndexRange> deselection_ranges = array_utils::find_all_ranges(curve_selection,
555 if (deselection_ranges.size() != 0) {
556 const IndexRange first_range = deselection_ranges.first().shift(points.first());
557 const IndexRange last_range = deselection_ranges.last().shift(points.first());
561 if (first_range.first() == points.first()) {
562 points_to_keep.slice(first_range).fill(true);
564 if (last_range.last() == points.last()) {
565 points_to_keep.slice(last_range).fill(true);
573 return points_to_dissolve;
584 bool changed =
false;
600 if (points_to_dissolve.
as_span().contains(
true)) {
618 ot->name =
"Dissolve";
619 ot->idname =
"GREASE_PENCIL_OT_dissolve";
620 ot->description =
"Delete selected points without splitting strokes";
633 "Method used for dissolving stroke points");
656 "Deletes current frame in the active layer"},
661 "Delete active frames for all layers"},
662 {0,
nullptr, 0,
nullptr,
nullptr},
670 const int current_frame = scene->
r.
cfra;
674 bool changed =
false;
678 changed |= grease_pencil.remove_frames(layer, {*layer.
start_frame_at(current_frame)});
683 if (layer->is_editable() && layer->start_frame_at(current_frame)) {
684 changed |= grease_pencil.remove_frames(*layer, {*layer->start_frame_at(current_frame)});
702 ot->name =
"Delete Frame";
703 ot->idname =
"GREASE_PENCIL_OT_delete_frame";
704 ot->description =
"Delete Grease Pencil Frame(s)";
717 "Method used for deleting Grease Pencil frames");
737 int material_index =
object->actcol - 1;
739 if (name[0] !=
'\0') {
750 if (material_index == -1) {
765 curves.attributes_for_write().lookup_or_add_for_write_span<
int>(
"material_index",
779 ot->name =
"Assign Material";
780 ot->idname =
"GREASE_PENCIL_OT_stroke_material_set";
781 ot->description =
"Assign the active material slot to the selected strokes";
789 ot->srna,
"material",
nullptr,
MAX_ID_NAME - 2,
"Material",
"Name of the material");
811 {0,
nullptr, 0,
nullptr,
nullptr},
819 curves.ensure_evaluated_lengths();
825 if (cyclic[curve_i]) {
826 const IndexRange points = points_by_curve[curve_i];
828 positions[points.
last()]);
831 const float curve_length =
curves.evaluated_length_total_for_curve(curve_i,
true) -
835 const float point_density = float(points.
size()) / curve_length;
836 use_cuts[points.
last()] = int(point_density * end_distance);
852 const bool subdivide_cyclic_segment =
RNA_boolean_get(op->
ptr,
"subdivide_cyclic_segment");
854 bool changed =
false;
886 curves.attributes_for_write().remove(
"cyclic");
890 if (subdivide_cyclic_segment) {
892 curves.tag_topology_changed();
911 ot->name =
"Set Cyclical State";
912 ot->idname =
"GREASE_PENCIL_OT_cyclical_set";
913 ot->description =
"Close or open the selected stroke adding a segment from last to first point";
925 "subdivide_cyclic_segment",
927 "Match Point Density",
928 "Add point in the new segment to keep the same density");
943 if (
object->totcol == 0) {
951 *
object, info.drawing, info.layer_index, memory);
959 object->actcol = materials[strokes.
first()] + 1;
970 ot->name =
"Set Active Material";
971 ot->idname =
"GREASE_PENCIL_OT_set_active_material";
972 ot->description =
"Set the selected stroke material as the active material";
994 bool changed =
false;
1021 ot->name =
"Set Uniform Thickness";
1022 ot->idname =
"GREASE_PENCIL_OT_set_uniform_thickness";
1023 ot->description =
"Set all stroke points to same thickness";
1031 ot->srna,
"thickness", 0.1f, 0.0f, 1000.0f,
"Thickness",
"Thickness", 0.0f, 1000.0f);
1050 bool changed =
false;
1070 fill_opacities.span[curve] = opacity_fill;
1087 ot->name =
"Set Uniform Opacity";
1088 ot->idname =
"GREASE_PENCIL_OT_set_uniform_opacity";
1089 ot->description =
"Set all stroke points to same opacity";
1098 RNA_def_float(
ot->srna,
"opacity_stroke", 1.0f, 0.0f, 1.0f,
"Stroke Opacity",
"", 0.0f, 1.0f);
1099 RNA_def_float(
ot->srna,
"opacity_fill", 0.5f, 0.0f, 1.0f,
"Fill Opacity",
"", 0.0f, 1.0f);
1115 bool changed =
false;
1127 curves.reverse_curves(strokes);
1143 ot->name =
"Switch Direction";
1144 ot->idname =
"GREASE_PENCIL_OT_stroke_switch_direction";
1145 ot->description =
"Change direction of the points of the selected strokes";
1176 for (const int curve_i : range) {
1177 const IndexRange points = points_by_curve[curve_i];
1178 const Span<bool> curve_i_selected_points = start_set_points.as_span().slice(points);
1179 const int first_selected = curve_i_selected_points.first_index_try(true);
1181 MutableSpan<int> dst_to_src_slice = dst_to_src_point.as_mutable_span().slice(points);
1183 array_utils::fill_index_range<int>(dst_to_src_slice, points.start());
1185 if (first_selected == -1 || src_cyclic[curve_i] == false) {
1189 std::rotate(dst_to_src_slice.begin(),
1190 dst_to_src_slice.begin() + first_selected,
1191 dst_to_src_slice.end());
1219 dst_curves.update_curve_types();
1221 if (
curves.nurbs_has_custom_knots()) {
1235 std::atomic<bool> changed =
false;
1260 ot->name =
"Set Start Point";
1261 ot->idname =
"GREASE_PENCIL_OT_set_start_point";
1262 ot->description =
"Select which point is the beginning of the curve";
1307 bool changed =
false;
1327 start_caps.finish();
1378 {int(
CapsMode::ROUND),
"ROUND", 0,
"Rounded",
"Set as default rounded"},
1383 {0,
nullptr, 0,
nullptr,
nullptr},
1386 ot->name =
"Set Curve Caps";
1387 ot->idname =
"GREASE_PENCIL_OT_caps_set";
1388 ot->description =
"Change curve caps mode (rounded or flat)";
1415 if (ob ==
nullptr) {
1422 item_tmp.identifier = ma->id.name + 2;
1423 item_tmp.name = ma->id.name + 2;
1424 item_tmp.value =
i + 1;
1425 item_tmp.icon = ma->preview ? ma->preview->runtime->icon_id : ICON_NONE;
1443 if ((slot < 1) || (slot >
object->totcol)) {
1448 object->actcol = slot;
1457 ot->name =
"Set Active Material";
1458 ot->idname =
"GREASE_PENCIL_OT_set_material";
1459 ot->description =
"Set active material";
1485 std::atomic<bool> changed =
false;
1503 changed.store(
true, std::memory_order_relaxed);
1515 ot->name =
"Duplicate";
1516 ot->idname =
"GREASE_PENCIL_OT_duplicate";
1517 ot->description =
"Duplicate the selected points";
1543 editable_strokes,
GrainSize(4096), memory, [&](
const int i) {
1544 return points_by_curve[
i].
size() <= limit;
1547 curves.remove_curves(curves_to_delete, {});
1561 C, op, event,
IFACE_(
"Remove Loose Points"),
IFACE_(
"Delete"));
1566 ot->name =
"Clean Loose Points";
1567 ot->idname =
"GREASE_PENCIL_OT_clean_loose";
1568 ot->description =
"Remove loose points";
1582 "Number of points to consider stroke as loose",
1598 std::atomic<bool> changed =
false;
1636 for (
const int curve :
curves.curves_range()) {
1639 for (
const int point : points_by_curve[curve].drop_back(1)) {
1641 if (!selection[point]) {
1645 if (selection[point + 1]) {
1646 use_cuts[point] = cuts;
1650 if (cyclic[curve]) {
1651 const int first_point = points_by_curve[curve].first();
1652 const int last_point = points_by_curve[curve].last();
1653 if (selection[first_point] && selection[last_point]) {
1654 use_cuts[last_point] = cuts;
1663 changed.store(
true, std::memory_order_relaxed);
1678 ot->name =
"Subdivide Stroke";
1679 ot->idname =
"GREASE_PENCIL_OT_stroke_subdivide";
1681 "Subdivide between continuous selected points of the stroke adding a point half way "
1690 prop =
RNA_def_int(
ot->srna,
"number_cuts", 1, 1, 32,
"Number of Cuts",
"", 1, 5);
1698 "Smooth only selected points in the stroke");
1757 A.to_indices(
indices.as_mutable_span().take_front(
A.size()));
1758 B.to_indices(
indices.as_mutable_span().take_back(
B.size()));
1763 if (curve_i !=
pos) {
1777 const int curve_i = selected_indices[
pos];
1780 if (curve_i != universe.
last(
i)) {
1798 std::atomic<bool> changed =
false;
1818 changed.store(
true, std::memory_order_relaxed);
1837 {0,
nullptr, 0,
nullptr,
nullptr},
1840 ot->name =
"Reorder";
1841 ot->idname =
"GREASE_PENCIL_OT_reorder";
1842 ot->description =
"Change the display order of the selected strokes";
1863 bool changed =
false;
1868 int target_layer_name_length;
1870 op->
ptr,
"target_layer_name",
nullptr, 0, &target_layer_name_length);
1875 if (add_new_layer) {
1876 target_node = &grease_pencil.add_layer(target_layer_name).as_node();
1879 target_node = grease_pencil.find_node_by_name(target_layer_name);
1882 if (target_node ==
nullptr || !target_node->
is_layer()) {
1888 if (layer_dst.is_locked()) {
1906 Drawing &drawing_dst = *grease_pencil.insert_frame(layer_dst, info.frame_number);
1908 curves_src, selected_strokes, {});
1913 else if (
Drawing *drawing_dst = grease_pencil.get_drawing_at(layer_dst, info.frame_number)) {
1916 curves_src, selected_strokes, {});
1919 std::array<bke::GeometrySet, 2> geometry_sets{
1927 drawing_dst->tag_topology_changed();
1930 info.drawing.tag_topology_changed();
1948 if (add_new_layer) {
1952 const std::string
unique_name = grease_pencil.unique_layer_name(
"Layer");
1956 C, op, event,
IFACE_(
"Move to New Layer"),
IFACE_(
"Create"));
1974 ot->name =
"Move to Layer";
1975 ot->idname =
"GREASE_PENCIL_OT_move_to_layer";
1976 ot->description =
"Move selected strokes to another layer";
1985 ot->srna,
"target_layer_name",
nullptr,
INT16_MAX,
"Name",
"Target Grease Pencil Layer");
1988 ot->srna,
"add_new_layer",
false,
"New Layer",
"Move selection to a new layer");
2011 {0,
nullptr, 0,
nullptr,
nullptr},
2016 int actcol =
object->actcol;
2017 for (
int slot = 1; slot <=
object->totcol; slot++) {
2019 object->actcol = slot;
2024 if (actcol >= slot) {
2029 object->actcol = actcol;
2044 object_dst->
data = grease_pencil_dst;
2050 const int layer_index,
2058 const Layer &layer_src = grease_pencil_src.layer(layer_index);
2059 if (
TreeNode *node = grease_pencil_dst.find_node_by_name(layer_src.name())) {
2060 return node->as_layer();
2064 Layer &new_layer = grease_pencil_dst.add_layer(layer_src.name());
2066 src_to_dst_layer_indices.
append(layer_index);
2079 bool changed =
false;
2083 &bmain, &scene, &view_layer, &base_prev, grease_pencil_src);
2100 info.layer_index, grease_pencil_src, grease_pencil_dst, src_to_dst_layer_indices);
2102 Drawing *drawing_dst = grease_pencil_dst.insert_frame(layer_dst, info.frame_number);
2107 curves_src, selected_points, {});
2110 info.drawing.tag_topology_changed();
2122 src_to_dst_layer_indices.
as_span(),
2123 grease_pencil_dst.attributes_for_write());
2126 if (grease_pencil_src.has_active_layer()) {
2127 const Layer &active_layer_src = *grease_pencil_src.get_active_layer();
2128 TreeNode *active_layer_dst = grease_pencil_dst.find_node_by_name(active_layer_src.name());
2129 if (active_layer_dst && active_layer_dst->
is_layer()) {
2130 grease_pencil_dst.set_active_layer(&active_layer_dst->
as_layer());
2156 bool changed =
false;
2161 for (
const int layer_i : grease_pencil_src.layers().index_range()) {
2162 Layer &layer_src = grease_pencil_src.layer(layer_i);
2163 if (layer_src.is_locked()) {
2168 &bmain, &scene, &view_layer, &base_prev, grease_pencil_src);
2172 layer_i, grease_pencil_src, grease_pencil_dst, src_to_dst_layer_indices);
2176 scene, grease_pencil_src, layer_src);
2181 object_src, info.drawing, info.layer_index, memory);
2194 Drawing *drawing_dst = grease_pencil_dst.insert_frame(layer_dst, info.frame_number);
2200 info.drawing.strokes(), strokes, {});
2203 info.drawing.tag_topology_changed();
2214 src_to_dst_layer_indices.
as_span(),
2215 grease_pencil_dst.attributes_for_write());
2235 bool changed =
false;
2246 &bmain, &scene, &view_layer, &base_prev, grease_pencil_src);
2264 object_src, info.drawing, mat_i, memory);
2271 info.layer_index, grease_pencil_src, grease_pencil_dst, src_to_dst_layer_indices);
2273 Drawing *drawing_dst = grease_pencil_dst.insert_frame(layer_dst, info.frame_number);
2281 info.drawing.tag_topology_changed();
2292 src_to_dst_layer_indices.
as_span(),
2293 grease_pencil_dst.attributes_for_write());
2319 bool changed =
false;
2328 const bool has_selection = std::any_of(
2330 return ed::curves::has_anything_selected(info.drawing.strokes());
2332 if (!has_selection) {
2339 *
C, *bmain, *scene, *view_layer, *base_prev, *object_src);
2344 if (object_src->
totcol == 1) {
2351 *
C, *bmain, *scene, *view_layer, *base_prev, *object_src);
2356 if (grease_pencil_src.layers().size() == 1) {
2362 *
C, *bmain, *scene, *view_layer, *base_prev, *object_src);
2379 ot->name =
"Separate";
2380 ot->idname =
"GREASE_PENCIL_OT_separate";
2381 ot->description =
"Separate the selected geometry into a new Grease Pencil object";
2414} *grease_pencil_clipboard =
nullptr;
2446 scene_materials.
add(material->id.session_uid, material);
2459 clipboard_material_remap[clipboard.
materials[
i].second] = target_index;
2465 clipboard_material_remap[clipboard.
materials[
i].second] = target_index;
2468 return clipboard_material_remap;
2476 std::unique_ptr<bke::Instances> instances = std::make_unique<bke::Instances>();
2477 instances->resize(geometries.
size());
2478 transforms.
materialize(instances->transforms_for_write());
2485 options.keep_original_ids =
true;
2486 options.realize_instance_attributes =
false;
2508 int num_elements_copied = 0;
2515 const Layer &layer = grease_pencil.layer(drawing_info.layer_index);
2531 num_elements_copied += copied_curves.
curves_num();
2537 num_elements_copied += copied_curves.
points_num();
2545 if (copied_curves_per_layer.
is_empty()) {
2546 clipboard.
layers.reinitialize(0);
2550 clipboard.
layers.reinitialize(copied_curves_per_layer.
size());
2553 for (
auto const &[layer, geometries] : copied_curves_per_layer.
items()) {
2554 const float4x4 layer_to_object = layer->to_object_space(*
object);
2560 cliplayer.
name = layer->name();
2570 const auto is_material_index_used = [&](
const int material_index) ->
bool {
2575 if (material_indices.
contains(material_index)) {
2583 if (!is_material_index_used(material_index)) {
2603 ot->name =
"Copy Strokes";
2604 ot->idname =
"GREASE_PENCIL_OT_copy";
2605 ot->description =
"Copy the selected Grease Pencil points or strokes to the internal clipboard";
2616 const float4x4 &object_to_paste_layer,
2617 const float4x4 &clipboard_to_world,
2618 const bool keep_world_transform,
2619 const bool paste_back,
2640 (keep_world_transform ?
2641 object.world_to_object() * clipboard_to_world :
2654 if (material_indices) {
2655 for (
const int i : pasted_curves_range) {
2656 material_indices.
span[
i] = clipboard_material_remap[material_indices.
span[
i]];
2658 material_indices.
finish();
2663 return pasted_curves_range;
2687 if (clipboard.
layers.is_empty()) {
2693 bke::GSpanAttributeWriter selection = ed::curves::ensure_selection_attribute(
2694 layer.curves, selection_domain, CD_PROP_BOOL);
2699 Layer *active_layer = grease_pencil.get_active_layer();
2700 if (!active_layer) {
2704 if (!active_layer->is_editable()) {
2716 selection_in_target.
finish();
2722 bool inserted_keyframe =
false;
2730 scene, grease_pencil, *active_layer);
2733 *bmain, *
object, object_to_layer, keep_world_transform, paste_on_back, info.
drawing);
2736 if (inserted_keyframe) {
2741 Layer *active_layer = grease_pencil.get_active_layer();
2744 for (
const int clip_layer_i : clipboard.
layers.index_range()) {
2747 const bool found_layer = node && node->
is_layer() && node->
as_layer().is_editable();
2749 layers_to_paste_into[clip_layer_i] = &node->
as_layer();
2752 if (active_layer && active_layer->is_editable()) {
2755 op->
reports,
RPT_WARNING,
"Couldn't find matching layer, pasting into active layer");
2756 layers_to_paste_into[clip_layer_i] = active_layer;
2760 if (!active_layer) {
2763 if (!active_layer->is_editable()) {
2776 selection_in_target.
finish();
2779 for (
const int clip_layer_i : clipboard.
layers.index_range()) {
2783 BLI_assert(layers_to_paste_into[clip_layer_i] !=
nullptr);
2784 Layer &paste_layer = *layers_to_paste_into[clip_layer_i];
2788 bool inserted_keyframe =
false;
2796 scene, grease_pencil, paste_layer);
2801 object_to_paste_layer,
2803 keep_world_transform,
2808 if (inserted_keyframe) {
2841 {0,
nullptr, 0,
nullptr,
nullptr},
2844 ot->name =
"Paste Strokes";
2845 ot->idname =
"GREASE_PENCIL_OT_paste";
2847 "Paste Grease Pencil points or strokes from the internal clipboard to the active layer";
2857 ot->srna,
"paste_back",
false,
"Paste on Back",
"Add pasted strokes behind all strokes");
2861 "keep_world_transform",
2863 "Keep World Transform",
2864 "Keep the world transform of strokes from the clipboard unchanged");
2872 const float4x4 &object_to_paste_layer,
2873 const bool keep_world_transform,
2874 const bool paste_back,
2878 if (clipboard.
layers.is_empty()) {
2894 joined_clipboard_curves,
2895 object_to_paste_layer,
2897 keep_world_transform,
2914 std::atomic<bool> changed =
false;
2920 const IndexMask points = use_unselected ?
2929 drawing.
strokes(), threshold, points, {});
2931 changed.store(
true, std::memory_order_relaxed);
2944 ot->name =
"Merge by Distance";
2945 ot->idname =
"GREASE_PENCIL_OT_stroke_merge_by_distance";
2946 ot->description =
"Merge points by distance";
2953 prop =
RNA_def_float(
ot->srna,
"threshold", 0.001f, 0.0f, 100.0f,
"Threshold",
"", 0.0f, 100.0f);
2961 "Use whole stroke, not only selected points");
2994 int point_offset = 0;
2996 const IndexRange curve_points = points_by_curve[curve_index];
2998 const bool curve_cyclic = src_cyclic[curve_index];
3000 curve_points_to_extrude.
foreach_index([&](
const int src_point_index) {
3001 if (!curve_cyclic && (src_point_index == curve_points.
first())) {
3004 dst_to_src_points.
insert(src_point_index + point_offset, src_point_index);
3005 dst_selected.
insert(src_point_index + point_offset,
true);
3006 ++dst_curve_counts[curve_index];
3010 if (!curve_cyclic && (src_point_index == curve_points.
last())) {
3013 dst_to_src_points.
insert(src_point_index + point_offset + 1, src_point_index);
3014 dst_selected.
insert(src_point_index + point_offset + 1,
true);
3015 ++dst_curve_counts[curve_index];
3023 dst_to_src_points.
append(src_point_index);
3024 dst_selected.
append(
false);
3025 dst_to_src_points.
append(src_point_index);
3026 dst_selected.
append(
true);
3027 dst_to_src_curves.
append(curve_index);
3028 dst_curve_counts.
append(2);
3032 const int new_points_num = dst_to_src_points.
size();
3033 const int new_curves_num = dst_to_src_curves.
size();
3053 for (
const StringRef selection_attribute_name :
3076 {
".selection",
".selection_handle_left",
".selection_handle_right"}),
3090 points_by_curve[curve_index].
size() == dst_points_by_curve[curve_index].
size();
3108 std::atomic<bool> changed =
false;
3114 if (points_to_extrude.
is_empty()) {
3122 changed.store(
true, std::memory_order_relaxed);
3135 ot->name =
"Extrude Stroke Points";
3136 ot->idname =
"GREASE_PENCIL_OT_extrude";
3137 ot->description =
"Extrude the selected points";
3176 if (keep_original) {
3200 std::atomic<bool> changed =
false;
3204 if (drawings.is_empty()) {
3207 const int current_frame_number = drawings.first().frame_number;
3210 scene.
r.
cfra = current_frame_number;
3225 curves, selection_name, memory);
3227 editable_points, selected_points, memory);
3229 if (points_to_reproject.
is_empty()) {
3234 if (selection_name ==
".selection_handle_left") {
3235 positions =
curves.handle_positions_left_for_write();
3237 else if (selection_name ==
".selection_handle_right") {
3238 positions =
curves.handle_positions_right_for_write();
3246 float3 &position = positions[point_i];
3255 float3 ray_start, ray_direction;
3257 depsgraph, region, v3d, screen_co, ray_start, ray_direction,
true))
3262 float hit_depth = std::numeric_limits<float>::max();
3263 float3 hit_position(0.0f);
3280 world_space_to_layer_space,
3287 scene, *region, *v3d, *
object, &layer, mode, offset,
nullptr);
3289 positions[point_i] = drawing_placement.
reproject(positions[point_i]);
3294 changed.store(
true, std::memory_order_relaxed);
3299 if (snap_context !=
nullptr) {
3304 scene.
r.
cfra = oldframe;
3325 row = &layout->
row(
true);
3329 row = &layout->
row(
true);
3332 row = &layout->
row(
true);
3343 "Reproject the strokes using the X-Z plane"},
3344 {int(
ReprojectMode::Side),
"SIDE", 0,
"Side",
"Reproject the strokes using the Y-Z plane"},
3345 {int(
ReprojectMode::Top),
"TOP", 0,
"Top",
"Reproject the strokes using the X-Y plane"},
3350 "Reproject the strokes to end up on the same plane, as if drawn from the current "
3352 "using 'Cursor' Stroke Placement"},
3357 "Reproject the strokes on to the scene geometry, as if drawn using 'Surface' placement"},
3362 "Reproject the strokes using the orientation of 3D cursor"},
3363 {0,
nullptr, 0,
nullptr,
nullptr},
3367 ot->name =
"Reproject Strokes";
3368 ot->idname =
"GREASE_PENCIL_OT_reproject";
3370 "Reproject the selected strokes from the current viewpoint as if they had been newly "
3372 "(e.g. to fix problems from accidental 3D cursor movement or accidental viewport changes, "
3373 "or for matching deforming geometry)";
3393 "Keep original strokes and create a copy before reprojecting");
3396 RNA_def_float(
ot->srna,
"offset", 0.0f, 0.0f, 10.0f,
"Surface Offset",
"", 0.0f, 10.0f);
3451 curves, selection_name, memory);
3453 const Layer &layer = grease_pencil.layer(drawing_info.layer_index);
3458 if (selection_name ==
".selection_handle_left") {
3459 positions =
curves.handle_positions_left_for_write();
3461 else if (selection_name ==
".selection_handle_right") {
3462 positions =
curves.handle_positions_right_for_write();
3466 const float3 pos_snapped = grid_size *
math::floor(pos_world / grid_size + 0.5f);
3471 drawing_info.drawing.tag_positions_changed();
3483 ot->name =
"Snap Selection to Grid";
3484 ot->idname =
"GREASE_PENCIL_OT_snap_to_grid";
3485 ot->description =
"Snap selected points to the nearest grid points";
3521 selected_points_memory);
3523 const Layer &layer = grease_pencil.layer(drawing_info.layer_index);
3533 curves, selected_curves_memory);
3536 const IndexRange points = points_by_curve[curve_i];
3539 const float3 offset = cursor_layer - positions[points.
first()];
3541 GrainSize(4096), [&](
const int point_i) { positions[point_i] += offset; });
3549 curves.calculate_bezier_auto_handles();
3550 drawing_info.drawing.tag_positions_changed();
3563 ot->name =
"Snap Selection to Cursor";
3564 ot->idname =
"GREASE_PENCIL_OT_snap_to_cursor";
3565 ot->description =
"Snap selected points/strokes to the cursor";
3579 "Offset the entire stroke instead of selected points only");
3597 int num_selected = 0;
3598 r_centroid =
float3(0.0f);
3599 r_min =
float3(std::numeric_limits<float>::max());
3600 r_max =
float3(std::numeric_limits<float>::lowest());
3603 for (
const DrawingInfo &drawing_info : drawings) {
3604 const Layer &layer = grease_pencil.layer(drawing_info.layer_index);
3605 if (layer.is_locked()) {
3618 selected_points_memory);
3624 r_centroid += pos_world;
3627 num_selected += selected_points.
size();
3629 if (num_selected == 0) {
3630 r_min = r_max =
float3(0.0f);
3634 r_centroid /= num_selected;
3645 float3 centroid, points_min, points_max;
3647 scene,
object, grease_pencil, centroid, points_min, points_max))
3675 ot->name =
"Snap Cursor to Selected Points";
3676 ot->idname =
"GREASE_PENCIL_OT_snap_cursor_to_selected";
3677 ot->description =
"Snap cursor to center of selected points";
3701 strokemat4x3[2][2] = 0.0f;
3702 strokemat4x3[3][2] = 1.0f;
3704 return strokemat4x3;
3714 std::atomic<bool> changed =
false;
3730 const float2 screen_direction = screen_end - screen_start;
3731 const float2 screen_tangent = screen_start +
float2(-screen_direction[1], screen_direction[0]);
3743 const int material_index = materials[curve_i];
3746 material_index + 1);
3757 positions[points_by_curve[curve_i].first()]);
3770 const float3 origin = start;
3776 if (
math::dot(tangent - start, v_dir) < 0.0f) {
3788 offset_matrix *= 0.5f;
3789 offset_matrix[2] +=
float2(0.5f, 0.5f);
3793 offset_matrix[2] -=
float2(0.5f, 0.5f);
3796 offset_matrix = texture_rotation * offset_matrix;
3797 offset_matrix[2] -= texture_offset;
3800 layer_space_to_world_space;
3805 changed.store(
true, std::memory_order_relaxed);
3856 ot->name =
"Texture Gradient";
3857 ot->idname =
"GREASE_PENCIL_OT_texture_gradient";
3858 ot->description =
"Draw a line to set the fill material gradient for the selected strokes";
3888 bool changed =
false;
3900 options.convert_bezier_handles_to_poly_points = use_handles;
3901 options.convert_bezier_handles_to_catmull_rom_points = use_handles;
3902 options.keep_bezier_shape_as_nurbs = use_handles;
3903 options.keep_catmull_rom_shape_as_nurbs = use_handles;
3921 ot->name =
"Set Curve Type";
3922 ot->idname =
"GREASE_PENCIL_OT_set_curve_type";
3923 ot->description =
"Set type of selected curves";
3938 "Take handle information into account in the conversion");
3955 bool changed =
false;
3980 const IndexRange points = points_by_curve[curve_i];
3981 for (
const int point_i : points) {
3982 if (selection_left[point_i] || selection[point_i]) {
3983 handle_types_left[point_i] = int8_t(dst_handle_type);
3985 if (selection_right[point_i] || selection[point_i]) {
3986 handle_types_right[point_i] = int8_t(dst_handle_type);
3991 curves.calculate_bezier_auto_handles();
3992 curves.tag_topology_changed();
4008 ot->name =
"Set Handle Type";
4009 ot->idname =
"GREASE_PENCIL_OT_set_handle_type";
4010 ot->description =
"Set the handle type for bezier curves";
4036 bool changed =
false;
4066 ot->name =
"Set Curve Resolution";
4067 ot->idname =
"GREASE_PENCIL_OT_set_curve_resolution";
4068 ot->description =
"Set resolution of selected curves";
4081 "The resolution to use for each curve segment",
4098 bool changed =
false;
4110 if (attributes.
contains(
"uv_rotation")) {
4111 if (editable_strokes.
size() ==
curves.curves_num()) {
4112 attributes.
remove(
"uv_rotation");
4122 if (attributes.
contains(
"uv_translation")) {
4123 if (editable_strokes.
size() ==
curves.curves_num()) {
4124 attributes.
remove(
"uv_translation");
4130 uv_translations.
finish();
4134 if (attributes.
contains(
"uv_scale")) {
4135 if (editable_strokes.
size() ==
curves.curves_num()) {
4136 attributes.
remove(
"uv_scale");
4146 if (attributes.
contains(
"uv_shear")) {
4147 if (editable_strokes.
size() ==
curves.curves_num()) {
4148 attributes.
remove(
"uv_shear");
4173 ot->name =
"Reset UVs";
4174 ot->idname =
"GREASE_PENCIL_OT_reset_uvs";
4175 ot->description =
"Reset UV transformation to default values";
4189 std::atomic<bool> changed =
false;
4205 changed.store(
true, std::memory_order_relaxed);
4220 ot->name =
"Split stroke";
4221 ot->idname =
"GREASE_PENCIL_OT_stroke_split";
4222 ot->description =
"Split selected points to a new stroke";
4248 std::atomic<bool> changed =
false;
4251 for (
const int layer_i : grease_pencil.layers().index_range()) {
4252 const Layer &layer = grease_pencil.layer(layer_i);
4253 if (!layer.is_editable()) {
4256 if (
Drawing *drawing = grease_pencil.get_editable_drawing_at(layer, scene.
r.
cfra)) {
4257 drawings.
append({*drawing, layer_i, scene.
r.
cfra, 1.0f});
4262 for (
const int layer_i : grease_pencil.layers().index_range()) {
4263 const Layer &layer = grease_pencil.layer(layer_i);
4264 if (!layer.is_editable()) {
4267 for (
const auto [frame_number, frame] : layer.
frames().
items()) {
4268 if (
Drawing *drawing = grease_pencil.get_editable_drawing_at(layer, frame_number)) {
4269 drawings.
append({*drawing, layer_i, frame_number, 1.0f});
4277 changed.store(
true, std::memory_order_relaxed);
4295 {0,
nullptr, 0,
nullptr,
nullptr},
4299 ot->name =
"Remove Fill Guides";
4300 ot->idname =
"GREASE_PENCIL_OT_remove_fill_guides";
4301 ot->description =
"Remove all the strokes that were created from the fill tool as guides";
4333 {0,
nullptr, 0,
nullptr,
nullptr},
4346 const int corner_subdivisions =
RNA_int_get(op->
ptr,
"corner_subdivisions");
4347 const float outline_offset = radius * offset_factor;
4348 const int mat_nr = -1;
4360 viewinv =
float4x4({1.0f, 0.0f, 0.0f, 0.0f},
4361 {0.0f, 0.0f, 1.0f, 0.0f},
4362 {0.0f, 1.0f, 0.0f, 0.0f},
4363 {0.0f, 0.0f, 0.0f, 1.0f});
4366 viewinv =
float4x4({0.0f, 0.0f, 1.0f, 0.0f},
4367 {0.0f, 1.0f, 0.0f, 0.0f},
4368 {1.0f, 0.0f, 0.0f, 0.0f},
4369 {0.0f, 0.0f, 0.0f, 1.0f});
4379 viewinv = scene->
camera->world_to_object();
4386 bool changed =
false;
4402 corner_subdivisions,
4413 const std::array<bke::GeometrySet, 2> geometry_sets = {
4434 ot->name =
"Outline";
4435 ot->idname =
"GREASE_PENCIL_OT_outline";
4436 ot->description =
"Convert selected strokes to perimeter";
4449 ot->srna,
"offset_factor", -1.0f, -1.0f, 1.0f,
"Offset Factor",
"", -1.0f, 1.0f);
4450 RNA_def_int(
ot->srna,
"corner_subdivisions", 2, 0, 10,
"Corner Subdivisions",
"", 0, 5);
4461 const float threshold)
4472 const float threshold)
4478 const IndexMask non_catmull_rom_curves_selection =
4480 .complement(selection, memory);
4489 non_catmull_rom_curves_selection,
4490 curves.points_by_curve(),
4495 curves.remove_points(points_to_remove, {});
4498 options.convert_bezier_handles_to_poly_points =
false;
4499 options.convert_bezier_handles_to_catmull_rom_points =
false;
4500 options.keep_bezier_shape_as_nurbs =
true;
4501 options.keep_catmull_rom_shape_as_nurbs =
true;
4513 .indices_for_curve_type(
4515 .complement(selection, memory);
4522 const float threshold)
4528 const IndexMask poly_curves_selection =
curves.indices_for_curve_type(
4530 if (!poly_curves_selection.
is_empty()) {
4535 options.convert_bezier_handles_to_poly_points =
false;
4536 options.convert_bezier_handles_to_catmull_rom_points =
false;
4537 options.keep_bezier_shape_as_nurbs =
true;
4538 options.keep_catmull_rom_shape_as_nurbs =
true;
4544 const float threshold)
4551 const IndexMask poly_curves_selection =
curves.indices_for_curve_type(
4553 if (!poly_curves_selection.
is_empty()) {
4558 options.convert_bezier_handles_to_poly_points =
false;
4559 options.convert_bezier_handles_to_catmull_rom_points =
false;
4560 options.keep_bezier_shape_as_nurbs =
true;
4561 options.keep_catmull_rom_shape_as_nurbs =
true;
4574 std::atomic<bool> changed =
false;
4601 changed.store(
true, std::memory_order_relaxed);
4635 ot->name =
"Convert Curve Type";
4636 ot->idname =
"GREASE_PENCIL_OT_convert_curve_type";
4637 ot->description =
"Convert type of selected curves";
4657 "The distance that the resulting points are allowed to be within",
4724 Layer &layer_dst = grease_pencil_dst.add_layer(group_dst, layer_src.name());
4747 switch (child->type) {
4750 Layer &layer_dst =
copy_layer(grease_pencil_dst, group_dst, layer_src);
4751 layer_name_map.
add_new(layer_src.name(), layer_dst.name());
4783 if (material !=
nullptr) {
4787 material_index_map[
i] = 0;
4790 return material_index_map;
4802 for (const int curve_i : range) {
4803 material_writer.span[curve_i] = material_index_map[material_writer.span[curve_i]];
4806 material_writer.
finish();
4811 const ListBase &vertex_group_names)
4820 return vertex_group_map;
4827 STRNCPY(dg->name, vertex_group_map.
lookup(dg->name).c_str());
4851 const int orig_layers_num = grease_pencil_dst.layers().size();
4873 grease_pencil_dst.resize_drawings(0);
4881 grease_pencil_dst.root_group(),
4882 grease_pencil_src.root_group(),
4890 grease_pencil_dst.layers().size());
4895 grease_pencil_src.layers().size());
4898 for (
const int layer_index : grease_pencil_dst.layers().index_range()) {
4899 Layer &layer = *grease_pencil_dst.layers_for_write()[layer_index];
4900 const bool is_orig_layer = (layer_index < orig_layers_num);
4905 if (!is_orig_layer) {
4909 if (new_mask_name) {
4917 drawing_index = new_drawings_src[drawing_index];
4942 if (!is_orig_layer) {
4951 if (
id == &grease_pencil_src.
id && fcu->
rna_path && strstr(fcu->
rna_path,
"layers[")) {
4953 for (
auto [name_src, name_dst] : layer_name_map.
items()) {
4954 if (name_dst != name_src) {
4955 const char *old_path = fcu->
rna_path;
4957 id, fcu->
rna_path,
"layers", name_src.c_str(), name_dst.c_str(), 0, 0,
false);
4970 if (dtar->id != &grease_pencil_src.
id) {
4973 dtar->id = &grease_pencil_dst.
id;
4975 if (dtar->rna_path && strstr(dtar->rna_path,
"layers[")) {
4976 for (
auto [name_src, name_dst] : layer_name_map.
items()) {
4977 if (name_dst != name_src) {
4978 const char *old_path = fcu->
rna_path;
4980 id, dtar->rna_path,
"layers", name_src.c_str(), name_dst.c_str(), 0, 0,
false);
4981 if (old_path != dtar->rna_path) {
4995 if (ob_dst.
adt ==
nullptr) {
5006 if (grease_pencil_src.
adt) {
5007 if (grease_pencil_dst.
adt ==
nullptr) {
5036 if (ob_iter == ob_active) {
5048 Object *ob_dst = ob_active;
5053 *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 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 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 *)