forked from blender/blender
me-main #1
@ -1924,22 +1924,31 @@ 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 = SCE_SNAP_TARGET_NOT_ACTIVE,
|
.snap_target_select = target_op,
|
||||||
.edit_mode_type = SNAP_GEOM_FINAL,
|
.edit_mode_type = SNAP_GEOM_FINAL,
|
||||||
.use_occlusion_test = true,
|
.use_occlusion_test = true,
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user