WIP: uv-simple-select #1

Closed
Chris Blackbourn wants to merge 182 commits from uv-simple-select into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Showing only changes of commit 528f9c467d - Show all commits

View File

@ -1924,31 +1924,40 @@ void EDBM_project_snap_verts(
ED_view3d_init_mats_rv3d(obedit, region->regiondata); ED_view3d_init_mats_rv3d(obedit, region->regiondata);
struct SnapObjectContext *snap_context = ED_transform_snap_object_context_create( Scene *scene = CTX_data_scene(C);
CTX_data_scene(C), 0); struct SnapObjectContext *snap_context = ED_transform_snap_object_context_create(scene, 0);
eSnapTargetOP target_op = SCE_SNAP_TARGET_NOT_ACTIVE;
const int snap_flag = scene->toolsettings->snap_flag;
SET_FLAG_FROM_TEST(
target_op, !(snap_flag & SCE_SNAP_TO_INCLUDE_EDITED), SCE_SNAP_TARGET_NOT_EDITED);
SET_FLAG_FROM_TEST(
target_op, !(snap_flag & SCE_SNAP_TO_INCLUDE_NONEDITED), SCE_SNAP_TARGET_NOT_NONEDITED);
SET_FLAG_FROM_TEST(
target_op, (snap_flag & SCE_SNAP_TO_ONLY_SELECTABLE), SCE_SNAP_TARGET_ONLY_SELECTABLE);
BM_ITER_MESH (eve, &iter, em->bm, BM_VERTS_OF_MESH) { BM_ITER_MESH (eve, &iter, em->bm, BM_VERTS_OF_MESH) {
if (BM_elem_flag_test(eve, BM_ELEM_SELECT)) { if (BM_elem_flag_test(eve, BM_ELEM_SELECT)) {
float mval[2], co_proj[3]; float mval[2], co_proj[3];
if (ED_view3d_project_float_object(region, eve->co, mval, V3D_PROJ_TEST_NOP) == if (ED_view3d_project_float_object(region, eve->co, mval, V3D_PROJ_TEST_NOP) ==
V3D_PROJ_RET_OK) { V3D_PROJ_RET_OK) {
if (ED_transform_snap_object_project_view3d( if (ED_transform_snap_object_project_view3d(snap_context,
snap_context, depsgraph,
depsgraph, region,
region, CTX_wm_view3d(C),
CTX_wm_view3d(C), SCE_SNAP_MODE_FACE_RAYCAST,
SCE_SNAP_MODE_FACE_RAYCAST, &(const struct SnapObjectParams){
&(const struct SnapObjectParams){ .snap_target_select = target_op,
.snap_target_select = SCE_SNAP_TARGET_NOT_ACTIVE, .edit_mode_type = SNAP_GEOM_FINAL,
.edit_mode_type = SNAP_GEOM_FINAL, .use_occlusion_test = true,
.use_occlusion_test = true, },
}, NULL,
NULL, mval,
mval, NULL,
NULL, NULL,
NULL, co_proj,
co_proj, NULL)) {
NULL)) {
mul_v3_m4v3(eve->co, obedit->world_to_object, co_proj); mul_v3_m4v3(eve->co, obedit->world_to_object, co_proj);
} }
} }