119 return 75.0f *
U.pixelsize;
161 bool changed =
false;
177 bool changed =
false;
241 wm_userdata->
data = esel;
261 bool changed =
false;
275 if (sel_op_result != -1) {
293 bool changed =
false;
307 if (sel_op_result != -1) {
325 bool changed =
false;
339 if (sel_op_result != -1) {
355 bool changed =
false;
365 for (
int index = 0; index < mesh->
verts_num; index++) {
366 if (!hide_vert[index]) {
367 const bool is_select = select_vert.
span[index];
370 if (sel_op_result != -1) {
371 select_vert.
span[index] = sel_op_result == 1;
386 bool changed =
false;
396 for (
int index = 0; index < mesh->
faces_num; index++) {
397 if (!hide_poly[index]) {
398 const bool is_select = select_poly.
span[index];
401 if (sel_op_result != -1) {
402 select_poly.
span[index] = sel_op_result == 1;
491 if (v1[0] < rect->
xmin &&
v2[0] < rect->
xmin) {
494 if (v1[0] > rect->
xmax &&
v2[0] > rect->
xmax) {
497 if (v1[1] < rect->
ymin &&
v2[1] < rect->
ymin) {
500 if (v1[1] > rect->
ymax &&
v2[1] > rect->
ymax) {
505 d1 = (v1[1] -
v2[1]) * (v1[0] - rect->
xmin) + (
v2[0] - v1[0]) * (v1[1] - rect->
ymin);
506 d2 = (v1[1] -
v2[1]) * (v1[0] - rect->
xmin) + (
v2[0] - v1[0]) * (v1[1] - rect->
ymax);
507 d3 = (v1[1] -
v2[1]) * (v1[0] - rect->
xmax) + (
v2[0] - v1[0]) * (v1[1] - rect->
ymax);
508 d4 = (v1[1] -
v2[1]) * (v1[0] - rect->
xmax) + (
v2[0] - v1[0]) * (v1[1] - rect->
ymin);
510 if (d1 < 0 && d2 < 0 && d3 < 0 && d4 < 0) {
513 if (d1 > 0 && d2 > 0 && d3 > 0 && d4 > 0) {
522 const float screen_co_a[2],
523 const float screen_co_b[2])
535 data->is_changed =
true;
566 bool changed =
false;
583 if (sel_op_result != -1) {
605 Object *ob = base->object;
608 Bone *bone = pchan->bone;
624 bases_tag_and_append_fn(bases, base);
631 bases_tag_and_append_fn(bases, base_iter);
640 bool changed_multi =
false;
644 Base *base_iter = bases[
i];
648 changed_multi =
true;
654 Base *base_iter = bases[
i];
668 Bone *bone = pchan->bone;
673 if (sel_op_result != -1) {
675 if (sel_op_result == 0) {
686 changed_multi =
true;
689 return changed_multi;
701 Base *base_iter = bases[
i];
713 return changed_multi;
718 const float screen_co[2],
727 if (sel_op_result != -1) {
729 data->is_changed =
true;
739 const float screen_co_a[2],
740 const float screen_co_b[2],
746 bool is_visible =
true;
758 if (sel_op_result != -1) {
760 data->is_done =
true;
761 data->is_changed =
true;
766 const float screen_co_a[2],
767 const float screen_co_b[2],
773 bool is_visible =
true;
785 if (sel_op_result != -1) {
787 data->is_changed =
true;
793 const float screen_co[2],
802 if (sel_op_result != -1) {
804 data->is_changed =
true;
826 data.is_changed =
true;
839 if (wm_userdata->
data ==
nullptr) {
861 data_for_edge.
esel = use_zbuf ? esel :
nullptr;
871 if (
data.is_done ==
false) {
892 if (
data.is_changed) {
895 return data.is_changed;
904 const float screen_co[2])
911 const bool is_select = bp->
f1 &
SELECT;
913 if (sel_op_result != -1) {
915 data->is_changed =
true;
921 const bool is_select = bezt->
f2 &
SELECT;
923 if (sel_op_result != -1) {
926 bezt->
f1 = bezt->
f3 = bezt->
f2;
927 data->is_changed =
true;
930 uint8_t *flag_p = (&bezt->
f1) + beztindex;
931 const bool is_select = *flag_p &
SELECT;
933 if (sel_op_result != -1) {
935 data->is_changed =
true;
945 const bool deselect_all = (sel_op ==
SEL_OP_SET);
970 if (
data.is_changed) {
973 return data.is_changed;
978 const float screen_co[2])
981 const bool is_select = bp->
f1 &
SELECT;
986 if (sel_op_result != -1) {
988 data->is_changed =
true;
1009 return data.is_changed;
1014 const float screen_co_a[2],
1015 const float screen_co_b[2])
1023 int is_ignore_flag = 0;
1024 int is_inside_flag = 0;
1048 if (is_ignore_flag == 0) {
1057 ebone->
temp.
i = is_inside_flag | (is_ignore_flag >> 16);
1061 const float screen_co_a[2],
1062 const float screen_co_b[2])
1070 const int is_ignore_flag = ebone->
temp.
i << 16;
1071 int is_inside_flag = ebone->
temp.
i & ~0xFFFF;
1085 ebone->
temp.
i = is_inside_flag | (is_ignore_flag >> 16);
1123 if (
data.is_changed) {
1126 return data.is_changed;
1131 const float screen_co[2])
1137 data->mcoords, screen_co[0], screen_co[1], INT_MAX));
1139 if (sel_op_result != -1) {
1141 data->is_changed =
true;
1166 return data.is_changed;
1191 ob_eval, *
object, info.
drawing);
1192 const IndexMask visible_handle_elements =
1204 visible_handle_elements,
1217 const float screen_co[2],
1224 const bool is_select = mesh_data->
select_vert[index];
1229 if (sel_op_result != -1) {
1230 mesh_data->
select_vert[index] = sel_op_result == 1;
1231 data->is_changed =
true;
1245 if (mesh ==
nullptr || mesh->
verts_num == 0) {
1249 bool changed =
false;
1259 if (wm_userdata->
data ==
nullptr) {
1278 data.select_vert = select_vert.
span;
1287 changed |=
data.lasso_data.is_changed;
1310 if (mesh ==
nullptr || mesh->
faces_num == 0) {
1314 bool changed =
false;
1323 if (esel ==
nullptr) {
1347 bool changed_multi =
false;
1352 if (vc->
obedit ==
nullptr) {
1364 reinterpret_cast<const int(*)[2]
>(mcoords.
data()),
1373 if (changed_multi) {
1384 if (changed_multi) {
1397 bool changed =
false;
1448 pointcloud, *vc->
region, projection, mcoords, sel_op);
1469 changed_multi =
true;
1477 return changed_multi;
1499 if (changed_multi) {
1507 ot->name =
"Lasso Select";
1508 ot->description =
"Select items using lasso selection";
1509 ot->idname =
"VIEW3D_OT_select_lasso";
1539#define SEL_MENU_SIZE 22
1577 bool changed =
false;
1586 Base *basact =
nullptr;
1590 if (
STREQ(name, base->object->id.name + 2)) {
1597 if (basact ==
nullptr) {
1607 else if (deselect) {
1613 if (basact == oldbasact) {
1629 if (oldbasact != basact) {
1665 ot->name =
"Select Menu";
1666 ot->description =
"Menu object selection";
1667 ot->idname =
"VIEW3D_OT_select_menu";
1702 const float mval_fl[2] = {float(mval[0]), float(mval[1])};
1704 const float dist_threshold_sq =
square_f(15 *
U.pixelsize);
1707 struct BaseRefWithDepth {
1708 BaseRefWithDepth *
next, *prev;
1713 ListBase base_ref_list = {
nullptr,
nullptr};
1724 if (base->object->runtime->select_id == (hit_result.id & ~0xFFFF0000)) {
1726 depth_id = hit_result.depth;
1735 if (dist_test_sq < dist_threshold_sq) {
1746 base_ref->base = base;
1747 base_ref->depth_id = depth_id;
1753 *r_basact =
nullptr;
1755 if (base_count == 0) {
1758 if (base_count == 1) {
1759 Base *base = ((BaseRefWithDepth *)base_ref_list.
first)->base;
1767 return int(
static_cast<const BaseRefWithDepth *
>(a)->depth_id >
1768 static_cast<const BaseRefWithDepth *
>(
b)->depth_id);
1782 Base *base = base_ref->base;
1784 const char *name = ob->
id.
name + 2;
1819 if (basact ==
nullptr) {
1858 if (oldbasact != basact) {
1879 ot->name =
"Select Menu";
1880 ot->description =
"Menu bone selection";
1881 ot->idname =
"VIEW3D_OT_bone_select_menu";
1909 const bool is_editmode,
1914 struct BoneRefWithDepth {
1915 BoneRefWithDepth *
next, *prev;
1925 ListBase bone_ref_list = {
nullptr,
nullptr};
1932 void *bone_ptr =
nullptr;
1933 Base *bone_base =
nullptr;
1934 uint select_id = hit_result.id;
1942 const uint hit_object = select_id & 0xFFFF;
1946 if (base->object->runtime->select_id == hit_object) {
1980 const bool is_duplicate_bone =
BLI_gset_haskey(added_bones, bone_ptr);
1982 if (!is_duplicate_bone) {
1985 bone_ref->base = bone_base;
1986 bone_ref->bone_ptr = bone_ptr;
1987 bone_ref->depth_id = hit_result.depth;
1996 if (bone_count == 0) {
1999 if (bone_count == 1) {
2006 return int(
static_cast<const BoneRefWithDepth *
>(a)->depth_id >
2007 static_cast<const BoneRefWithDepth *
>(
b)->depth_id);
2056 if (hit_result.id & 0xFFFF0000) {
2074 const int ofs = hits15;
2085 const int ofs = hits15 + hits9;
2104 bool do_nearest_xray,
2105 const bool do_material_slot_selection)
2108 int hits15, hits9 = 0, hits5 = 0;
2109 bool has_bones15 =
false, has_bones9 =
false, has_bones5 =
false;
2114 if (do_nearest_xray) {
2124 vc, buffer, &rect, select_mode, select_filter, do_material_slot_selection);
2129 else if (hits15 > 0) {
2140 else if (hits9 > 0) {
2150 else if (hits5 > 0) {
2159 else if (has_bones9) {
2163 else if (has_bones15) {
2172 else if (hits9 > 0) {
2195 bool do_nearest =
false;
2203 do_nearest = has_motion;
2213 *r_do_nearest = do_nearest;
2216 do_nearest = do_nearest && !enumerate;
2219 vc, buffer, mval, select_filter, do_nearest,
true,
false);
2233 if (a->
depth <
b->depth) {
2236 if (a->
depth >
b->depth) {
2244#ifdef __BIG_ENDIAN__
2249 if (sel_a < sel_b) {
2252 if (sel_a > sel_b) {
2270 bool do_bones_get_priotity,
2271 int *r_select_id_subelem)
2280 int select_id_subelem = 0;
2286 if (has_bones && do_bones_get_priotity) {
2288 for (a = 0; a < hits; a++) {
2297 for (a = 0; a < hits; a++) {
2306 if (hit_index != -1) {
2307 select_id = buffer.
storage[hit_index].id & 0xFFFF;
2308 select_id_subelem = (buffer.
storage[hit_index].id & 0xFFFF0000) >> 16;
2317 buffer_sorted.
resize(hits);
2319 if (has_bones && do_bones_get_priotity) {
2321 for (a = hits - 1; a >= 0; a--) {
2322 if ((buffer_sorted[a].
id & 0xFFFF0000) == 0) {
2323 buffer_sorted[a] = buffer_sorted[--hits];
2338 const int select_id_active = base->
object->
runtime->select_id;
2339 for (
int i_next = 0, i_prev = hits - 1; i_next < hits; i_prev = i_next++) {
2340 if ((select_id_active == (buffer_sorted[i_prev].
id & 0xFFFF)) &&
2341 (select_id_active != (buffer_sorted[i_next].
id & 0xFFFF)))
2350 if (hit_index == -1) {
2356 if (hit_index != -1) {
2357 select_id = buffer_sorted[hit_index].id & 0xFFFF;
2358 select_id_subelem = (buffer_sorted[hit_index].id & 0xFFFF0000) >> 16;
2363 Base *basact =
nullptr;
2368 if (base->object->runtime->select_id == select_id) {
2375 if (basact && r_select_id_subelem) {
2376 *r_select_id_subelem = select_id_subelem;
2393 const float mval_fl[2] = {float(mval[0]), float(mval[1])};
2395 Base *basact =
nullptr;
2399 Base *base = startbase;
2404 base->
object->object_to_world().location(),
2409 if (base == oldbasact) {
2410 dist_test += penalty_dist;
2412 if (dist_test < dist) {
2420 if (base ==
nullptr) {
2423 if (base == startbase) {
2432 int *r_material_slot)
2435 Base *basact =
nullptr;
2445 const bool do_material_slot_selection = r_material_slot !=
nullptr;
2450 const bool has_bones = (r_material_slot ==
nullptr) &&
2453 &vc, buffer, hits, do_nearest, has_bones,
true, r_material_slot);
2475 int *r_material_slot)
2506 bool changed =
false;
2513 for (
int i = 0;
i < hits;
i++) {
2514 const int select_id = buffer.
storage[
i].id;
2518 if (basact->
object->
runtime->select_id != (select_id & 0xFFFF)) {
2523 if ((select_id & 0xFFFF0000) == 0) {
2528 &clip->
tracking, select_id >> 16, &tracksbase);
2583 return changed || found;
2602 const bool enumerate,
2603 const bool object_only)
2613 Base *basact_override =
nullptr;
2615 const bool is_obedit = (vc.
obedit !=
nullptr);
2635 if (center ==
false) {
2636 gpu = MEM_new<GPUData>(__func__);
2637 gpu->do_nearest =
false;
2638 gpu->has_bones =
false;
2646 &vc, &
gpu->buffer, mval, select_filter,
true, enumerate, &
gpu->do_nearest);
2647 gpu->has_bones = (object_only &&
gpu->hits > 0) ?
2655 bool has_menu =
false;
2662 if (
gpu->hits != 0) {
2676 if (
gpu !=
nullptr) {
2690 Base *startbase = (oldbasact && oldbasact->
next) ?
2695 Base *basact =
nullptr;
2702 const bool has_pose_old = (oldbasact &&
2706 bool handled =
false;
2711 bool changed_object =
false;
2712 bool changed_pose =
false;
2713 bool changed_track =
false;
2716 bool use_activate_selected_base =
false;
2719 if (basact_override) {
2720 basact = basact_override;
2727 if (basact_override) {
2728 basact = basact_override;
2742 bool do_bones_get_priotity = has_pose_old;
2749 do_bones_get_priotity,
2755 const bool has_pose_new = (basact &&
2759 if (((
gpu->hits > 0) &&
gpu->has_bones) ||
2761 ((
gpu->hits == 0) && has_pose_old))
2769 if (clip !=
nullptr) {
2775 changed_object =
true;
2777 changed_track =
true;
2783 &vc,
gpu->buffer,
gpu->hits,
gpu->do_nearest,
false,
false,
nullptr);
2787 else if ((basact || oldbasact) &&
2791 basact ? basact : (
Base *)oldbasact,
2792 gpu->buffer.storage.data(),
2798 changed_pose =
true;
2803 if (basact ==
nullptr) {
2811 changed_object =
true;
2828 else if (has_pose_old && has_pose_new) {
2836 if (oldbasact != basact) {
2837 use_activate_selected_base =
true;
2849 if (basact == oldbasact) {
2855 bool changed_object_mode =
false;
2857 if (handled ==
false) {
2860 if (is_obedit ==
false) {
2873 if (basact && oldbasact) {
2885 changed_object_mode =
true;
2889 changed_object_mode =
true;
2901 else if (basact && vc.
obedit) {
2907 changed_object =
true;
2926 const bool select_passthrough =
params.select_passthrough && (changed_object_mode ==
false);
2933 else if (found ||
params.deselect_all) {
2937 changed_object =
true;
2943 use_activate_selected_base |= (oldbasact != basact) && (is_obedit ==
false);
2957 if (use_activate_selected_base ==
false) {
2977 changed_object =
true;
2983 if (use_activate_selected_base && (basact !=
nullptr)) {
2984 changed_object =
true;
2991 if (changed_object) {
3002 if (
gpu !=
nullptr) {
3006 return (changed_object || changed_pose || changed_track);
3026 bool changed =
false;
3035 if ((found &&
params.select_passthrough) && select_vert.
varray[index]) {
3038 else if (found ||
params.deselect_all) {
3047 select_vert.
varray.set(index,
true);
3051 select_vert.
varray.set(index,
false);
3055 select_vert.
varray.set(index, !select_vert.
varray[index]);
3060 select_vert.
varray.set(index,
true);
3070 if (select_vert.
varray[index]) {
3091 return changed || found;
3122 Object &
object = *base->object;
3126 std::optional<pointcloud::FindClosestData> new_closest_elem =
3134 if (new_closest_elem) {
3135 new_closest.
elem = *new_closest_elem;
3145 std::atomic<bool> deselected =
false;
3148 for (Base *base : bases.as_span().slice(range)) {
3149 PointCloud &pointcloud = *static_cast<PointCloud *>(base->object->data);
3150 if (!pointcloud::has_anything_selected(pointcloud)) {
3154 bke::GSpanAttributeWriter selection = pointcloud::ensure_selection_attribute(pointcloud,
3156 pointcloud::fill_selection_false(selection.span, IndexMask(pointcloud.totpoint));
3162 DEG_id_tag_update(&pointcloud.id, ID_RECALC_GEOMETRY);
3163 WM_event_add_notifier(&C, NC_GEOM | ND_DATA, &pointcloud);
3216 Object &curves_ob = *base->object;
3222 const IndexMask elements(
curves.attributes().domain_size(selection_domain));
3223 const auto range_consumer =
3227 std::optional<ed::curves::FindClosestData> new_closest_elem =
3229 curves.points_by_curve(),
3237 if (new_closest_elem) {
3239 new_closest.
elem = *new_closest_elem;
3265 std::atomic<bool> deselected =
false;
3268 for (Base *base : bases.as_span().slice(range)) {
3269 Curves &curves_id = *static_cast<Curves *>(base->object->data);
3270 bke::CurvesGeometry &curves = curves_id.geometry.wrap();
3271 if (!ed::curves::has_anything_selected(curves, selection_domain)) {
3275 ed::curves::foreach_selection_attribute_writer(
3276 curves, selection_domain, [](bke::GSpanAttributeWriter &selection) {
3277 ed::curves::fill_selection_false(selection.span);
3283 DEG_id_tag_update(&curves_id.id, ID_RECALC_GEOMETRY);
3284 WM_event_add_notifier(&C, NC_GEOM | ND_DATA, &curves_id);
3295 closest.curves_id->geometry.wrap(),
3298 closest.selection_attribute_name);
3305 closest.curves_id->geometry.wrap(),
3308 ed::curves::apply_selection_operation_at_index(
3309 selection.span, closest.elem.index, params.sel_op);
3359 for (
const int i : range) {
3365 ob_eval, *
object, info.
drawing);
3369 *
object, info, selection_domain, memory);
3373 const IndexMask visible_handle_elements =
3380 const auto range_consumer = [&](
const IndexRange range,
3382 const StringRef selection_attribute_name) {
3383 const IndexMask mask = ((selection_attribute_name ==
".selection") ?
3385 visible_handle_elements)
3386 .slice_content(range);
3388 std::optional<ed::curves::FindClosestData> new_closest_elem =
3390 curves.points_by_curve(),
3398 if (new_closest_elem) {
3400 new_closest.
elem = *new_closest_elem;
3427 std::atomic<bool> deselected =
false;
3430 for (const int i : range) {
3431 ed::greasepencil::MutableDrawingInfo info = drawings[i];
3432 IndexMaskMemory memory;
3433 const IndexMask elements = ed::greasepencil::retrieve_editable_elements(
3434 *object, info, selection_domain, memory);
3435 if (elements.is_empty()) {
3438 bke::CurvesGeometry &curves = info.drawing.strokes_for_write();
3439 if (!ed::curves::has_anything_selected(curves, selection_domain, elements)) {
3443 ed::curves::foreach_selection_attribute_writer(
3444 curves, selection_domain, [](bke::GSpanAttributeWriter &selection) {
3445 ed::curves::fill_selection_false(selection.span);
3473 if (&info.drawing == closest.drawing &&
3474 attribute_name == closest.selection_attribute_name) {
3475 return selection_mask;
3512 bool changed =
false;
3525 if (obedit && enumerate) {
3539 if (obedit && object_only ==
false) {
3619 ot->name =
"Select";
3620 ot->description =
"Select and activate item(s)";
3621 ot->idname =
"VIEW3D_OT_select";
3640 "Use the object center when selecting, in edit mode used to extend object selection");
3646 "List objects under the mouse (object mode only)");
3649 ot->srna,
"object",
false,
"Object",
"Use object selection (edit mode only)");
3691 r_data->
rect = rect;
3706 const float screen_co_a[2],
3707 const float screen_co_b[2])
3709 const float radius_squared = radius * radius;
3718 const float screen_co[2],
3724 const bool is_select = mesh_data->
select_vert[index];
3727 if (sel_op_result != -1) {
3728 mesh_data->
select_vert[index] = sel_op_result == 1;
3729 data->is_changed =
true;
3741 if ((
mesh ==
nullptr) || (
mesh->verts_num == 0)) {
3745 bool changed =
false;
3753 else if (use_zbuf) {
3755 if (wm_userdata->
data ==
nullptr) {
3771 data.select_vert = select_vert.
span;
3779 changed |=
data.box_data.is_changed;
3802 if ((
mesh ==
nullptr) || (
mesh->faces_num == 0)) {
3806 bool changed =
false;
3816 if (wm_userdata->
data ==
nullptr) {
3839 const float screen_co[2])
3845 const bool is_select = bp->
f1 &
SELECT;
3847 if (sel_op_result != -1) {
3849 data->is_changed =
true;
3855 const bool is_select = bezt->
f2 &
SELECT;
3857 if (sel_op_result != -1) {
3859 data->is_changed =
true;
3861 bezt->
f1 = bezt->
f3 = bezt->
f2;
3864 uint8_t *flag_p = (&bezt->
f1) + beztindex;
3865 const bool is_select = *flag_p &
SELECT;
3867 if (sel_op_result != -1) {
3869 data->is_changed =
true;
3876 const bool deselect_all = (sel_op ==
SEL_OP_SET);
3900 return data.is_changed;
3906 const bool is_select = bp->
f1 &
SELECT;
3909 if (sel_op_result != -1) {
3911 data->is_changed =
true;
3928 return data.is_changed;
3933 const float screen_co[2],
3940 if (sel_op_result != -1) {
3942 data->is_changed =
true;
3955 const float screen_co_a[2],
3956 const float screen_co_b[2],
3962 bool is_visible =
true;
3972 if (sel_op_result != -1) {
3974 data->is_done =
true;
3975 data->is_changed =
true;
3983 const float screen_co_a[2],
3984 const float screen_co_b[2],
3990 bool is_visible =
true;
3999 if (sel_op_result != -1) {
4001 data->is_changed =
true;
4006 const float screen_co[2],
4013 if (sel_op_result != -1) {
4015 data->is_changed =
true;
4031 data.is_changed =
true;
4044 if (wm_userdata->
data ==
nullptr) {
4066 cb_data.
esel = use_zbuf ? esel :
nullptr;
4076 if (
data.is_done ==
false) {
4097 if (
data.is_changed) {
4100 return data.is_changed;
4109 bool changed =
false;
4120 int metaelem_id = 0;
4122 ml = ml->
next, metaelem_id += 0x10000)
4124 bool is_inside_radius =
false;
4125 bool is_inside_stiff =
false;
4127 for (a = 0; a < hits; a++) {
4128 const int select_id = buffer.
storage[a].id;
4130 if (select_id == -1) {
4134 const uint hit_object = select_id & 0xFFFF;
4139 if (metaelem_id != (select_id & 0xFFFF0000 & ~
MBALLSEL_ANY)) {
4144 is_inside_radius =
true;
4149 is_inside_stiff =
true;
4153 const int flag_prev = ml->
flag;
4154 if (is_inside_radius) {
4157 if (is_inside_stiff) {
4162 const bool is_inside = is_inside_radius || is_inside_stiff;
4165 if (sel_op_result != -1) {
4168 changed |= (flag_prev != ml->
flag);
4176 bool changed =
false;
4191 for (
Base *base : bases) {
4192 Object *obedit = base->object;
4200 for (a = 0; a < hits; a++) {
4201 const int select_id = buffer.
storage[a].id;
4202 if (select_id != -1) {
4203 if ((select_id & 0xFFFF0000) == 0) {
4214 for (
Base *base : bases) {
4215 Object *obedit = base->object;
4235#ifdef __BIG_ENDIAN__
4240 if (sel_a < sel_b) {
4243 if (sel_a > sel_b) {
4271 bool changed =
false;
4287 const uint32_t select_id = base->object->runtime->select_id;
4288 if ((select_id & 0x0000FFFF) != 0) {
4289 const uint hit_object = select_id & 0xFFFF;
4290 base_by_object_select_id.
add(hit_object, base);
4303 const uint32_t select_id = buf_iter->id;
4304 const uint32_t hit_object = select_id & 0xFFFF;
4306 bases_inside.
add(base);
4310 for (
Base *base =
static_cast<Base *
>(object_bases->
first); base && hits; base = base->
next) {
4315 if (sel_op_result != -1) {
4363 if (base ==
nullptr) {
4368 for (; buf_iter != buf_end; buf_iter++) {
4370 if (bone !=
nullptr) {
4376 if (buf_iter + 1 != buf_end) {
4378 if ((base->
object->
runtime->select_id & 0x0000FFFF) != (col_next->
id & 0x0000FFFF)) {
4385 bone = pchan ? pchan->
bone :
nullptr;
4396 if (changed_multi) {
4401 return changed_multi;
4426 ob_eval, *
object, info.
drawing);
4427 const IndexMask visible_handle_elements =
4439 visible_handle_elements,
4452 bool changed_multi =
false;
4471 bool changed =
false;
4519 const IndexRange elements(
curves.attributes().domain_size(selection_domain));
4557 changed_multi |= changed;
4579 if (changed_multi) {
4585 if (changed_multi) {
4593 if (changed_multi) {
4602 ot->name =
"Box Select";
4603 ot->description =
"Select items using box selection";
4604 ot->idname =
"VIEW3D_OT_select_box";
4664 const float screen_co[2],
4671 data->is_changed =
true;
4676 const float screen_co_a[2],
4677 const float screen_co_b[2],
4684 data->is_changed =
true;
4689 const float screen_co[2],
4696 data->is_changed =
true;
4710 bool changed =
false;
4729 if (wm_userdata->
data ==
nullptr) {
4782 changed |=
data.is_changed;
4801 bool changed =
false;
4807 if (wm_userdata->
data ==
nullptr) {
4833 const float screen_co[2],
4842 data->is_changed =
true;
4858 bool changed =
false;
4867 if (wm_userdata->
data ==
nullptr) {
4888 data.select_vert = select_vert.
span;
4895 changed |=
data.circle_data.is_changed;
4915 const float screen_co[2])
4924 if (beztindex == 0) {
4927 else if (beztindex == 1) {
4934 data->is_changed =
true;
4943 const bool deselect_all = (sel_op ==
SEL_OP_SET);
4967 return data.is_changed;
4976 data->is_changed =
true;
4996 return data.is_changed;
5004 const float screen_co[2])
5021 const float screen_co_a[2],
5022 const float screen_co_b[2])
5030 bool is_point_done =
false;
5031 int points_proj_tot = 0;
5037 is_point_done =
true;
5045 is_point_done =
true;
5056 if ((is_point_done ==
false) && (points_proj_tot == 2) &&
5065 data->is_changed =
true;
5068 data->is_changed |= is_point_done;
5093 if (
data.is_changed) {
5096 return data.is_changed;
5104 const float screen_co[2],
5132 const float screen_co_a[2],
5133 const float screen_co_b[2])
5144 ebone->
temp.
i =
false;
5146 bool is_point_done =
false;
5147 bool is_edge_done =
false;
5148 int points_proj_tot = 0;
5154 is_point_done =
true;
5162 is_point_done =
true;
5173 if ((is_point_done ==
false) && (points_proj_tot == 2) &&
5177 is_edge_done =
true;
5178 data->is_changed =
true;
5181 if (is_point_done || is_edge_done) {
5182 ebone->
temp.
i =
true;
5185 data->is_changed |= is_point_done;
5189 const float screen_co_a[2],
5190 const float screen_co_b[2])
5202 if (ebone->
temp.
i != 0) {
5208 data->is_changed =
true;
5241 if (
data.is_changed) {
5245 return data.is_changed;
5250 const float screen_co[2])
5261 data->is_changed =
true;
5283 return data.is_changed;
5309 ob_eval, *
object, info.
drawing);
5310 const IndexMask visible_handle_elements =
5322 visible_handle_elements,
5342 bool changed =
false;
5371 const IndexRange elements(
curves.attributes().domain_size(selection_domain));
5429 const float radius_squared = rad * rad;
5430 const float mval_fl[2] = {float(mval[0]), float(mval[1])};
5432 bool changed =
false;
5443 base->object->object_to_world().location(),
5465 if (obedit_active) {
5466 switch (obedit_active->
type) {
5527 if (obedit ==
nullptr) {
5593 if (wm_userdata == &wm_userdata_buf) {
5609 ot->name =
"Circle Select";
5610 ot->description =
"Select items using circle selection";
5611 ot->idname =
"VIEW3D_OT_select_circle";
Functions to deal with Armatures.
C++ functions to deal with Armature collections (i.e. the successor of bone layers).
Blender kernel action and pose functionality.
#define PBONE_SELECTABLE(arm, bone)
#define CTX_DATA_BEGIN(C, Type, instance, member)
Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
wmWindow * CTX_wm_window(const bContext *C)
Object * CTX_data_active_object(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
Object * CTX_data_edit_object(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)
View3D * CTX_wm_view3d(const bContext *C)
ViewLayer * CTX_data_view_layer(const bContext *C)
bool BKE_nurbList_flag_set_from_flag(ListBase *editnurb, uint8_t from_flag, uint8_t flag)
ListBase * BKE_curve_editNurbs_get(Curve *cu)
void BKE_curve_nurb_vert_active_validate(Curve *cu)
void BKE_nurbList_flag_set(ListBase *editnurb, uint8_t flag, bool set)
Low-level operations for curves.
BMEditMesh * BKE_editmesh_from_object(Object *ob)
Return the BMEditMesh for a given object.
Low-level operations for grease pencil.
#define FOREACH_BASE_IN_MODE_END
void BKE_view_layer_synced_ensure(const Scene *scene, ViewLayer *view_layer)
blender::Vector< Base * > BKE_view_layer_array_from_bases_in_edit_mode(const Scene *scene, ViewLayer *view_layer, const View3D *v3d)
Base * BKE_view_layer_active_base_get(ViewLayer *view_layer)
#define FOREACH_BASE_IN_MODE_BEGIN(_scene, _view_layer, _v3d, _object_type, _object_mode, _instance)
#define FOREACH_OBJECT_IN_MODE_END
#define FOREACH_OBJECT_IN_MODE_BEGIN(_scene, _view_layer, _v3d, _object_type, _object_mode, _instance)
Base * BKE_view_layer_base_find(ViewLayer *view_layer, Object *ob)
blender::Vector< Base * > BKE_view_layer_array_from_bases_in_edit_mode_unique_data(const Scene *scene, ViewLayer *view_layer, const View3D *v3d)
ListBase * BKE_view_layer_object_bases_get(ViewLayer *view_layer)
bool BKE_mball_deselect_all(MetaBall *mb)
void BKE_mesh_mselect_active_set(Mesh *mesh, int index, int type)
void BKE_mesh_mselect_validate(Mesh *mesh)
Mesh * BKE_mesh_from_object(Object *ob)
General operations, lookup, etc. for blender objects.
MovieClip * BKE_object_movieclip_get(Scene *scene, const Object *ob, bool use_default)
bool BKE_object_is_in_editmode(const Object *ob)
void BKE_object_update_select_id(Main *bmain)
Object * BKE_object_pose_armature_get(Object *ob)
Object * BKE_object_pose_armature_get_with_wpaint_check(Object *ob)
bool BKE_object_is_mode_compat(const Object *ob, eObjectMode object_mode)
bool BKE_paint_select_grease_pencil_test(const Object *ob)
bool BKE_paint_select_elem_test(const Object *ob)
bool BKE_paint_select_vert_test(const Object *ob)
bool BKE_paint_select_face_test(const Object *ob)
struct MovieTrackingTrack * BKE_tracking_track_get_for_selection_index(struct MovieTracking *tracking, int selection_index, struct ListBase **r_tracksbase)
void BKE_tracking_track_deselect(struct MovieTrackingTrack *track, int area)
#define TRACK_SELECTED(track)
void BKE_tracking_track_select(struct ListBase *tracksbase, struct MovieTrackingTrack *track, int area, bool extend)
#define BLI_assert_unreachable()
#define BLI_assert_msg(a, msg)
#define BLI_BITMAP_TEST_BOOL(_bitmap, _index)
BLI_INLINE void BLI_endian_switch_uint32(unsigned int *val) ATTR_NONNULL(1)
GSet * BLI_gset_ptr_new(const char *info)
bool BLI_gset_haskey(const GSet *gs, const void *key) ATTR_WARN_UNUSED_RESULT
void BLI_gset_insert(GSet *gs, void *key)
void BLI_gset_free(GSet *gs, GSetKeyFreeFP keyfreefp)
bool BLI_lasso_is_point_inside(blender::Span< blender::int2 > mcoords, int sx, int sy, int error_value)
void BLI_lasso_boundbox(rcti *rect, blender::Span< blender::int2 > mcoords)
bool BLI_lasso_is_edge_inside(blender::Span< blender::int2 > mcoords, int x0, int y0, int x1, int y1, int error_value)
void * BLI_findlink(const ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
void BLI_freelinkN(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void void BLI_freelistN(ListBase *listbase) ATTR_NONNULL(1)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
#define LISTBASE_FOREACH_INDEX(type, var, list, index_var)
void void BLI_listbase_sort(ListBase *listbase, int(*cmp)(const void *, const void *)) ATTR_NONNULL(1
MINLINE float square_f(float a)
MINLINE unsigned int float_as_uint(float f)
float dist_squared_to_line_segment_v2(const float p[2], const float l1[2], const float l2[2])
MINLINE float len_squared_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void copy_v2_v2_int(int r[2], const int a[2])
MINLINE float len_manhattan_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
bool BLI_rctf_isect_pt_v(const struct rctf *rect, const float xy[2])
void BLI_rcti_init_pt_radius(struct rcti *rect, const int xy[2], int size)
bool BLI_rcti_isect_pt(const struct rcti *rect, int x, int y)
bool BLI_rctf_isect_segment(const struct rctf *rect, const float s1[2], const float s2[2])
void BLI_rctf_rcti_copy(struct rctf *dst, const struct rcti *src)
bool BLI_rcti_is_empty(const struct rcti *rect)
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
#define UNUSED_VARS_NDEBUG(...)
#define SET_FLAG_FROM_TEST(value, test, flag)
#define CTX_IFACE_(context, msgid)
#define BLT_I18NCONTEXT_OPERATOR_DEFAULT
void DEG_id_tag_update(ID *id, unsigned int flags)
T * DEG_get_evaluated(const Depsgraph *depsgraph, T *id)
#define OB_MODE_ALL_WEIGHT_PAINT
@ OB_MODE_SCULPT_GREASE_PENCIL
Object is a sort of wrapper for general info.
#define BASE_SELECTED(v3d, base)
#define BASE_SELECTABLE(v3d, base)
#define BASE_VISIBLE(v3d, base)
uint * DRW_select_buffer_bitmap_from_rect(Depsgraph *depsgraph, ARegion *region, View3D *v3d, const rcti *rect, uint *r_bitmap_len)
uint * DRW_select_buffer_bitmap_from_circle(Depsgraph *depsgraph, ARegion *region, View3D *v3d, const int center[2], int radius, uint *r_bitmap_len)
void DRW_select_buffer_context_create(Depsgraph *depsgraph, blender::Span< Base * > bases, short select_mode)
uint DRW_select_buffer_context_offset_for_object_elem(Depsgraph *depsgraph, Object *object, char elem_type)
uint * DRW_select_buffer_bitmap_from_poly(Depsgraph *depsgraph, ARegion *region, View3D *v3d, blender::Span< blender::int2 > poly, const rcti *rect, uint *r_bitmap_len)
#define EBONE_SELECTABLE(arm, ebone)
bool ED_lattice_select_pick(bContext *C, const int mval[2], const SelectPick_Params ¶ms)
bool ED_lattice_flags_set(Object *obedit, int flag)
bool ED_mball_select_pick(bContext *C, const int mval[2], const SelectPick_Params ¶ms)
void EDBM_flag_disable_all(BMEditMesh *em, char hflag)
#define ED_MESH_PICK_DEFAULT_VERT_DIST
void paintvert_flush_flags(Object *ob)
void paintvert_tag_select_update(bContext *C, Object *ob)
ViewContext em_setup_viewcontext(bContext *C)
void EDBM_selectmode_flush(BMEditMesh *em)
void paintface_flush_flags(bContext *C, Object *ob, bool flush_selection, bool flush_hidden)
bool paintface_mouse_select(bContext *C, const int mval[2], const SelectPick_Params ¶ms, Object *ob)
bool paintvert_deselect_all_visible(Object *ob, int action, bool flush_flags)
bool paintface_deselect_all_visible(bContext *C, Object *ob, int action, bool flush_flags)
bool ED_mesh_pick_vert(bContext *C, Object *ob, const int mval[2], uint dist_px, bool use_zbuf, uint *r_index)
bool EDBM_select_pick(bContext *C, const int mval[2], const SelectPick_Params ¶ms)
void ED_outliner_select_sync_from_object_tag(bContext *C)
void ED_outliner_select_sync_from_edit_bone_tag(bContext *C)
void ED_outliner_select_sync_from_pose_bone_tag(bContext *C)
bool PE_circle_select(bContext *C, wmGenericUserData *wm_userdata, int sel_op, const int mval[2], float rad)
bool PE_box_select(bContext *C, const rcti *rect, int sel_op)
bool PE_mouse_particles(bContext *C, const int mval[2], const SelectPick_Params ¶ms)
int PE_lasso_select(bContext *C, const int mcoords[][2], int mcoords_len, int sel_op)
bool ED_operator_view3d_active(bContext *C)
bool ED_operator_region_view3d_active(bContext *C)
int ED_select_op_action_deselected(eSelectOp sel_op, bool is_select, bool is_inside)
eSelectOp ED_select_op_modal(eSelectOp sel_op, bool is_first)
eSelectOp ED_select_op_from_operator(PointerRNA *ptr) ATTR_WARN_UNUSED_RESULT
#define SEL_OP_USE_PRE_DESELECT(sel_op)
std::string ED_select_circle_get_name(wmOperatorType *ot, PointerRNA *ptr)
#define SEL_OP_CAN_DESELECT(sel_op)
SelectPick_Params ED_select_pick_params_from_operator(PointerRNA *ptr) ATTR_NONNULL(1)
#define SEL_OP_USE_OUTSIDE(sel_op)
std::string ED_select_pick_get_name(wmOperatorType *ot, PointerRNA *ptr)
#define V3D_PROJ_TEST_CLIP_CONTENT_DEFAULT
#define XRAY_ENABLED(v3d)
void armature_foreachScreenBone(const ViewContext *vc, void(*func)(void *user_data, EditBone *ebone, const float screen_co_a[2], const float screen_co_b[2]), void *user_data, eV3DProjTest clip_flag)
void mesh_foreachScreenVert(const ViewContext *vc, void(*func)(void *user_data, BMVert *eve, const float screen_co[2], int index), void *user_data, eV3DProjTest clip_flag)
int view3d_gpu_select(const ViewContext *vc, GPUSelectBuffer *buffer, const rcti *input, eV3DSelectMode select_mode, eV3DSelectObjectFilter select_filter)
@ V3D_PROJ_TEST_CLIP_NEAR
void nurbs_foreachScreenVert(const ViewContext *vc, void(*func)(void *user_data, Nurb *nu, BPoint *bp, BezTriple *bezt, int beztindex, bool handle_visible, const float screen_co[2]), void *user_data, eV3DProjTest clip_flag)
void view3d_gpu_select_cache_end()
void ED_view3d_init_mats_rv3d(const Object *ob, RegionView3D *rv3d)
int view3d_gpu_select_ex(const ViewContext *vc, GPUSelectBuffer *buffer, const rcti *input, eV3DSelectMode select_mode, eV3DSelectObjectFilter select_filter, bool do_material_slot_selection)
void lattice_foreachScreenVert(const ViewContext *vc, void(*func)(void *user_data, BPoint *bp, const float screen_co[2]), void *user_data, eV3DProjTest clip_flag)
blender::float4x4 ED_view3d_ob_project_mat_get(const RegionView3D *rv3d, const Object *ob)
void pose_foreachScreenBone(const ViewContext *vc, void(*func)(void *user_data, bPoseChannel *pchan, const float screen_co_a[2], const float screen_co_b[2]), void *user_data, eV3DProjTest clip_flag)
eV3DSelectObjectFilter ED_view3d_select_filter_from_mode(const Scene *scene, const Object *obact)
void mesh_foreachScreenFace(const ViewContext *vc, void(*func)(void *user_data, BMFace *efa, const float screen_co[2], int index), void *user_data, eV3DProjTest clip_flag)
void mball_foreachScreenElem(const ViewContext *vc, void(*func)(void *user_data, MetaElem *ml, const float screen_co[2]), void *user_data, eV3DProjTest clip_flag)
#define V3D_PROJ_TEST_CLIP_DEFAULT
void view3d_gpu_select_cache_begin()
eV3DProjStatus ED_view3d_project_base(const ARegion *region, Base *base, float r_co[2])
@ VIEW3D_SELECT_PICK_NEAREST
#define XRAY_FLAG_ENABLED(v3d)
void view3d_operator_needs_gpu(const bContext *C)
blender::float4x4 ED_view3d_ob_project_mat_get_from_obmat(const RegionView3D *rv3d, const blender::float4x4 &obmat)
void mesh_foreachScreenEdge_clip_bb_segment(const ViewContext *vc, void(*func)(void *user_data, BMEdge *eed, const float screen_co_a[2], const float screen_co_b[2], int index), void *user_data, eV3DProjTest clip_flag)
@ VIEW3D_SELECT_FILTER_NOP
void meshobject_foreachScreenVert(const ViewContext *vc, void(*func)(void *user_data, const float screen_co[2], int index), void *user_data, eV3DProjTest clip_flag)
eV3DProjStatus ED_view3d_project_float_global(const ARegion *region, const float co[3], float r_co[2], eV3DProjTest flag)
#define GPU_matrix_set(x)
blender::Vector< GPUSelectResult, 2500 > GPUSelectStorage
Read Guarded memory(de)allocation.
int UI_icon_from_id(const ID *id)
@ OPTYPE_DEPENDS_ON_CURSOR
bool ED_armature_edit_deselect_all_visible_multi_ex(const Span< Base * > bases)
bool ED_armature_edit_deselect_all_visible(Object *obedit)
Base * ED_armature_base_and_bone_from_select_buffer(const Span< Base * > bases, const uint select_id, Bone **r_bone)
Base * ED_armature_base_and_ebone_from_select_buffer(const Span< Base * > bases, const uint select_id, EditBone **r_ebone)
bool ED_armature_edit_select_pick_bone(bContext *C, Base *basact, EditBone *ebone, const int selmask, const SelectPick_Params ¶ms)
bool ED_armature_edit_select_op_from_tagged(bArmature *arm, const int sel_op)
bool ED_armature_edit_select_pick(bContext *C, const int mval[2], const SelectPick_Params ¶ms)
void ED_armature_ebone_listbase_temp_clear(ListBase *lb)
void ED_armature_edit_sync_selection(ListBase *edbo)
#define BM_elem_flag_test(ele, hflag)
#define BM_ITER_MESH(ele, iter, bm, itype)
BMesh const char void * data
void BM_face_select_set(BMesh *bm, BMFace *f, const bool select)
Select Face.
void BM_mesh_select_mode_flush_ex(BMesh *bm, const short selectmode, eBMSelectionFlushFLags flags)
Select Mode Flush.
void BM_vert_select_set(BMesh *bm, BMVert *v, const bool select)
Select Vert.
void BM_edge_select_set(BMesh *bm, BMEdge *e, const bool select)
Select Edge.
@ BM_SELECT_LEN_FLUSH_RECALC_ALL
@ BM_SELECT_LEN_FLUSH_RECALC_NOTHING
ATTR_WARN_UNUSED_RESULT const BMVert * v2
BPy_StructRNA * depsgraph
bool closest(btVector3 &v)
IndexMask slice_content(IndexRange range) const
static constexpr IndexRange from_single(const int64_t index)
bool add(const Key &key, const Value &value)
Value lookup_default(const Key &key, const Value &default_value) const
constexpr MutableSpan slice(const int64_t start, const int64_t size) const
constexpr IndexRange index_range() const
constexpr void copy_from(Span< T > values) const
bool contains(const Key &key) const
constexpr const T * data() const
constexpr int64_t size() const
constexpr bool is_empty() const
void append(const T &value)
IndexRange index_range() const
void resize(const int64_t new_size)
MutableSpan< T > as_mutable_span()
Span< T > as_span() const
GAttributeReader lookup_or_default(StringRef attribute_id, AttrDomain domain, eCustomDataType data_type, const void *default_value=nullptr) const
int domain_size(const AttrDomain domain) const
AttributeAccessor attributes() const
GSpanAttributeWriter lookup_or_add_for_write_span(StringRef attribute_id, AttrDomain domain, eCustomDataType data_type, const AttributeInit &initializer=AttributeInitDefaultValue())
GAttributeWriter lookup_or_add_for_write(StringRef attribute_id, AttrDomain domain, eCustomDataType data_type, const AttributeInit &initializer=AttributeInitDefaultValue())
bke::CurvesGeometry & strokes_for_write()
const bke::CurvesGeometry & strokes() const
float4x4 to_world_space(const Object &object) const
bool ED_curve_editnurb_select_pick(bContext *C, const int mval[2], const int dist_px, const SelectPick_Params ¶ms)
bool ED_curve_editfont_select_pick(bContext *C, const int mval[2], const SelectPick_Params ¶ms)
static bool is_inside(int x, int y, int cols, int rows)
blender::bke::AttrDomain ED_grease_pencil_selection_domain_get(const ToolSettings *tool_settings, const Object *object)
static bool handles_visible(KeyframeEditData *ked, BezTriple *bezt)
void * MEM_callocN(size_t len, const char *str)
void MEM_freeN(void *vmemh)
ccl_device_inline float2 mask(const MaskType mask, const float2 a)
bool bone_is_visible_editbone(const bArmature *armature, const EditBone *ebone)
GeometryDeformation get_evaluated_grease_pencil_drawing_deformation(const Object *ob_eval, const Object &ob_orig, const bke::greasepencil::Drawing &drawing_orig)
GeometryDeformation get_evaluated_curves_deformation(const Object *ob_eval, const Object &ob_orig)
void apply_selection_operation_at_index(GMutableSpan selection, const int index, const eSelectOp sel_op)
void foreach_selectable_point_range(const bke::CurvesGeometry &curves, const bke::crazyspace::GeometryDeformation &deformation, eHandleDisplay handle_display, SelectionRangeFn range_consumer)
IndexMask select_circle_mask(const ViewContext &vc, const bke::CurvesGeometry &curves, const bke::crazyspace::GeometryDeformation &deformation, const float4x4 &projection, const IndexMask &selection_mask, const IndexMask &bezier_mask, const bke::AttrDomain selection_domain, const StringRef attribute_name, const int2 coord, const float radius, IndexMaskMemory &memory)
void foreach_selectable_curve_range(const bke::CurvesGeometry &curves, const bke::crazyspace::GeometryDeformation &deformation, eHandleDisplay handle_display, SelectionRangeFn range_consumer)
void foreach_selection_attribute_writer(bke::CurvesGeometry &curves, bke::AttrDomain selection_domain, blender::FunctionRef< void(bke::GSpanAttributeWriter &selection)> fn)
IndexMask select_lasso_mask(const ViewContext &vc, const bke::CurvesGeometry &curves, const bke::crazyspace::GeometryDeformation &deformation, const float4x4 &projection, const IndexMask &selection_mask, const IndexMask &bezier_mask, const bke::AttrDomain selection_domain, const StringRef attribute_name, const Span< int2 > lasso_coords, IndexMaskMemory &memory)
bool select_circle(const ViewContext &vc, bke::CurvesGeometry &curves, const bke::crazyspace::GeometryDeformation &deformation, const float4x4 &projection, const IndexMask &selection_mask, const IndexMask &bezier_mask, const bke::AttrDomain selection_domain, const int2 coord, const float radius, const eSelectOp sel_op)
std::optional< FindClosestData > closest_elem_find_screen_space(const ViewContext &vc, const OffsetIndices< int > points_by_curve, const Span< float3 > positions, const VArray< bool > &cyclic, const float4x4 &projection, const IndexMask &mask, const bke::AttrDomain domain, const int2 coord, const FindClosestData &initial_closest)
IndexMask select_box_mask(const ViewContext &vc, const bke::CurvesGeometry &curves, const bke::crazyspace::GeometryDeformation &deformation, const float4x4 &projection, const IndexMask &selection_mask, const IndexMask &bezier_mask, const bke::AttrDomain selection_domain, const StringRef attribute_name, const rcti &rect, IndexMaskMemory &memory)
bke::GSpanAttributeWriter ensure_selection_attribute(bke::CurvesGeometry &curves, bke::AttrDomain selection_domain, eCustomDataType create_type, StringRef attribute_name)
bool select_lasso(const ViewContext &vc, bke::CurvesGeometry &curves, const bke::crazyspace::GeometryDeformation &deformation, const float4x4 &projection, const IndexMask &selection_mask, const IndexMask &bezier_mask, const bke::AttrDomain selection_domain, const Span< int2 > lasso_coords, const eSelectOp sel_op)
bool select_box(const ViewContext &vc, bke::CurvesGeometry &curves, const bke::crazyspace::GeometryDeformation &deformation, const float4x4 &projection, const IndexMask &selection_mask, const IndexMask &bezier_mask, const bke::AttrDomain selection_domain, const rcti &rect, const eSelectOp sel_op)
bool selection_update(const ViewContext *vc, const eSelectOp sel_op, SelectionUpdateFunc select_operation)
IndexMask retrieve_editable_elements(Object &object, const MutableDrawingInfo &info, const bke::AttrDomain selection_domain, IndexMaskMemory &memory)
IndexMask retrieve_visible_bezier_handle_elements(Object &object, const bke::greasepencil::Drawing &drawing, const int layer_index, const bke::AttrDomain selection_domain, IndexMaskMemory &memory)
Vector< MutableDrawingInfo > retrieve_editable_drawings(const Scene &scene, GreasePencil &grease_pencil)
void base_activate(bContext *C, Base *base)
void base_select(Base *base, eObjectSelect_Mode mode)
void mode_generic_exit(Main *bmain, Depsgraph *depsgraph, Scene *scene, Object *ob)
bool select_box(PointCloud &pointcloud, const ARegion ®ion, const float4x4 &projection, const rcti &rect, const eSelectOp sel_op)
bool select_lasso(PointCloud &pointcloud, const ARegion ®ion, const float4x4 &projection, const Span< int2 > lasso_coords, const eSelectOp sel_op)
bool select_circle(PointCloud &pointcloud, const ARegion ®ion, const float4x4 &projection, const int2 coord, const float radius, const eSelectOp sel_op)
bke::GSpanAttributeWriter ensure_selection_attribute(PointCloud &pointcloud, eCustomDataType create_type)
std::optional< FindClosestData > find_closest_point_to_screen_co(const ARegion ®ion, const Span< float3 > positions, const float4x4 &projection, const IndexMask &points_mask, const float2 mouse_pos, const float radius, const FindClosestData &initial_closest)
void parallel_for(const IndexRange range, const int64_t grain_size, const Function &function, const TaskSizeHints &size_hints=detail::TaskSizeHints_Static(1))
Value parallel_reduce(IndexRange range, int64_t grain_size, const Value &identity, const Function &function, const Reduction &reduction)
VecBase< int32_t, 2 > int2
static void init(bNodeTree *, bNode *node)
void ED_armature_pose_select_in_wpaint_mode(const Scene *scene, ViewLayer *view_layer, Base *base_select)
bool ED_armature_pose_select_pick_bone(const Scene *scene, ViewLayer *view_layer, View3D *v3d, Object *ob, Bone *bone, const SelectPick_Params ¶ms)
void ED_pose_bone_select_tag_update(Object *ob)
bool ED_pose_deselect_all(Object *ob, int select_mode, const bool ignore_visibility)
bool ED_armature_pose_select_pick_with_buffer(const Scene *scene, ViewLayer *view_layer, View3D *v3d, Base *base, const GPUSelectResult *hit_results, const int hits, const SelectPick_Params ¶ms, bool do_nearest)
void RNA_int_set_array(PointerRNA *ptr, const char *name, const int *values)
void RNA_int_get_array(PointerRNA *ptr, const char *name, int *values)
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
int RNA_int_get(PointerRNA *ptr, const char *name)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
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)
PropertyRNA * RNA_def_int_vector(StructOrFunctionRNA *cont_, const char *identifier, const int len, const int *default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
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_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_enum_funcs(PropertyRNA *prop, EnumPropertyItemFunc itemfunc)
const EnumPropertyItem rna_enum_dummy_NULL_items[]
eBezTriple_Flag select_flag
eBezTriple_Flag select_flag
blender::StringRef selection_attribute_name
blender::ed::curves::FindClosestData elem
blender::ed::curves::FindClosestData elem
blender::bke::greasepencil::Drawing * drawing
blender::StringRef selection_attribute_name
blender::ed::pointcloud::FindClosestData elem
union EditBone::@313026223344046157307162027212134045115206003172 temp
BLI_bitmap * select_bitmap
eBezTriple_Flag select_flag
struct MovieTracking tracking
ObjectRuntimeHandle * runtime
struct ToolSettings * toolsettings
VMutableArray< T > varray
MutableVArraySpan< T > span
bke::greasepencil::Drawing & drawing
wmGenericUserDataFreeFn free_fn
wmGenericUserData user_data
static bool edbm_backbuf_check_and_select_faces_obmode(Mesh *mesh, EditSelectBuf_Cache *esel, const eSelectOp sel_op)
static wmOperatorStatus view3d_box_select_exec(bContext *C, wmOperator *op)
static void do_lasso_select_armature__doSelectBone(void *user_data, EditBone *ebone, const float screen_co_a[2], const float screen_co_b[2])
void VIEW3D_OT_select(wmOperatorType *ot)
float ED_view3d_select_dist_px()
static bool do_lasso_select_pose(const ViewContext *vc, const Span< int2 > mcoords, const eSelectOp sel_op)
static bool do_paintvert_box_select(const ViewContext *vc, wmGenericUserData *wm_userdata, const rcti *rect, const eSelectOp sel_op)
static void do_lasso_tag_pose(const ViewContext *vc, const Span< int2 > mcoords)
static bool edbm_backbuf_check_and_select_edges(EditSelectBuf_Cache *esel, Depsgraph *depsgraph, Object *ob, BMEditMesh *em, const eSelectOp sel_op)
static bool edbm_backbuf_check_and_select_faces(EditSelectBuf_Cache *esel, Depsgraph *depsgraph, Object *ob, BMEditMesh *em, const eSelectOp sel_op)
static wmOperatorStatus view3d_select_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static blender::Vector< Base * > do_pose_tag_select_op_prepare(const ViewContext *vc)
static bool paint_facesel_circle_select(const ViewContext *vc, wmGenericUserData *wm_userdata, const eSelectOp sel_op, const int mval[2], float rad)
static void do_lasso_select_mesh__doSelectVert(void *user_data, BMVert *eve, const float screen_co[2], int)
static bool do_lasso_select_objects(const ViewContext *vc, const Span< int2 > mcoords, const eSelectOp sel_op)
static Base * mouse_select_object_center(const ViewContext *vc, Base *startbase, const int mval[2])
static void do_paintvert_box_select__doSelectVert(void *user_data, const float screen_co[2], int index)
static void do_mesh_box_select__doSelectFace(void *user_data, BMFace *efa, const float screen_co[2], int)
static bool grease_pencil_circle_select(const ViewContext *vc, const eSelectOp sel_op, const int mval[2], const float rad)
static bool do_lasso_select_grease_pencil(const ViewContext *vc, const Span< int2 > mcoords, const eSelectOp sel_op)
static bool do_pose_box_select(bContext *C, const ViewContext *vc, const rcti *rect, const eSelectOp sel_op)
static void do_circle_select_armature__doSelectBone(void *user_data, EditBone *ebone, const float screen_co_a[2], const float screen_co_b[2])
static bool pose_circle_select(const ViewContext *vc, const eSelectOp sel_op, const int mval[2], float rad)
static bool bone_mouse_select_menu(bContext *C, const blender::Span< GPUSelectResult > hit_results, const bool is_editmode, const SelectPick_Params ¶ms)
static void do_mesh_box_select__doSelectEdge_pass0(void *user_data, BMEdge *eed, const float screen_co_a[2], const float screen_co_b[2], int index)
static bool do_nurbs_box_select(const ViewContext *vc, const rcti *rect, const eSelectOp sel_op)
static bool do_lasso_select_mesh(const ViewContext *vc, wmGenericUserData *wm_userdata, const Span< int2 > mcoords, const eSelectOp sel_op)
static bool do_lasso_select_lattice(const ViewContext *vc, const Span< int2 > mcoords, const eSelectOp sel_op)
static void do_lattice_box_select__doSelect(void *user_data, BPoint *bp, const float screen_co[2])
static void view3d_userdata_lassoselect_init(LassoSelectUserData *r_data, const ViewContext *vc, const rcti *rect, const Span< int2 > mcoords, const eSelectOp sel_op)
static bool do_lattice_box_select(const ViewContext *vc, const rcti *rect, const eSelectOp sel_op)
static bool object_circle_select(const ViewContext *vc, const eSelectOp sel_op, const int mval[2], float rad)
void VIEW3D_OT_bone_select_menu(wmOperatorType *ot)
static bool object_mouse_select_menu(bContext *C, const ViewContext *vc, const blender::Span< GPUSelectResult > hit_results, const int mval[2], const SelectPick_Params ¶ms, Base **r_basact)
void VIEW3D_OT_select_box(wmOperatorType *ot)
static int gpu_select_buffer_depth_id_cmp(const void *sel_a_p, const void *sel_b_p)
static Base * mouse_select_eval_buffer(const ViewContext *vc, const GPUSelectBuffer &buffer, int hits, bool do_nearest, bool has_bones, bool do_bones_get_priotity, int *r_select_id_subelem)
static void mesh_circle_doSelectEdge(void *user_data, BMEdge *eed, const float screen_co_a[2], const float screen_co_b[2], int)
static void do_lasso_select_armature__doSelectBone_clip_content(void *user_data, EditBone *ebone, const float screen_co_a[2], const float screen_co_b[2])
static bool edge_fully_inside_rect(const rctf *rect, const float v1[2], const float v2[2])
static bool do_lasso_select_curve(const ViewContext *vc, const Span< int2 > mcoords, const eSelectOp sel_op)
static bool do_grease_pencil_box_select(const ViewContext *vc, const rcti *rect, const eSelectOp sel_op)
static bool ed_object_select_pick(bContext *C, const int mval[2], const SelectPick_Params ¶ms, const bool center, const bool enumerate, const bool object_only)
static int gpu_bone_select_buffer_cmp(const void *sel_a_p, const void *sel_b_p)
static void view3d_userdata_circleselect_init(CircleSelectUserData *r_data, const ViewContext *vc, const bool select, const int mval[2], const float rad)
static bool do_lasso_select_armature(const ViewContext *vc, const Span< int2 > mcoords, const eSelectOp sel_op)
static wmOperatorStatus bone_select_menu_exec(bContext *C, wmOperator *op)
static wmOperatorStatus object_select_menu_exec(bContext *C, wmOperator *op)
static bool selectbuffer_has_bones(const blender::Span< GPUSelectResult > hit_results)
Object * ED_view3d_give_material_slot_under_cursor(bContext *C, const int mval[2], int *r_material_slot)
static bool edge_inside_rect(const rctf *rect, const float v1[2], const float v2[2])
static bool do_lasso_select_paintface(const ViewContext *vc, wmGenericUserData *wm_userdata, const Span< int2 > mcoords, const eSelectOp sel_op)
static SelMenuItemF object_mouse_select_menu_data[SEL_MENU_SIZE]
Object * ED_view3d_give_object_under_cursor(bContext *C, const int mval[2])
static void do_mesh_box_select__doSelectEdge_pass1(void *user_data, BMEdge *eed, const float screen_co_a[2], const float screen_co_b[2], int index)
static bool mball_circle_select(const ViewContext *vc, const eSelectOp sel_op, const int mval[2], float rad)
static void object_select_tag_updates(bContext &C, Scene &scene)
static void do_lasso_select_mesh__doSelectEdge_pass1(void *user_data, BMEdge *eed, const float screen_co_a[2], const float screen_co_b[2], int index)
static void mesh_circle_doSelectFace(void *user_data, BMFace *efa, const float screen_co[2], int)
static void editselect_buf_cache_free(EditSelectBuf_Cache *esel)
static bool armature_circle_doSelectJoint(void *user_data, EditBone *ebone, const float screen_co[2], bool head)
static bool do_mesh_box_select(const ViewContext *vc, wmGenericUserData *wm_userdata, const rcti *rect, const eSelectOp sel_op)
ViewContext ED_view3d_viewcontext_init(bContext *C, Depsgraph *depsgraph)
static bool do_lasso_select_meta(const ViewContext *vc, const Span< int2 > mcoords, const eSelectOp sel_op)
static wmOperatorStatus view3d_circle_select_exec(bContext *C, wmOperator *op)
static void do_mesh_box_select__doSelectVert(void *user_data, BMVert *eve, const float screen_co[2], int)
static const EnumPropertyItem * object_select_menu_enum_itemf(bContext *C, PointerRNA *, PropertyRNA *, bool *r_free)
static bool nurbscurve_circle_select(const ViewContext *vc, const eSelectOp sel_op, const int mval[2], float rad)
static void do_lasso_select_mball__doSelectElem(void *user_data, MetaElem *ml, const float screen_co[2])
static bool ed_curves_select_pick(bContext &C, const int mval[2], const SelectPick_Params ¶ms)
void VIEW3D_OT_select_menu(wmOperatorType *ot)
static bool object_deselect_all_except(const Scene *scene, ViewLayer *view_layer, Base *b)
static bool view3d_lasso_select(bContext *C, ViewContext *vc, const Span< int2 > mcoords, const eSelectOp sel_op)
static bool do_meta_box_select(const ViewContext *vc, const rcti *rect, const eSelectOp sel_op)
static std::string object_select_menu_get_name(wmOperatorType *, PointerRNA *ptr)
static int selectbuffer_ret_hits_15(blender::MutableSpan< GPUSelectResult >, const int hits15)
static void paint_vertsel_circle_select_doSelectVert(void *user_data, const float screen_co[2], int index)
static void do_lasso_select_pose__do_tag(void *user_data, bPoseChannel *pchan, const float screen_co_a[2], const float screen_co_b[2])
static bool do_object_box_select(bContext *C, const ViewContext *vc, const rcti *rect, const eSelectOp sel_op)
static bool object_deselect_all_visible(const Scene *scene, ViewLayer *view_layer, View3D *v3d)
static Base * ed_view3d_give_base_under_cursor_ex(bContext *C, const int mval[2], int *r_material_slot)
bool ED_view3d_is_object_under_cursor(bContext *C, const int mval[2])
static bool do_paintface_box_select(const ViewContext *vc, wmGenericUserData *wm_userdata, const rcti *rect, eSelectOp sel_op)
static void mesh_circle_doSelectVert(void *user_data, BMVert *eve, const float screen_co[2], int)
static void do_circle_select_pose__doSelectBone(void *user_data, bPoseChannel *pchan, const float screen_co_a[2], const float screen_co_b[2])
static void view3d_circle_select_cancel(bContext *C, wmOperator *op)
static bool edbm_backbuf_check_and_select_verts_obmode(Mesh *mesh, EditSelectBuf_Cache *esel, const eSelectOp sel_op)
static bool do_pose_tag_select_op_exec(blender::MutableSpan< Base * > bases, const eSelectOp sel_op)
static bool do_armature_box_select(const ViewContext *vc, const rcti *rect, const eSelectOp sel_op)
static bool armature_circle_select(const ViewContext *vc, const eSelectOp sel_op, const int mval[2], float rad)
static void editselect_buf_cache_init(const ViewContext *vc, short select_mode)
static int mixed_bones_object_selectbuffer_extended(const ViewContext *vc, GPUSelectBuffer *buffer, const int mval[2], eV3DSelectObjectFilter select_filter, bool use_cycle, bool enumerate, bool *r_do_nearest)
static bool edbm_backbuf_check_and_select_verts(EditSelectBuf_Cache *esel, Depsgraph *depsgraph, Object *ob, BMEditMesh *em, const eSelectOp sel_op)
static void do_lasso_select_meshobject__doSelectVert(void *user_data, const float screen_co[2], int index)
static void do_lasso_select_mesh__doSelectFace(void *user_data, BMFace *efa, const float screen_co[2], int)
static bool ed_wpaint_vertex_select_pick(bContext *C, const int mval[2], const SelectPick_Params ¶ms, Object *obact)
static void latticecurve_circle_doSelect(void *user_data, BPoint *bp, const float screen_co[2])
static void view3d_userdata_boxselect_init(BoxSelectUserData *r_data, const ViewContext *vc, const rcti *rect, const eSelectOp sel_op)
static bool do_lasso_select_paintvert(const ViewContext *vc, wmGenericUserData *wm_userdata, const Span< int2 > mcoords, const eSelectOp sel_op)
Base * ED_view3d_give_base_under_cursor(bContext *C, const int mval[2])
static void do_lasso_select_mesh__doSelectEdge_pass0(void *user_data, BMEdge *eed, const float screen_co_a[2], const float screen_co_b[2], int index)
static void deselect_all_tracks(MovieTracking *tracking)
static void editselect_buf_cache_free_voidp(void *esel_voidp)
static void do_circle_select_mball__doSelectElem(void *user_data, MetaElem *ml, const float screen_co[2])
static wmOperatorStatus view3d_select_exec(bContext *C, wmOperator *op)
static bool mesh_circle_select(const ViewContext *vc, wmGenericUserData *wm_userdata, eSelectOp sel_op, const int mval[2], float rad)
static void view3d_circle_select_recalc(void *user_data)
static void nurbscurve_circle_doSelect(void *user_data, Nurb *, BPoint *bp, BezTriple *bezt, int beztindex, bool, const float screen_co[2])
static void do_lasso_select_lattice__doSelect(void *user_data, BPoint *bp, const float screen_co[2])
static wmOperatorStatus view3d_circle_select_modal(bContext *C, wmOperator *op, const wmEvent *event)
bool edge_inside_circle(const float cent[2], float radius, const float screen_co_a[2], const float screen_co_b[2])
void VIEW3D_OT_select_circle(wmOperatorType *ot)
static bool ed_grease_pencil_select_pick(bContext *C, const int mval[2], const SelectPick_Params ¶ms)
void ED_view3d_viewcontext_init_object(ViewContext *vc, Object *obact)
static void do_circle_select_armature__doSelectBone_clip_content(void *user_data, EditBone *ebone, const float screen_co_a[2], const float screen_co_b[2])
void VIEW3D_OT_select_lasso(wmOperatorType *ot)
static wmOperatorStatus view3d_lasso_select_exec(bContext *C, wmOperator *op)
static void do_lasso_select_curve__doSelect(void *user_data, Nurb *, BPoint *bp, BezTriple *bezt, int beztindex, bool handles_visible, const float screen_co[2])
static int mixed_bones_object_selectbuffer(const ViewContext *vc, GPUSelectBuffer *buffer, const int mval[2], eV3DSelectObjectFilter select_filter, bool do_nearest, bool do_nearest_xray, const bool do_material_slot_selection)
static bool ed_object_select_pick_camera_track(bContext *C, Scene *scene, Base *basact, MovieClip *clip, const GPUSelectBuffer &buffer, const short hits, const SelectPick_Params ¶ms)
static bool obedit_circle_select(bContext *C, const ViewContext *vc, wmGenericUserData *wm_userdata, const eSelectOp sel_op, const int mval[2], float rad)
static int selectbuffer_ret_hits_9(blender::MutableSpan< GPUSelectResult > hit_results, const int hits15, const int hits9)
static void do_nurbs_box_select__doSelect(void *user_data, Nurb *, BPoint *bp, BezTriple *bezt, int beztindex, bool handles_visible, const float screen_co[2])
static bool pointcloud_select_pick(bContext &C, const int2 mval, const SelectPick_Params ¶ms)
static bool paint_vertsel_circle_select(const ViewContext *vc, wmGenericUserData *wm_userdata, const eSelectOp sel_op, const int mval[2], float rad)
static bool lattice_circle_select(const ViewContext *vc, const eSelectOp sel_op, const int mval[2], float rad)
static bool view3d_selectable_data(bContext *C)
static int selectbuffer_ret_hits_5(blender::MutableSpan< GPUSelectResult > hit_results, const int hits15, const int hits9, const int hits5)
static bool pchan_circle_doSelectJoint(void *user_data, bPoseChannel *pchan, const float screen_co[2])
static void editselect_buf_cache_init_with_generic_userdata(wmGenericUserData *wm_userdata, const ViewContext *vc, short select_mode)
bool WM_cursor_test_motion_and_update(const int mval[2])
void WM_main_add_notifier(uint type, void *reference)
wmOperatorStatus WM_operator_name_call_ptr(bContext *C, wmOperatorType *ot, wmOperatorCallContext context, PointerRNA *properties, const wmEvent *event)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
bool WM_gesture_is_modal_first(const wmGesture *gesture)
void WM_gesture_box_cancel(bContext *C, wmOperator *op)
wmOperatorStatus WM_gesture_circle_invoke(bContext *C, wmOperator *op, const wmEvent *event)
Array< int2 > WM_gesture_lasso_path_to_array(bContext *, wmOperator *op)
wmOperatorStatus WM_gesture_lasso_modal(bContext *C, wmOperator *op, const wmEvent *event)
wmOperatorStatus WM_gesture_box_modal(bContext *C, wmOperator *op, const wmEvent *event)
wmOperatorStatus WM_gesture_box_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void WM_gesture_circle_cancel(bContext *C, wmOperator *op)
void WM_gesture_lasso_cancel(bContext *C, wmOperator *op)
wmOperatorStatus WM_gesture_circle_modal(bContext *C, wmOperator *op, const wmEvent *event)
wmOperatorStatus WM_gesture_lasso_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void WM_operator_properties_border_to_rcti(wmOperator *op, rcti *r_rect)
void WM_operator_properties_gesture_box(wmOperatorType *ot)
void WM_operator_properties_select_operation_simple(wmOperatorType *ot)
void WM_operator_properties_select_operation(wmOperatorType *ot)
void WM_operator_properties_gesture_lasso(wmOperatorType *ot)
void WM_operator_properties_gesture_circle(wmOperatorType *ot)
void WM_operator_properties_mouse_select(wmOperatorType *ot)
wmOperatorType * WM_operatortype_find(const char *idname, bool quiet)
wmOperatorStatus WM_operator_flag_only_pass_through_on_press(wmOperatorStatus retval, const wmEvent *event)
wmOperatorStatus WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *)
void WM_operator_properties_create_ptr(PointerRNA *ptr, wmOperatorType *ot)
void WM_operator_properties_free(PointerRNA *ptr)
void WM_generic_user_data_free(wmGenericUserData *wm_userdata)