Blender V5.3
grease_pencil_join_selection.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include "BKE_attribute.hh"
10#include "BKE_context.hh"
11#include "BKE_grease_pencil.hh"
12#include "BKE_report.hh"
13
14#include "DNA_scene_types.h"
15
16#include "DEG_depsgraph.hh"
17
18#include "ED_curves.hh"
19#include "ED_grease_pencil.hh"
20#include "RNA_access.hh"
21
22#include "WM_api.hh"
23
24#include "RNA_define.hh"
25
26#include <algorithm>
27
28namespace blender {
29
30namespace ed::greasepencil {
31
32namespace {
33
38struct PointsRange {
39 bke::greasepencil::Drawing *from_drawing;
40 IndexRange range;
41};
42
43enum class ActionOnNextRange { Nothing, ReverseExisting, ReverseAddition, ReverseBoth };
44
45enum class ActiveLayerBehavior { JoinStrokes, SplitAndCopy, SplitPoints };
46
53Vector<PointsRange> retrieve_selection_ranges(Object &object,
54 const Span<MutableDrawingInfo> drawings,
55 const ActiveLayerBehavior active_layer_behavior,
56 int64_t &r_total_points_selected,
57 IndexMaskMemory &memory)
58{
59 Vector<PointsRange> selected_ranges{};
60 r_total_points_selected = 0;
61
62 for (const MutableDrawingInfo &info : drawings) {
63 if (active_layer_behavior == ActiveLayerBehavior::JoinStrokes) {
64 IndexMask curves_selection = retrieve_editable_and_selected_strokes(
65 object, info.drawing, info.layer_index, memory);
66 if (curves_selection.is_empty()) {
67 continue;
68 }
69
70 const OffsetIndices<int> points_by_curve = info.drawing.strokes().points_by_curve();
71 curves_selection.foreach_index([&](const int curve_i) {
72 const IndexRange points = points_by_curve[curve_i];
73 selected_ranges.append({&info.drawing, points});
74 r_total_points_selected += points.size();
75 });
76
77 continue;
78 }
79
80 IndexMask points_selection = retrieve_editable_and_selected_points(
81 object, info.drawing, info.layer_index, memory);
82 if (points_selection.is_empty()) {
83 continue;
84 }
85 r_total_points_selected += points_selection.size();
86
87 const Vector<IndexRange> initial_ranges = points_selection.to_ranges();
88
94 const Array<int> points_map = info.drawing.strokes().point_to_curve_map();
95 for (const IndexRange initial_range : initial_ranges) {
96 if (points_map[initial_range.first()] == points_map[initial_range.last()]) {
97 selected_ranges.append({&info.drawing, initial_range});
98 continue;
99 }
100
101 IndexRange range = {initial_range.start(), 1};
102 int previous_curve = points_map[range.start()];
103 for (const int64_t index : initial_range.drop_front(1)) {
104 const int current_curve = points_map[index];
105 if (previous_curve != current_curve) {
106 selected_ranges.append({&info.drawing, range});
107 range = {index, 1};
108 previous_curve = current_curve;
109 }
110 else {
111 range = {range.start(), range.size() + 1};
112 }
113 }
114
115 selected_ranges.append({&info.drawing, range});
116 }
117 }
118
119 return selected_ranges;
120}
121
122template<typename T> void reverse_point_data(const IndexRange point_range, MutableSpan<T> data)
123{
124 data.slice(point_range.first(), point_range.size()).reverse();
125}
126
127template<typename T>
128void swap_handle_attributes(MutableSpan<T> handles_left, MutableSpan<T> handles_right)
129{
130 BLI_assert(handles_left.size() == handles_right.size());
131 threading::parallel_for(handles_left.index_range(), 8192, [&](const IndexRange range) {
132 for (const int point : range) {
133 std::swap(handles_left[point], handles_right[point]);
134 }
135 });
136};
137
142void reverse_points_of(bke::CurvesGeometry &dst_curves, const IndexRange points_to_reverse)
143{
144 bke::MutableAttributeAccessor attributes = dst_curves.attributes_for_write();
145
146 attributes.foreach_attribute([&](const bke::AttributeIter &iter) {
147 if (iter.domain != bke::AttrDomain::Point) {
148 return;
149 }
150 if (iter.data_type == bke::AttrType::String) {
151 return;
152 }
153 if (iter.storage_type == bke::AttrStorageType::Single) {
154 return;
155 }
156
157 bke::GSpanAttributeWriter attribute = attributes.lookup_for_write_span(iter.name);
158 bke::attribute_math::to_static_type(attribute.span.type(), [&]<typename T>() {
159 reverse_point_data<T>(points_to_reverse, attribute.span.typed<T>());
160 });
161 attribute.finish();
162 });
163
164 /* Also needs to swap left/right bezier handles if handle attributes exist. */
165 if (attributes.contains("handle_left") && attributes.contains("handle_right")) {
166 MutableSpan<float3> handles_left = dst_curves.handle_positions_left_for_write().slice(
167 points_to_reverse);
168 MutableSpan<float3> handles_right = dst_curves.handle_positions_right_for_write().slice(
169 points_to_reverse);
170 swap_handle_attributes<float3>(handles_left, handles_right);
171 }
172 if (attributes.contains(".selection_handle_left") &&
173 attributes.contains(".selection_handle_right"))
174 {
175 bke::SpanAttributeWriter<bool> writer_left = attributes.lookup_for_write_span<bool>(
176 ".selection_handle_left");
177 bke::SpanAttributeWriter<bool> writer_right = attributes.lookup_for_write_span<bool>(
178 ".selection_handle_right");
179 const MutableSpan<bool> selection_left = writer_left.span.slice(points_to_reverse);
180 const MutableSpan<bool> selection_right = writer_right.span.slice(points_to_reverse);
181 swap_handle_attributes<bool>(selection_left, selection_right);
182 writer_left.finish();
183 writer_right.finish();
184 }
185 if (attributes.contains("handle_type_left") && attributes.contains("handle_type_right")) {
186 MutableSpan<int8_t> types_left = dst_curves.handle_types_left_for_write().slice(
187 points_to_reverse);
188 MutableSpan<int8_t> types_right = dst_curves.handle_types_right_for_write().slice(
189 points_to_reverse);
190 swap_handle_attributes<int8_t>(types_left, types_right);
191 }
192}
193
194void apply_action(ActionOnNextRange action,
195 const IndexRange working_range,
196 const IndexRange adding_range,
197 bke::CurvesGeometry &dst_curves)
198{
210
211 switch (action) {
212 case ActionOnNextRange::Nothing:
213 return;
214 case ActionOnNextRange::ReverseExisting: {
215 reverse_points_of(dst_curves, working_range);
216 break;
217 }
218 case ActionOnNextRange::ReverseAddition: {
219 const IndexRange src_range_on_dst = {working_range.last() + 1, adding_range.size()};
220 reverse_points_of(dst_curves, src_range_on_dst);
221 break;
222 }
223 case ActionOnNextRange::ReverseBoth: {
224 apply_action(ActionOnNextRange::ReverseExisting, working_range, adding_range, dst_curves);
225 apply_action(ActionOnNextRange::ReverseAddition, working_range, adding_range, dst_curves);
226 break;
227 }
228 }
229}
230
238int64_t compute_closest_range_to(PointsRange &range,
239 const Span<PointsRange> &ranges,
240 int64_t starting_from,
241 ActionOnNextRange &r_action)
242{
243 auto get_range_begin_end = [](const PointsRange &points_range) -> std::pair<float3, float3> {
244 const Span<float3> current_range_positions = points_range.from_drawing->strokes().positions();
245 const float3 range_begin = current_range_positions[points_range.range.first()];
246 const float3 range_end = current_range_positions[points_range.range.last()];
247
248 return {range_begin, range_end};
249 };
250
251 const auto [cur_range_begin, cur_range_end] = get_range_begin_end(range);
252 float min_dist = FLT_MAX;
253
254 int64_t ret_value = starting_from;
255 ActionOnNextRange action = ActionOnNextRange::Nothing;
256
257 const int64_t iterations = ranges.size() - starting_from;
258 for (const int64_t i : IndexRange(starting_from, iterations)) {
259 const auto [range_begin, range_end] = get_range_begin_end(ranges[i]);
260
261 float dist = math::distance_squared(cur_range_end, range_begin);
262 if (dist < min_dist) {
263 action = ActionOnNextRange::Nothing;
264 ret_value = i;
265 min_dist = dist;
266 }
267
268 dist = math::distance_squared(cur_range_begin, range_begin);
269 if (dist < min_dist) {
270 action = ActionOnNextRange::ReverseExisting;
271 ret_value = i;
272 min_dist = dist;
273 }
274
275 dist = math::distance_squared(cur_range_end, range_end);
276 if (dist < min_dist) {
277 action = ActionOnNextRange::ReverseAddition;
278 ret_value = i;
279 min_dist = dist;
280 }
281
282 dist = math::distance_squared(cur_range_begin, range_end);
283 if (dist < min_dist) {
284 action = ActionOnNextRange::ReverseBoth;
285 ret_value = i;
286 min_dist = dist;
287 }
288 }
289
290 r_action = action;
291 return ret_value;
292}
293
294void copy_range_to_dst(const PointsRange &points_range,
295 int &dst_starting_point,
296 bke::CurvesGeometry &dst_curves)
297{
298 Array<int> src_raw_offsets(2);
299 Array<int> dst_raw_offsets(2);
300
301 const int64_t selection_size = points_range.range.size();
302 src_raw_offsets[0] = points_range.range.first();
303 src_raw_offsets[1] = points_range.range.last() + 1;
304
305 dst_raw_offsets[0] = dst_starting_point;
306 dst_starting_point += selection_size;
307 dst_raw_offsets[1] = dst_starting_point;
308
309 OffsetIndices<int> src_offsets{src_raw_offsets};
310 OffsetIndices<int> dst_offsets{dst_raw_offsets};
311
312 copy_attributes_group_to_group(points_range.from_drawing->strokes().attributes(),
314 {},
315 {},
316 src_offsets,
317 dst_offsets,
318 IndexMask{1},
319 dst_curves.attributes_for_write());
320}
321
322PointsRange copy_point_attributes(MutableSpan<PointsRange> selected_ranges,
323 bke::CurvesGeometry &dst_curves,
324 bke::greasepencil::Drawing &dst_drawing)
325{
326 /* The algorithm for joining the points goes as follows:
327 * 1. Pick the first range of the selected ranges of points, which will be the working range
328 * 2. Copy the attributes of this range to dst_curves
329 * 3. Lookup in the remaining ranges for the one closer to the working range
330 * 4. Copy its attributes
331 * 5. In order to minimize the length of the stroke connecting them, reverse their points as
332 * needed
333 * 6. Extend the working range with the new range
334 * 7. Remove the new range from the list of remaining ranges. Lookup for the next one and
335 * continue
336 */
337
338 const PointsRange &first_range = selected_ranges.first();
339 PointsRange working_range = {&dst_drawing, {0, first_range.range.size()}};
340
341 int next_point_index = 0;
342 copy_range_to_dst(first_range, next_point_index, dst_curves);
343
344 const int64_t ranges = selected_ranges.size() - 1;
345 for (const int64_t i : IndexRange(1, ranges)) {
346 ActionOnNextRange action;
347 const int64_t closest_range = compute_closest_range_to(
348 working_range, selected_ranges, i, action);
349 std::swap(selected_ranges[i], selected_ranges[closest_range]);
350 PointsRange &next_range = selected_ranges[i];
351 copy_range_to_dst(next_range, next_point_index, dst_curves);
352 apply_action(action, working_range.range, next_range.range, dst_curves);
353 working_range.range = {0, next_point_index};
354 }
355
356 return working_range;
357}
358
359void copy_curve_attributes(Span<PointsRange> ranges_selected,
360 bke::CurvesGeometry &dst_curves,
361 bke::greasepencil::Drawing &dst_drawing)
362{
363 /* The decision of which stroke use to copy the curve attributes is a bit arbitrary, since the
364 * original selection may embrace several strokes. The criteria is as follows:
365 * - If the selection contained points from the active layer, the first selected stroke from it
366 * is used.
367 * - Otherwise, the first selected stroke is used.
368 * Reasoning behind is that the user will probably want to keep similar curve parameters for
369 * all the strokes in a layer.
370 * Also, the "cyclic" attribute is deliberately set to false, since user
371 * probably wants to set it manually
372 */
373
374 auto src_range = [&]() -> const PointsRange & {
375 const auto *it = std::find_if(
376 ranges_selected.begin(), ranges_selected.end(), [dst_drawing](const PointsRange &range) {
377 return range.from_drawing == &dst_drawing;
378 });
379
380 return it != ranges_selected.end() ? *it : ranges_selected.first();
381 }();
382
383 const bke::CurvesGeometry &src_curves = src_range.from_drawing->strokes();
384 const Array<int> points_map = src_curves.point_to_curve_map();
385 const int first_selected_curve = points_map[src_range.range.first()];
386
387 const int final_curve_index = dst_curves.curves_num() - 1;
388 const Array<int> dst_curves_raw_offsets = {final_curve_index, dst_curves.curves_num()};
389 const OffsetIndices<int> dst_curve_offsets{dst_curves_raw_offsets};
390
391 gather_attributes_to_groups(src_curves.attributes(),
395 dst_curve_offsets,
396 IndexMask({first_selected_curve, 1}),
397 dst_curves.attributes_for_write());
398 dst_curves.cyclic_for_write().first() = false;
399}
400
405void clear_selection_attribute(Span<PointsRange> ranges_selected,
406 const bke::AttrDomain selection_domain)
407{
408 for (const PointsRange &range : ranges_selected) {
409 bke::CurvesGeometry &curves = range.from_drawing->strokes_for_write();
410 bke::MutableAttributeAccessor attributes = curves.attributes_for_write();
411 if (bke::SpanAttributeWriter<bool> selection = attributes.lookup_or_add_for_write_span<bool>(
412 ".selection", selection_domain))
413 {
414 selection.span.fill(false);
415 selection.finish();
416 }
417 if (bke::GSpanAttributeWriter selection = attributes.lookup_for_write_span(".selection_left"))
418 {
419 ed::curves::fill_selection_false(selection.span);
420 selection.finish();
421 }
422 if (bke::GSpanAttributeWriter selection = attributes.lookup_for_write_span(".selection_right"))
423 {
424 ed::curves::fill_selection_false(selection.span);
425 selection.finish();
426 }
427 }
428}
429
430void remove_selected_points(Span<PointsRange> ranges_selected)
431{
432 /* Removing points from a drawing invalidates subsequent ranges for the same drawing.
433 * Combine all ranges for the same drawings first to prevent removing the wrong points. */
434 using RangesMap = Map<bke::greasepencil::Drawing *, Vector<IndexMask>>;
435 RangesMap ranges_by_drawing;
436 for (const PointsRange &points_range : ranges_selected) {
437 BLI_assert(points_range.from_drawing != nullptr);
438 Vector<IndexMask> &ranges = ranges_by_drawing.lookup_or_add(points_range.from_drawing, {});
439 ranges.append(points_range.range);
440 }
441
442 for (const RangesMap::Item &item : ranges_by_drawing.items()) {
443 bke::CurvesGeometry &dst_curves = item.key->strokes_for_write();
444 IndexMaskMemory memory;
445 const IndexMask combined_mask = IndexMask::from_union(item.value, memory);
446 dst_curves.remove_points(combined_mask, {});
447 item.key->tag_topology_changed();
448 }
449}
450
451void append_strokes_from(bke::CurvesGeometry &&other, bke::CurvesGeometry &dst)
452{
453 const int initial_points_num = dst.points_num();
454 const int initial_curves_num = dst.curves_num();
455 const int other_points_num = other.points_num();
456 const int other_curves_num = other.curves_num();
457
458 dst.resize(initial_points_num + other_points_num, initial_curves_num + other_curves_num);
459
460 Array<int> other_raw_offsets{0, other_points_num};
461 Array<int> dst_raw_offsets{initial_points_num, initial_points_num + other_points_num};
462
463 OffsetIndices<int> other_point_offsets{other_raw_offsets};
464 OffsetIndices<int> dst_point_offsets{dst_raw_offsets};
465
466 copy_attributes_group_to_group(other.attributes(),
469 {},
470 other_point_offsets,
471 dst_point_offsets,
472 IndexMask{1},
473 dst.attributes_for_write());
474
475 other_raw_offsets = {0, other_curves_num};
476 dst_raw_offsets = {initial_curves_num, initial_curves_num + other_curves_num};
477
478 OffsetIndices<int> other_curve_offsets{other_raw_offsets};
479 OffsetIndices<int> dst_curve_offsets{dst_raw_offsets};
480
481 copy_attributes_group_to_group(other.attributes(),
484 {},
485 other_curve_offsets,
486 dst_curve_offsets,
487 IndexMask{1},
488 dst.attributes_for_write());
489}
490
491/* -------------------------------------------------------------------- */
494
499wmOperatorStatus grease_pencil_join_selection_exec(bContext *C, wmOperator *op)
500{
501 using namespace bke::greasepencil;
502
503 const Scene *scene = CTX_data_scene(C);
506 scene->toolsettings, object);
507 GreasePencil &grease_pencil = *id_cast<GreasePencil *>(object->data);
508 if (!grease_pencil.has_active_layer()) {
509 BKE_report(op->reports, RPT_ERROR, "No active layer");
510 return OPERATOR_CANCELLED;
511 }
512
513 const ActiveLayerBehavior active_layer_behavior = static_cast<ActiveLayerBehavior>(
514 RNA_enum_get(op->ptr, "type"));
515 const Layer &active_layer = *grease_pencil.get_active_layer();
516
517 Drawing *dst_drawing = grease_pencil.get_editable_drawing_at(active_layer, scene->r.cfra);
518 if (dst_drawing == nullptr) {
519 return OPERATOR_CANCELLED;
520 }
521
522 IndexMaskMemory memory;
523 int64_t selected_points_count;
524 const Vector<MutableDrawingInfo> editable_drawings = retrieve_editable_drawings(*scene,
525 grease_pencil);
526 Vector<PointsRange> ranges_selected = retrieve_selection_ranges(
527 *object, editable_drawings, active_layer_behavior, selected_points_count, memory);
528 if (ranges_selected.size() <= 1) {
529 /* Nothing to join */
530 return OPERATOR_FINISHED;
531 }
532
533 /* Temporary geometry where to perform the logic
534 * Once it gets stable, it is appended all at once to the destination curves */
535 Drawing tmp_drawing;
536 tmp_drawing.strokes_for_write() = bke::CurvesGeometry(selected_points_count, 1);
537 bke::CurvesGeometry &tmp_curves = tmp_drawing.strokes_for_write();
538
539 const PointsRange working_range = copy_point_attributes(
540 ranges_selected, tmp_curves, tmp_drawing);
541 copy_curve_attributes(ranges_selected, tmp_curves, *dst_drawing);
542
543 clear_selection_attribute(ranges_selected, selection_domain);
544
545 Array<PointsRange> working_range_collection = {working_range};
546 clear_selection_attribute(working_range_collection, selection_domain);
547
548 bke::CurvesGeometry &dst_curves = dst_drawing->strokes_for_write();
549 if (ELEM(active_layer_behavior,
550 ActiveLayerBehavior::SplitPoints,
551 ActiveLayerBehavior::JoinStrokes))
552 {
553 remove_selected_points(ranges_selected);
554 }
555
556 const int tmp_curves_num = tmp_curves.curves_num();
557 const int tmp_points_num = tmp_curves.points_num();
558 append_strokes_from(std::move(tmp_curves), dst_curves);
559
560 if (active_layer_behavior != ActiveLayerBehavior::JoinStrokes) {
561 bke::GSpanAttributeWriter selection = ed::curves::ensure_selection_attribute(
562 dst_curves, selection_domain, bke::AttrType::Bool);
563
564 if (selection_domain == bke::AttrDomain::Curve) {
565 ed::curves::fill_selection_true(selection.span.take_back(tmp_curves_num));
566 }
567 else {
568 ed::curves::fill_selection_true(selection.span.take_back(tmp_points_num));
569 }
570 selection.finish();
571 }
572
573 dst_curves.update_curve_types();
574 dst_curves.tag_topology_changed();
575 dst_drawing->tag_topology_changed();
576
577 DEG_id_tag_update(&grease_pencil.id, ID_RECALC_GEOMETRY);
578 WM_event_add_notifier(C, NC_GEOM | ND_DATA, &grease_pencil);
579
580 return OPERATOR_FINISHED;
581}
582
583void GREASE_PENCIL_OT_join_selection(wmOperatorType *ot)
584{
585 static const EnumPropertyItem active_layer_behavior[] = {
586 {int(ActiveLayerBehavior::JoinStrokes),
587 "JOINSTROKES",
588 0,
589 "Join Strokes",
590 "Join the selected strokes into one stroke"},
591 {int(ActiveLayerBehavior::SplitAndCopy),
592 "SPLITCOPY",
593 0,
594 "Split and Copy",
595 "Copy the selected points to a new stroke"},
596 {int(ActiveLayerBehavior::SplitPoints),
597 "SPLIT",
598 0,
599 "Split",
600 "Split the selected point to a new stroke"},
601 {0, nullptr, 0, nullptr, nullptr},
602 };
603
604 /* identifiers. */
605 ot->name = "Join Selection";
606 ot->idname = "GREASE_PENCIL_OT_join_selection";
607 ot->description = "New stroke from selected points/strokes";
608
609 /* callbacks. */
610 ot->invoke = WM_menu_invoke;
611 ot->exec = grease_pencil_join_selection_exec;
613
614 ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
615
616 ot->prop = RNA_def_enum(
617 ot->srna,
618 "type",
619 active_layer_behavior,
620 int(ActiveLayerBehavior::JoinStrokes),
621 "Type",
622 "Defines how the operator will behave on the selection in the active layer");
623}
624
625} // namespace
626
628
629} // namespace ed::greasepencil
630
632{
633 using namespace blender::ed::greasepencil;
634
635 WM_operatortype_append(GREASE_PENCIL_OT_join_selection);
636}
637
638} // namespace blender
Low-level operations for grease pencil.
#define C
Definition RandGen.cpp:29
#define NC_GEOM
Definition WM_types.hh:406
#define ND_DATA
Definition WM_types.hh:552
#define BLI_assert(a)
#define ELEM(...)
constexpr const T & first() const
Definition BLI_span.hh:319
constexpr int64_t size() const
Definition BLI_span.hh:256
constexpr const T * end() const
Definition BLI_span.hh:228
constexpr const T * begin() const
Definition BLI_span.hh:224
static IndexMask from_union(const IndexMask &mask_a, const IndexMask &mask_b, LinearAllocator<> &memory)
constexpr IndexRange()=default
#define FLT_MAX
#define index(i)
#define attribute(slot)
#define T
void to_static_type(const CPPType &cpp_type, Fn &&fn)
auto attribute_filter_from_skip_ref(const Span< StringRef > skip)
void gather_attributes_to_groups(AttributeAccessor src_attributes, AttrDomain src_domain, AttrDomain dst_domain, const AttributeFilter &attribute_filter, OffsetIndices< int > dst_offsets, const IndexMask &src_selection, MutableAttributeAccessor dst_attributes)
void copy_attributes_group_to_group(AttributeAccessor src_attributes, AttrDomain src_domain, AttrDomain dst_domain, const AttributeFilter &attribute_filter, OffsetIndices< int > src_offsets, OffsetIndices< int > dst_offsets, const IndexMask &selection, MutableAttributeAccessor dst_attributes)
void fill_selection_false(GMutableSpan selection)
void fill_selection_true(GMutableSpan selection)
bke::GSpanAttributeWriter ensure_selection_attribute(bke::CurvesGeometry &curves, bke::AttrDomain selection_domain, bke::AttrType create_type, StringRef attribute_name)
IndexMask retrieve_editable_and_selected_strokes(Object &object, const bke::greasepencil::Drawing &drawing, int layer_index, IndexMaskMemory &memory)
bool editable_grease_pencil_poll(bContext *C)
IndexMask retrieve_editable_and_selected_points(Object &object, const bke::greasepencil::Drawing &drawing, int layer_index, IndexMaskMemory &memory)
Vector< MutableDrawingInfo > retrieve_editable_drawings(const Scene &scene, GreasePencil &grease_pencil)
T distance_squared(const VecBase< T, Size > &a, const VecBase< T, Size > &b)
void parallel_for(const IndexRange range, const int64_t grain_size, const Function &function, const TaskSizeHints &size_hints=detail::TaskSizeHints_Static(1))
Definition BLI_task.hh:69
BMesh Iterators.
void WM_operatortype_append(void(*opfunc)(wmOperatorType *))
wmOperatorStatus WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *)
__int64 int64_t
Definition BKE_text.h:90
int RNA_enum_get(PointerRNA *ptr, const char *name)
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 DEG_id_tag_update(ID *id, unsigned int flags)
void BKE_report(ReportList *reports, eReportType type, const char *message)
Definition report.cc:162
BMesh const char void * data
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
bke::AttrDomain ED_grease_pencil_selection_domain_get(const ToolSettings *tool_settings, const Object *object)
void ED_operatortypes_grease_pencil_join()
@ ID_RECALC_GEOMETRY
Definition DNA_ID.h:1074
Scene * CTX_data_scene(const bContext *C)
@ OPTYPE_REGISTER
Definition WM_types.hh:188
@ OPTYPE_UNDO
Definition WM_types.hh:190
VecBase< float, 3 > float3
Object * CTX_data_active_object(const bContext *C)