124 return 75.0f *
U.pixelsize;
166 bool changed =
false;
182 bool changed =
false;
246 wm_userdata->
data = esel;
266 bool changed =
false;
280 if (sel_op_result != -1) {
298 bool changed =
false;
312 if (sel_op_result != -1) {
330 bool changed =
false;
344 if (sel_op_result != -1) {
360 bool changed =
false;
366 ".select_vert", bke::AttrDomain::Point);
367 const VArray<bool> hide_vert = *attributes.lookup_or_default<
bool>(
368 ".hide_vert", bke::AttrDomain::Point,
false);
370 for (
int index = 0; index < mesh->verts_num; index++) {
371 if (!hide_vert[index]) {
372 const bool is_select = select_vert.
span[index];
375 if (sel_op_result != -1) {
376 select_vert.
span[index] = sel_op_result == 1;
391 bool changed =
false;
397 ".select_poly", bke::AttrDomain::Face);
398 const VArray<bool> hide_poly = *attributes.lookup_or_default<
bool>(
399 ".hide_poly", bke::AttrDomain::Face,
false);
401 for (
int index = 0; index < mesh->faces_num; index++) {
402 if (!hide_poly[index]) {
403 const bool is_select = select_poly.
span[index];
406 if (sel_op_result != -1) {
407 select_poly.
span[index] = sel_op_result == 1;
496 if (v1[0] < rect->
xmin &&
v2[0] < rect->
xmin) {
499 if (v1[0] > rect->
xmax &&
v2[0] > rect->
xmax) {
502 if (v1[1] < rect->
ymin &&
v2[1] < rect->
ymin) {
505 if (v1[1] > rect->
ymax &&
v2[1] > rect->
ymax) {
510 d1 = (v1[1] -
v2[1]) * (v1[0] - rect->
xmin) + (
v2[0] - v1[0]) * (v1[1] - rect->
ymin);
511 d2 = (v1[1] -
v2[1]) * (v1[0] - rect->
xmin) + (
v2[0] - v1[0]) * (v1[1] - rect->
ymax);
512 d3 = (v1[1] -
v2[1]) * (v1[0] - rect->
xmax) + (
v2[0] - v1[0]) * (v1[1] - rect->
ymax);
513 d4 = (v1[1] -
v2[1]) * (v1[0] - rect->
xmax) + (
v2[0] - v1[0]) * (v1[1] - rect->
ymin);
515 if (d1 < 0 && d2 < 0 && d3 < 0 && d4 < 0) {
518 if (d1 > 0 && d2 > 0 && d3 > 0 && d4 > 0) {
527 const float screen_co_a[2],
528 const float screen_co_b[2])
540 data->is_changed =
true;
571 bool changed =
false;
588 if (sel_op_result != -1) {
610 Object *ob = base->object;
613 Bone *bone = pchan->bone;
614 bone->
flag &= ~BONE_DONE;
617 ob->
id.
tag &= ~ID_TAG_DOIT;
629 bases_tag_and_append_fn(bases, base);
636 bases_tag_and_append_fn(bases, base_iter);
645 bool changed_multi =
false;
649 Base *base_iter = bases[i];
653 changed_multi =
true;
659 Base *base_iter = bases[i];
665 arm->
id.
tag &= ~ID_TAG_DOIT;
673 Bone *bone = pchan->bone;
678 if (sel_op_result != -1) {
680 if (sel_op_result == 0) {
691 changed_multi =
true;
694 return changed_multi;
706 Base *base_iter = bases[i];
718 return changed_multi;
723 const float screen_co[2],
730 data->mcoords, screen_co[0], screen_co[1],
IS_CLIPPED));
732 if (sel_op_result != -1) {
734 data->is_changed =
true;
744 const float screen_co_a[2],
745 const float screen_co_b[2],
751 bool is_visible =
true;
763 if (sel_op_result != -1) {
765 data->is_done =
true;
766 data->is_changed =
true;
771 const float screen_co_a[2],
772 const float screen_co_b[2],
778 bool is_visible =
true;
790 if (sel_op_result != -1) {
792 data->is_changed =
true;
798 const float screen_co[2],
805 data->mcoords, screen_co[0], screen_co[1],
IS_CLIPPED));
807 if (sel_op_result != -1) {
809 data->is_changed =
true;
831 data.is_changed =
true;
844 if (wm_userdata->
data ==
nullptr) {
866 data_for_edge.esel = use_zbuf ? esel :
nullptr;
876 if (data.is_done ==
false) {
897 if (data.is_changed) {
900 return data.is_changed;
908 bool handles_visible,
909 const float screen_co[2])
914 data->mcoords, screen_co[0], screen_co[1],
IS_CLIPPED);
916 const bool is_select = bp->
f1 &
SELECT;
918 if (sel_op_result != -1) {
920 data->is_changed =
true;
924 if (!handles_visible) {
926 const bool is_select = bezt->
f2 &
SELECT;
928 if (sel_op_result != -1) {
931 bezt->
f1 = bezt->
f3 = bezt->
f2;
932 data->is_changed =
true;
935 uint8_t *flag_p = (&bezt->
f1) + beztindex;
936 const bool is_select = *flag_p &
SELECT;
938 if (sel_op_result != -1) {
940 data->is_changed =
true;
950 const bool deselect_all = (sel_op ==
SEL_OP_SET);
975 if (data.is_changed) {
978 return data.is_changed;
983 const float screen_co[2])
986 const bool is_select = bp->
f1 &
SELECT;
989 data->mcoords, screen_co[0], screen_co[1],
IS_CLIPPED));
991 if (sel_op_result != -1) {
993 data->is_changed =
true;
1014 return data.is_changed;
1019 const float screen_co_a[2],
1020 const float screen_co_b[2])
1028 int is_ignore_flag = 0;
1029 int is_inside_flag = 0;
1053 if (is_ignore_flag == 0) {
1056 data->mcoords,
UNPACK2(screen_co_a),
UNPACK2(screen_co_b), INT_MAX))
1062 ebone->
temp.
i = is_inside_flag | (is_ignore_flag >> 16);
1066 const float screen_co_a[2],
1067 const float screen_co_b[2])
1075 const int is_ignore_flag = ebone->
temp.
i << 16;
1076 int is_inside_flag = ebone->
temp.
i & ~0xFFFF;
1090 ebone->
temp.
i = is_inside_flag | (is_ignore_flag >> 16);
1128 if (data.is_changed) {
1131 return data.is_changed;
1136 const float screen_co[2])
1142 data->mcoords, screen_co[0], screen_co[1], INT_MAX));
1144 if (sel_op_result != -1) {
1146 data->is_changed =
true;
1171 return data.is_changed;
1185 return ed::greasepencil::selection_update(
1189 const IndexMask &mask,
1191 IndexMaskMemory &memory) {
1195 bke::crazyspace::get_evaluated_grease_pencil_drawing_deformation(
1197 const IndexMask visible_handle_elements =
1198 ed::greasepencil::retrieve_visible_bezier_handle_elements(
1200 const float4x4 layer_to_world = layer.to_world_space(*ob_eval);
1204 return ed::curves::select_lasso_mask(*vc,
1209 visible_handle_elements,
1222 const float screen_co[2],
1229 const bool is_select = mesh_data->
select_vert[index];
1232 data->mcoords, screen_co[0], screen_co[1],
IS_CLIPPED));
1234 if (sel_op_result != -1) {
1235 mesh_data->
select_vert[index] = sel_op_result == 1;
1236 data->is_changed =
true;
1250 if (mesh ==
nullptr || mesh->verts_num == 0) {
1254 bool changed =
false;
1264 if (wm_userdata->
data ==
nullptr) {
1280 ".select_vert", bke::AttrDomain::Point);
1292 changed |= data.lasso_data.is_changed;
1315 if (mesh ==
nullptr || mesh->faces_num == 0) {
1319 bool changed =
false;
1328 if (esel ==
nullptr) {
1352 bool changed_multi =
false;
1357 if (vc->
obedit ==
nullptr) {
1369 reinterpret_cast<const int(*)[2]
>(mcoords.
data()),
1378 if (changed_multi) {
1389 if (changed_multi) {
1402 bool changed =
false;
1428 bke::crazyspace::get_evaluated_curves_deformation(*vc->
depsgraph, *vc->
obedit);
1430 const IndexRange elements(curves.attributes().domain_size(selection_domain));
1432 changed = ed::curves::select_lasso(*vc,
1461 changed_multi =
true;
1469 return changed_multi;
1491 if (changed_multi) {
1499 ot->
name =
"Lasso Select";
1501 ot->
idname =
"VIEW3D_OT_select_lasso";
1531#define SEL_MENU_SIZE 22
1569 bool changed =
false;
1578 Base *basact =
nullptr;
1582 if (
STREQ(name, base->object->id.name + 2)) {
1589 if (basact ==
nullptr) {
1599 else if (deselect) {
1605 if (basact == oldbasact) {
1621 if (oldbasact != basact) {
1646 ot->
name =
"Select Menu";
1648 ot->
idname =
"VIEW3D_OT_select_menu";
1682 const float mval_fl[2] = {
float(mval[0]),
float(mval[1])};
1684 const float dist_threshold_sq =
square_f(15 *
U.pixelsize);
1687 struct BaseRefWithDepth {
1688 BaseRefWithDepth *
next, *prev;
1693 ListBase base_ref_list = {
nullptr,
nullptr};
1704 if (base->object->runtime->select_id == (hit_result.id & ~0xFFFF0000)) {
1706 depth_id = hit_result.depth;
1715 if (dist_test_sq < dist_threshold_sq) {
1725 BaseRefWithDepth *base_ref = MEM_cnew<BaseRefWithDepth>(__func__);
1726 base_ref->base = base;
1727 base_ref->depth_id = depth_id;
1733 *r_basact =
nullptr;
1735 if (base_count == 0) {
1738 if (base_count == 1) {
1739 Base *base = ((BaseRefWithDepth *)base_ref_list.
first)->base;
1747 return int(
static_cast<const BaseRefWithDepth *
>(a)->depth_id >
1748 static_cast<const BaseRefWithDepth *
>(
b)->depth_id);
1762 Base *base = base_ref->base;
1764 const char *name = ob->
id.
name + 2;
1799 if (basact ==
nullptr) {
1839 if (oldbasact != basact) {
1860 ot->
name =
"Select Menu";
1862 ot->
idname =
"VIEW3D_OT_bone_select_menu";
1890 const bool is_editmode,
1895 struct BoneRefWithDepth {
1896 BoneRefWithDepth *
next, *prev;
1906 ListBase bone_ref_list = {
nullptr,
nullptr};
1913 void *bone_ptr =
nullptr;
1914 Base *bone_base =
nullptr;
1915 uint hitresult = hit_result.id;
1922 hitresult &= ~BONESEL_ANY;
1923 const uint hit_object = hitresult & 0xFFFF;
1927 if (base->object->runtime->select_id == hit_object) {
1940 const uint hit_bone = (hitresult & ~BONESEL_ANY) >> 16;
1948 const uint hit_bone = (hitresult & ~BONESEL_ANY) >> 16;
1961 const bool is_duplicate_bone =
BLI_gset_haskey(added_bones, bone_ptr);
1963 if (!is_duplicate_bone) {
1965 BoneRefWithDepth *bone_ref = MEM_cnew<BoneRefWithDepth>(__func__);
1966 bone_ref->base = bone_base;
1967 bone_ref->bone_ptr = bone_ptr;
1968 bone_ref->depth_id = hit_result.depth;
1977 if (bone_count == 0) {
1980 if (bone_count == 1) {
1987 return int(
static_cast<const BoneRefWithDepth *
>(a)->depth_id >
1988 static_cast<const BoneRefWithDepth *
>(
b)->depth_id);
2037 if (hit_result.id & 0xFFFF0000) {
2055 const int ofs = hits15;
2066 const int ofs = hits15 + hits9;
2085 bool do_nearest_xray_if_supported,
2086 const bool do_material_slot_selection)
2089 int hits15, hits9 = 0, hits5 = 0;
2090 bool has_bones15 =
false, has_bones9 =
false, has_bones5 =
false;
2095 if (do_nearest_xray_if_supported) {
2113 vc, buffer, &rect, select_mode, select_filter, do_material_slot_selection);
2118 else if (hits15 > 0) {
2129 else if (hits9 > 0) {
2139 else if (hits5 > 0) {
2148 else if (has_bones9) {
2152 else if (has_bones15) {
2161 else if (hits9 > 0) {
2184 bool do_nearest =
false;
2192 do_nearest = has_motion;
2202 *r_do_nearest = do_nearest;
2205 do_nearest = do_nearest && !enumerate;
2208 vc, buffer, mval, select_filter, do_nearest,
true,
false);
2222 if (a->depth <
b->depth) {
2225 if (a->depth >
b->depth) {
2233#ifdef __BIG_ENDIAN__
2238 if (sel_a < sel_b) {
2241 if (sel_a > sel_b) {
2259 bool do_bones_get_priotity,
2260 int *r_select_id_subelem)
2269 int select_id_subelem = 0;
2275 if (has_bones && do_bones_get_priotity) {
2277 for (a = 0; a < hits; a++) {
2286 for (a = 0; a < hits; a++) {
2295 if (hit_index != -1) {
2296 select_id = buffer.
storage[hit_index].id & 0xFFFF;
2297 select_id_subelem = (buffer.
storage[hit_index].id & 0xFFFF0000) >> 16;
2306 buffer_sorted.
resize(hits);
2308 if (has_bones && do_bones_get_priotity) {
2310 for (a = hits - 1; a >= 0; a--) {
2311 if ((buffer_sorted[a].
id & 0xFFFF0000) == 0) {
2312 buffer_sorted[a] = buffer_sorted[--hits];
2327 const int select_id_active = base->
object->
runtime->select_id;
2328 for (
int i_next = 0, i_prev = hits - 1; i_next < hits; i_prev = i_next++) {
2329 if ((select_id_active == (buffer_sorted[i_prev].
id & 0xFFFF)) &&
2330 (select_id_active != (buffer_sorted[i_next].
id & 0xFFFF)))
2339 if (hit_index == -1) {
2345 if (hit_index != -1) {
2346 select_id = buffer_sorted[hit_index].id & 0xFFFF;
2347 select_id_subelem = (buffer_sorted[hit_index].id & 0xFFFF0000) >> 16;
2352 Base *basact =
nullptr;
2357 if (base->object->runtime->select_id == select_id) {
2364 if (basact && r_select_id_subelem) {
2365 *r_select_id_subelem = select_id_subelem;
2382 const float mval_fl[2] = {
float(mval[0]),
float(mval[1])};
2384 Base *basact =
nullptr;
2388 Base *base = startbase;
2393 base->
object->object_to_world().location(),
2398 if (base == oldbasact) {
2399 dist_test += penalty_dist;
2401 if (dist_test < dist) {
2409 if (base ==
nullptr) {
2412 if (base == startbase) {
2421 int *r_material_slot)
2424 Base *basact =
nullptr;
2434 const bool do_material_slot_selection = r_material_slot !=
nullptr;
2439 const bool has_bones = (r_material_slot ==
nullptr) &&
2442 &vc, buffer, hits, do_nearest, has_bones,
true, r_material_slot);
2464 int *r_material_slot)
2495 bool changed =
false;
2502 for (
int i = 0; i < hits; i++) {
2503 const int hitresult = buffer.
storage[i].id;
2507 if (basact->
object->
runtime->select_id != (hitresult & 0xFFFF)) {
2512 if ((hitresult & 0xFFFF0000) == 0) {
2517 &clip->tracking, hitresult >> 16, &tracksbase);
2536 switch (
params->sel_op) {
2572 return changed || found;
2591 const bool enumerate,
2592 const bool object_only)
2602 Base *basact_override =
nullptr;
2604 const bool is_obedit = (vc.
obedit !=
nullptr);
2624 if (center ==
false) {
2625 gpu = MEM_new<GPUData>(__func__);
2626 gpu->do_nearest =
false;
2627 gpu->has_bones =
false;
2635 &vc, &gpu->buffer, mval, select_filter,
true, enumerate, &gpu->do_nearest);
2636 gpu->has_bones = (object_only && gpu->hits > 0) ?
2644 bool has_menu =
false;
2651 if (gpu->hits != 0) {
2665 if (gpu !=
nullptr) {
2679 Base *startbase = (oldbasact && oldbasact->
next) ?
2684 Base *basact =
nullptr;
2691 const bool has_pose_old = (oldbasact &&
2695 bool handled =
false;
2700 bool changed_object =
false;
2701 bool changed_pose =
false;
2702 bool changed_track =
false;
2705 bool use_activate_selected_base =
false;
2708 if (basact_override) {
2709 basact = basact_override;
2716 if (basact_override) {
2717 basact = basact_override;
2731 bool do_bones_get_priotity = has_pose_old;
2738 do_bones_get_priotity,
2744 const bool has_pose_new = (basact &&
2748 if (((gpu->hits > 0) && gpu->has_bones) ||
2750 ((gpu->hits == 0) && has_pose_old))
2755 if (clip !=
nullptr) {
2757 C, scene, basact, clip, gpu->buffer, gpu->hits,
params))
2761 changed_object =
true;
2763 changed_track =
true;
2769 &vc, gpu->buffer, gpu->hits, gpu->do_nearest,
false,
false,
nullptr);
2776 basact ? basact : (
Base *)oldbasact,
2777 gpu->buffer.storage.data(),
2783 changed_pose =
true;
2788 if (basact ==
nullptr) {
2796 changed_object =
true;
2813 else if (has_pose_old && has_pose_new) {
2821 if (oldbasact != basact) {
2822 use_activate_selected_base =
true;
2834 if (basact == oldbasact) {
2840 bool changed_object_mode =
false;
2842 if (handled ==
false) {
2845 if (is_obedit ==
false) {
2858 if (basact && oldbasact) {
2870 changed_object_mode =
true;
2874 changed_object_mode =
true;
2886 else if (basact && vc.
obedit) {
2892 changed_object =
true;
2911 const bool select_passthrough =
params->select_passthrough && (changed_object_mode ==
false);
2918 else if (found ||
params->deselect_all) {
2922 changed_object =
true;
2928 use_activate_selected_base |= (oldbasact != basact) && (is_obedit ==
false);
2930 switch (
params->sel_op) {
2942 if (use_activate_selected_base ==
false) {
2962 changed_object =
true;
2968 if (use_activate_selected_base && (basact !=
nullptr)) {
2969 changed_object =
true;
2976 if (changed_object) {
2987 if (gpu !=
nullptr) {
2991 return (changed_object || changed_pose || changed_track);
3011 bool changed =
false;
3017 ".select_vert", bke::AttrDomain::Point);
3020 if ((found &&
params->select_passthrough) && select_vert.
varray[index]) {
3023 else if (found ||
params->deselect_all) {
3030 switch (
params->sel_op) {
3032 select_vert.
varray.set(index,
true);
3036 select_vert.
varray.set(index,
false);
3040 select_vert.
varray.set(index, !select_vert.
varray[index]);
3045 select_vert.
varray.set(index,
true);
3055 if (select_vert.
varray[index]) {
3076 return changed || found;
3110 Object &curves_ob = *base->object;
3113 bke::crazyspace::get_evaluated_curves_deformation(*vc.
depsgraph, curves_ob);
3116 const IndexMask elements(curves.attributes().domain_size(selection_domain));
3117 const auto range_consumer =
3119 IndexMask mask = elements.slice_content(range);
3121 std::optional<ed::curves::FindClosestData> new_closest_elem =
3122 ed::curves::closest_elem_find_screen_space(vc,
3123 curves.points_by_curve(),
3131 if (new_closest_elem) {
3133 new_closest.
elem = *new_closest_elem;
3138 if (selection_domain == bke::AttrDomain::Point) {
3139 ed::curves::foreach_selectable_point_range(curves, deformation, range_consumer);
3141 else if (selection_domain == bke::AttrDomain::Curve) {
3142 ed::curves::foreach_selectable_curve_range(curves, deformation, range_consumer);
3148 return (a.elem.distance <
b.elem.distance) ? a :
b;
3151 std::atomic<bool> deselected =
false;
3154 for (Base *base : bases.as_span().slice(range)) {
3155 Curves &curves_id = *static_cast<Curves *>(base->object->data);
3156 bke::CurvesGeometry &curves = curves_id.geometry.wrap();
3157 if (!ed::curves::has_anything_selected(curves, selection_domain)) {
3161 ed::curves::foreach_selection_attribute_writer(
3162 curves, selection_domain, [](bke::GSpanAttributeWriter &selection) {
3163 ed::curves::fill_selection_false(selection.span);
3169 DEG_id_tag_update(&curves_id.id, ID_RECALC_GEOMETRY);
3170 WM_event_add_notifier(&C, NC_GEOM | ND_DATA, &curves_id);
3175 if (!closest.curves_id) {
3179 if (selection_domain == bke::AttrDomain::Point) {
3181 closest.curves_id->geometry.wrap(),
3182 bke::AttrDomain::Point,
3184 closest.selection_attribute_name);
3185 ed::curves::apply_selection_operation_at_index(
3186 selection.span, closest.elem.index,
params.sel_op);
3189 else if (selection_domain == bke::AttrDomain::Curve) {
3190 ed::curves::foreach_selection_attribute_writer(
3191 closest.curves_id->geometry.wrap(),
3192 bke::AttrDomain::Curve,
3194 ed::curves::apply_selection_operation_at_index(
3195 selection.span, closest.elem.index, params.sel_op);
3233 ed::greasepencil::retrieve_editable_drawings(*vc.
scene, grease_pencil);
3245 for (
const int i :
range) {
3250 bke::crazyspace::get_evaluated_grease_pencil_drawing_deformation(
3253 IndexMaskMemory memory;
3254 const IndexMask elements = ed::greasepencil::retrieve_editable_elements(
3255 *
object, info, selection_domain, memory);
3256 if (elements.is_empty()) {
3259 const IndexMask visible_handle_elements =
3260 ed::greasepencil::retrieve_visible_bezier_handle_elements(
3263 const float4x4 layer_to_world = layer.to_world_space(*ob_eval);
3268 const StringRef selection_attribute_name) {
3269 const IndexMask mask = ((selection_attribute_name ==
".selection") ?
3271 visible_handle_elements)
3272 .slice_content(range);
3274 std::optional<ed::curves::FindClosestData> new_closest_elem =
3275 ed::curves::closest_elem_find_screen_space(vc,
3276 curves.points_by_curve(),
3284 if (new_closest_elem) {
3286 new_closest.
elem = *new_closest_elem;
3292 if (selection_domain == bke::AttrDomain::Point) {
3293 ed::curves::foreach_selectable_point_range(curves, deformation, range_consumer);
3295 else if (selection_domain == bke::AttrDomain::Curve) {
3296 ed::curves::foreach_selectable_curve_range(curves, deformation, range_consumer);
3302 return (a.elem.distance <
b.elem.distance) ? a :
b;
3305 std::atomic<bool> deselected =
false;
3308 for (const int i : range) {
3309 ed::greasepencil::MutableDrawingInfo info = drawings[i];
3310 IndexMaskMemory memory;
3311 const IndexMask elements = ed::greasepencil::retrieve_editable_elements(
3312 *object, info, selection_domain, memory);
3313 if (elements.is_empty()) {
3316 bke::CurvesGeometry &curves = info.drawing.strokes_for_write();
3317 if (!ed::curves::has_anything_selected(curves, selection_domain, elements)) {
3321 ed::curves::foreach_selection_attribute_writer(
3322 curves, selection_domain, [](bke::GSpanAttributeWriter &selection) {
3323 ed::curves::fill_selection_false(selection.span);
3331 if (!closest.drawing) {
3341 const IndexMask selection_mask = IndexRange::from_single(closest.elem.index);
3343 ed::greasepencil::selection_update(&vc,
3348 IndexMaskMemory & ) -> IndexMask {
3351 if (&info.drawing == closest.drawing &&
3352 attribute_name == closest.selection_attribute_name) {
3353 return selection_mask;
3402 bool changed =
false;
3415 if (obedit && enumerate) {
3429 if (obedit && object_only ==
false) {
3527 "Use the object center when selecting, in edit mode used to extend object selection");
3533 "List objects under the mouse (object mode only)");
3536 ot->
srna,
"object",
false,
"Object",
"Use object selection (edit mode only)");
3578 r_data->
rect = rect;
3593 const float screen_co_a[2],
3594 const float screen_co_b[2])
3596 const float radius_squared = radius * radius;
3605 const float screen_co[2],
3611 const bool is_select = mesh_data->
select_vert[index];
3614 if (sel_op_result != -1) {
3615 mesh_data->
select_vert[index] = sel_op_result == 1;
3616 data->is_changed =
true;
3628 if ((mesh ==
nullptr) || (mesh->verts_num == 0)) {
3632 bool changed =
false;
3640 else if (use_zbuf) {
3642 if (wm_userdata->
data ==
nullptr) {
3655 ".select_vert", bke::AttrDomain::Point);
3666 changed |= data.box_data.is_changed;
3689 if ((mesh ==
nullptr) || (mesh->faces_num == 0)) {
3693 bool changed =
false;
3703 if (wm_userdata->
data ==
nullptr) {
3725 bool handles_visible,
3726 const float screen_co[2])
3732 const bool is_select = bp->
f1 &
SELECT;
3734 if (sel_op_result != -1) {
3736 data->is_changed =
true;
3740 if (!handles_visible) {
3742 const bool is_select = bezt->
f2 &
SELECT;
3744 if (sel_op_result != -1) {
3746 data->is_changed =
true;
3748 bezt->
f1 = bezt->
f3 = bezt->
f2;
3751 uint8_t *flag_p = (&bezt->
f1) + beztindex;
3752 const bool is_select = *flag_p &
SELECT;
3754 if (sel_op_result != -1) {
3756 data->is_changed =
true;
3763 const bool deselect_all = (sel_op ==
SEL_OP_SET);
3787 return data.is_changed;
3793 const bool is_select = bp->
f1 &
SELECT;
3796 if (sel_op_result != -1) {
3798 data->is_changed =
true;
3815 return data.is_changed;
3820 const float screen_co[2],
3827 if (sel_op_result != -1) {
3829 data->is_changed =
true;
3842 const float screen_co_a[2],
3843 const float screen_co_b[2],
3849 bool is_visible =
true;
3859 if (sel_op_result != -1) {
3861 data->is_done =
true;
3862 data->is_changed =
true;
3870 const float screen_co_a[2],
3871 const float screen_co_b[2],
3877 bool is_visible =
true;
3886 if (sel_op_result != -1) {
3888 data->is_changed =
true;
3893 const float screen_co[2],
3900 if (sel_op_result != -1) {
3902 data->is_changed =
true;
3918 data.is_changed =
true;
3931 if (wm_userdata->
data ==
nullptr) {
3953 cb_data.esel = use_zbuf ? esel :
nullptr;
3963 if (data.is_done ==
false) {
3984 if (data.is_changed) {
3987 return data.is_changed;
3996 bool changed =
false;
4007 int metaelem_id = 0;
4009 ml = ml->
next, metaelem_id += 0x10000)
4011 bool is_inside_radius =
false;
4012 bool is_inside_stiff =
false;
4014 for (a = 0; a < hits; a++) {
4015 const int hitresult = buffer.
storage[a].id;
4017 if (hitresult == -1) {
4021 const uint hit_object = hitresult & 0xFFFF;
4026 if (metaelem_id != (hitresult & 0xFFFF0000 & ~
MBALLSEL_ANY)) {
4031 is_inside_radius =
true;
4036 is_inside_stiff =
true;
4040 const int flag_prev = ml->
flag;
4041 if (is_inside_radius) {
4044 if (is_inside_stiff) {
4045 ml->
flag &= ~MB_SCALE_RAD;
4049 const bool is_inside = is_inside_radius || is_inside_stiff;
4052 if (sel_op_result != -1) {
4055 changed |= (flag_prev != ml->
flag);
4063 bool changed =
false;
4078 for (
Base *base : bases) {
4079 Object *obedit = base->object;
4080 obedit->
id.
tag &= ~ID_TAG_DOIT;
4087 for (a = 0; a < hits; a++) {
4088 const int select_id = buffer.
storage[a].id;
4089 if (select_id != -1) {
4090 if ((select_id & 0xFFFF0000) == 0) {
4101 for (
Base *base : bases) {
4102 Object *obedit = base->object;
4104 obedit->
id.
tag &= ~ID_TAG_DOIT;
4122#ifdef __BIG_ENDIAN__
4127 if (sel_a < sel_b) {
4130 if (sel_a > sel_b) {
4149 base->object->id.tag &= ~ID_TAG_DOIT;
4154 bool changed =
false;
4166 if ((base->object->runtime->select_id & 0x0000FFFF) != 0) {
4181 if (base !=
nullptr) {
4186 for (
Base *base =
static_cast<Base *
>(object_bases->
first); base && hits; base = base->next) {
4191 if (sel_op_result != -1) {
4242 if (base ==
nullptr) {
4247 for (; buf_iter != buf_end; buf_iter++) {
4249 if (bone !=
nullptr) {
4255 if (buf_iter + 1 != buf_end) {
4257 if ((base->
object->
runtime->select_id & 0x0000FFFF) != (col_next->
id & 0x0000FFFF)) {
4261 const uint hit_bone = (col_next->
id & ~BONESEL_ANY) >> 16;
4264 bone = pchan ? pchan->
bone :
nullptr;
4275 if (changed_multi) {
4280 return changed_multi;
4294 return ed::greasepencil::selection_update(
4298 const IndexMask &mask,
4300 IndexMaskMemory &memory) {
4304 bke::crazyspace::get_evaluated_grease_pencil_drawing_deformation(
4306 const IndexMask visible_handle_elements =
4307 ed::greasepencil::retrieve_visible_bezier_handle_elements(
4309 const float4x4 layer_to_world = layer.to_world_space(*ob_eval);
4313 return ed::curves::select_box_mask(*vc,
4318 visible_handle_elements,
4331 bool changed_multi =
false;
4350 bool changed =
false;
4395 bke::crazyspace::get_evaluated_curves_deformation(*vc.
depsgraph, *vc.
obedit);
4398 const IndexRange elements(curves.attributes().domain_size(selection_domain));
4399 changed = ed::curves::select_box(vc,
4424 changed_multi |= changed;
4446 if (changed_multi) {
4452 if (changed_multi) {
4460 if (changed_multi) {
4471 ot->
idname =
"VIEW3D_OT_select_box";
4531 const float screen_co[2],
4538 data->is_changed =
true;
4543 const float screen_co_a[2],
4544 const float screen_co_b[2],
4551 data->is_changed =
true;
4556 const float screen_co[2],
4563 data->is_changed =
true;
4577 bool changed =
false;
4596 if (wm_userdata->
data ==
nullptr) {
4649 changed |= data.is_changed;
4668 bool changed =
false;
4674 if (wm_userdata->
data ==
nullptr) {
4700 const float screen_co[2],
4709 data->is_changed =
true;
4725 bool changed =
false;
4734 if (wm_userdata->
data ==
nullptr) {
4752 ".select_vert", bke::AttrDomain::Point);
4762 changed |= data.circle_data.is_changed;
4782 const float screen_co[2])
4791 if (beztindex == 0) {
4794 else if (beztindex == 1) {
4801 data->is_changed =
true;
4810 const bool deselect_all = (sel_op ==
SEL_OP_SET);
4834 return data.is_changed;
4842 bp->
f1 = data->select ? (bp->
f1 |
SELECT) : (bp->
f1 & ~SELECT);
4843 data->is_changed =
true;
4863 return data.is_changed;
4871 const float screen_co[2])
4880 pchan->
bone->
flag &= ~BONE_SELECTED;
4888 const float screen_co_a[2],
4889 const float screen_co_b[2])
4897 bool is_point_done =
false;
4898 int points_proj_tot = 0;
4904 is_point_done =
true;
4912 is_point_done =
true;
4923 if ((is_point_done ==
false) && (points_proj_tot == 2) &&
4930 pchan->
bone->
flag &= ~BONE_SELECTED;
4932 data->is_changed =
true;
4935 data->is_changed |= is_point_done;
4960 if (data.is_changed) {
4963 return data.is_changed;
4971 const float screen_co[2],
4982 ebone->
flag &= ~BONE_ROOTSEL;
4990 ebone->
flag &= ~BONE_TIPSEL;
4999 const float screen_co_a[2],
5000 const float screen_co_b[2])
5009 ebone->
temp.
i =
false;
5011 bool is_point_done =
false;
5012 bool is_edge_done =
false;
5013 int points_proj_tot = 0;
5019 is_point_done =
true;
5027 is_point_done =
true;
5038 if ((is_point_done ==
false) && (points_proj_tot == 2) &&
5042 is_edge_done =
true;
5043 data->is_changed =
true;
5046 if (is_point_done || is_edge_done) {
5047 ebone->
temp.
i =
true;
5050 data->is_changed |= is_point_done;
5054 const float screen_co_a[2],
5055 const float screen_co_b[2])
5065 if (ebone->
temp.
i != 0) {
5071 data->is_changed =
true;
5104 if (data.is_changed) {
5108 return data.is_changed;
5113 const float screen_co[2])
5122 ml->
flag &= ~SELECT;
5124 data->is_changed =
true;
5146 return data.is_changed;
5161 return ed::greasepencil::selection_update(
5165 const IndexMask &mask,
5167 IndexMaskMemory &memory) {
5171 bke::crazyspace::get_evaluated_grease_pencil_drawing_deformation(
5173 const IndexMask visible_handle_elements =
5174 ed::greasepencil::retrieve_visible_bezier_handle_elements(
5176 const float4x4 layer_to_world = layer.to_world_space(*ob_eval);
5180 return ed::curves::select_circle_mask(*vc,
5185 visible_handle_elements,
5205 bool changed =
false;
5231 bke::crazyspace::get_evaluated_curves_deformation(*vc->
depsgraph, *vc->
obedit);
5234 const IndexRange elements(curves.attributes().domain_size(selection_domain));
5235 changed = ed::curves::select_circle(*vc,
5279 const float radius_squared = rad * rad;
5280 const float mval_fl[2] = {
float(mval[0]),
float(mval[1])};
5282 bool changed =
false;
5293 base->object->object_to_world().location(),
5315 if (obedit_active) {
5316 switch (obedit_active->
type) {
5375 if (obedit ==
nullptr) {
5441 if (wm_userdata == &wm_userdata_buf) {
5457 ot->
name =
"Circle Select";
5459 ot->
idname =
"VIEW3D_OT_select_circle";
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)
#define LISTBASE_FOREACH(type, var, list)
void BLI_freelinkN(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define LISTBASE_FOREACH_INDEX(type, var, list, index_var)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
void void BLI_listbase_sort(struct ListBase *listbase, int(*cmp)(const void *, const void *)) ATTR_NONNULL(1
void BLI_addtail(struct ListBase *listbase, void *vlink) 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)
void DEG_id_tag_update(ID *id, unsigned int flags)
Object * DEG_get_evaluated_object(const Depsgraph *depsgraph, Object *object)
#define GPENCIL_ANY_MODE(gpd)
#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)
@ USER_GPU_FLAG_NO_DEPT_PICK
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_VISIBLE(arm, ebone)
#define EBONE_SELECTABLE(arm, ebone)
bool ED_lattice_select_pick(bContext *C, const int mval[2], const SelectPick_Params *params)
bool ED_lattice_flags_set(Object *obedit, int flag)
bool ED_mball_select_pick(bContext *C, const int mval[2], const SelectPick_Params *params)
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)
bool paintface_mouse_select(bContext *C, const int mval[2], const SelectPick_Params *params, Object *ob)
void paintface_flush_flags(bContext *C, Object *ob, bool flush_selection, bool flush_hidden)
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 *params)
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_mouse_particles(bContext *C, const int mval[2], const SelectPick_Params *params)
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)
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)
#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)
void ED_select_pick_params_from_operator(PointerRNA *ptr, SelectPick_Params *params) ATTR_NONNULL(1
eSelectOp ED_select_op_from_operator(PointerRNA *ptr) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT
#define SEL_OP_USE_OUTSIDE(sel_op)
void std::string ED_select_pick_get_name(wmOperatorType *ot, PointerRNA *ptr)
void view3d_opengl_select_cache_begin()
#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)
@ 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 ED_view3d_init_mats_rv3d(const Object *ob, RegionView3D *rv3d)
void lattice_foreachScreenVert(const ViewContext *vc, void(*func)(void *user_data, BPoint *bp, const float screen_co[2]), void *user_data, eV3DProjTest clip_flag)
int view3d_opengl_select(const ViewContext *vc, GPUSelectBuffer *buffer, const rcti *input, eV3DSelectMode select_mode, eV3DSelectObjectFilter select_filter)
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)
void view3d_operator_needs_opengl(const bContext *C)
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
eV3DProjStatus ED_view3d_project_base(const ARegion *region, Base *base, float r_co[2])
@ VIEW3D_SELECT_PICK_NEAREST
int view3d_opengl_select_ex(const ViewContext *vc, GPUSelectBuffer *buffer, const rcti *input, eV3DSelectMode select_mode, eV3DSelectObjectFilter select_filter, bool do_material_slot_selection)
#define XRAY_FLAG_ENABLED(v3d)
blender::float4x4 ED_view3d_ob_project_mat_get_from_obmat(const RegionView3D *rv3d, const blender::float4x4 &obmat)
void view3d_opengl_select_cache_end()
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)
Contains defines and structs used throughout the imbuf module.
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)
bool ED_armature_edit_select_pick_bone(bContext *C, Base *basact, EditBone *ebone, const int selmask, const SelectPick_Params *params)
Base * ED_armature_base_and_pchan_from_select_buffer(const Span< Base * > bases, const uint select_id, bPoseChannel **r_pchan)
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_op_from_tagged(bArmature *arm, const int sel_op)
bool ED_armature_edit_select_pick(bContext *C, const int mval[2], const SelectPick_Params *params)
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)
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
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
constexpr Span slice(int64_t start, int64_t size) 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
bke::CurvesGeometry & strokes_for_write()
const bke::CurvesGeometry & strokes() const
local_group_size(16, 16) .push_constant(Type b
const Depsgraph * depsgraph
bool ED_curve_editnurb_select_pick(bContext *C, const int mval[2], const int dist_px, const SelectPick_Params *params)
bool ED_curve_editfont_select_pick(bContext *C, const int mval[2], const SelectPick_Params *params)
draw_view in_light_buf[] float
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
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)
void MEM_freeN(void *vmemh)
ccl_device_inline float4 select(const int4 mask, const float4 a, const float4 b)
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)
void ED_armature_pose_select_in_wpaint_mode(const Scene *scene, ViewLayer *view_layer, Base *base_select)
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 *params, bool do_nearest)
bool ED_armature_pose_select_pick_bone(const Scene *scene, ViewLayer *view_layer, View3D *v3d, Object *ob, Bone *bone, const SelectPick_Params *params)
void ED_pose_bone_select_tag_update(Object *ob)
bool ED_pose_deselect_all(Object *ob, int select_mode, const bool ignore_visibility)
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
BLI_bitmap * select_bitmap
eBezTriple_Flag select_flag
ObjectRuntimeHandle * runtime
struct ToolSettings * toolsettings
VMutableArray< T > varray
MutableVArraySpan< T > span
bke::greasepencil::Drawing & drawing
wmGenericUserDataFreeFn free_fn
wmGenericUserData user_data
bool(* poll)(bContext *C) ATTR_WARN_UNUSED_RESULT
int(* modal)(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
std::string(* get_name)(wmOperatorType *ot, PointerRNA *ptr)
int(* invoke)(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
int(* exec)(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
void(* cancel)(bContext *C, wmOperator *op)
static bool edbm_backbuf_check_and_select_faces_obmode(Mesh *mesh, EditSelectBuf_Cache *esel, const eSelectOp sel_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 bool ed_object_select_pick_camera_track(bContext *C, Scene *scene, Base *basact, MovieClip *clip, const GPUSelectBuffer &buffer, const short hits, const SelectPick_Params *params)
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 bone_mouse_select_menu(bContext *C, const blender::Span< GPUSelectResult > hit_results, const bool is_editmode, const SelectPick_Params *params)
static bool pose_circle_select(const ViewContext *vc, const eSelectOp sel_op, const int mval[2], float rad)
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 int view3d_box_select_exec(bContext *C, wmOperator *op)
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 int view3d_lasso_select_exec(bContext *C, wmOperator *op)
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)
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 bool object_mouse_select_menu(bContext *C, const ViewContext *vc, const blender::Span< GPUSelectResult > hit_results, const int mval[2], const SelectPick_Params *params, Base **r_basact)
static int view3d_circle_select_exec(bContext *C, wmOperator *op)
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 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 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 int view3d_circle_select_modal(bContext *C, wmOperator *op, const wmEvent *event)
static SelMenuItemF object_mouse_select_menu_data[SEL_MENU_SIZE]
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_if_supported, const bool do_material_slot_selection)
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 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 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 int selectbuffer_ret_hits_15(blender::MutableSpan< GPUSelectResult >, const int hits15)
static bool ed_object_select_pick(bContext *C, const int mval[2], const SelectPick_Params *params, const bool center, const bool enumerate, const bool object_only)
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 int object_select_menu_exec(bContext *C, wmOperator *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 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 bool mesh_circle_select(const ViewContext *vc, wmGenericUserData *wm_userdata, eSelectOp sel_op, const int mval[2], float rad)
static bool ed_wpaint_vertex_select_pick(bContext *C, const int mval[2], const SelectPick_Params *params, Object *obact)
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])
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 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 opengl_bone_select_buffer_cmp(const void *sel_a_p, const void *sel_b_p)
static int view3d_select_invoke(bContext *C, wmOperator *op, const wmEvent *event)
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 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 int bone_select_menu_exec(bContext *C, wmOperator *op)
static bool pchan_circle_doSelectJoint(void *user_data, bPoseChannel *pchan, const float screen_co[2])
static int view3d_select_exec(bContext *C, wmOperator *op)
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)
int 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)
int WM_gesture_box_invoke(bContext *C, wmOperator *op, const wmEvent *event)
int WM_gesture_circle_invoke(bContext *C, wmOperator *op, const wmEvent *event)
Array< int2 > WM_gesture_lasso_path_to_array(bContext *, wmOperator *op)
void WM_gesture_circle_cancel(bContext *C, wmOperator *op)
int WM_gesture_box_modal(bContext *C, wmOperator *op, const wmEvent *event)
int WM_gesture_circle_modal(bContext *C, wmOperator *op, const wmEvent *event)
int WM_gesture_lasso_modal(bContext *C, wmOperator *op, const wmEvent *event)
void WM_gesture_lasso_cancel(bContext *C, wmOperator *op)
int 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)
int WM_operator_flag_only_pass_through_on_press(int retval, const wmEvent *event)
int 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)