Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_snap.c
| Show First 20 Lines • Show All 339 Lines • ▼ Show 20 Lines | for (i = 0; i < tc->data_len; i++, td++) { | ||||
| if (ED_view3d_project_float_global(t->region, iloc, mval_fl, V3D_PROJ_TEST_NOP) == | if (ED_view3d_project_float_global(t->region, iloc, mval_fl, 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( | ||||
| t->tsnap.object_context, | t->tsnap.object_context, | ||||
| t->depsgraph, | t->depsgraph, | ||||
| SCE_SNAP_MODE_FACE, | SCE_SNAP_MODE_FACE, | ||||
| &(const struct SnapObjectParams){ | &(const struct SnapObjectParams){ | ||||
| .snap_select = t->tsnap.modeSelect, | .snap_select = t->tsnap.modeSelect, | ||||
| .use_object_edit_cage = (t->flag & T_EDIT) != 0, | .edit_mode_type = (t->flag & T_EDIT) != 0 ? SNAP_GEOM_EDIT : SNAP_GEOM_FINAL, | ||||
| .use_occlusion_test = false, | .use_occlusion_test = false, | ||||
| .use_backface_culling = t->tsnap.use_backface_culling, | .use_backface_culling = t->tsnap.use_backface_culling, | ||||
| }, | }, | ||||
| mval_fl, | mval_fl, | ||||
| NULL, | NULL, | ||||
| 0, | 0, | ||||
| loc, | loc, | ||||
| no)) { | no)) { | ||||
| ▲ Show 20 Lines • Show All 805 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| float *target = (t->tsnap.status & TARGET_INIT) ? t->tsnap.snapTarget : t->center_global; | float *target = (t->tsnap.status & TARGET_INIT) ? t->tsnap.snapTarget : t->center_global; | ||||
| return ED_transform_snap_object_project_view3d_ex( | return ED_transform_snap_object_project_view3d_ex( | ||||
| t->tsnap.object_context, | t->tsnap.object_context, | ||||
| t->depsgraph, | t->depsgraph, | ||||
| t->settings->snap_mode, | t->settings->snap_mode, | ||||
| &(const struct SnapObjectParams){ | &(const struct SnapObjectParams){ | ||||
| .snap_select = t->tsnap.modeSelect, | .snap_select = t->tsnap.modeSelect, | ||||
| .use_object_edit_cage = (t->flag & T_EDIT) != 0, | .edit_mode_type = (t->flag & T_EDIT) != 0 ? SNAP_GEOM_EDIT : SNAP_GEOM_FINAL, | ||||
| .use_occlusion_test = t->settings->snap_mode != SCE_SNAP_MODE_FACE, | .use_occlusion_test = t->settings->snap_mode != SCE_SNAP_MODE_FACE, | ||||
| .use_backface_culling = t->tsnap.use_backface_culling, | .use_backface_culling = t->tsnap.use_backface_culling, | ||||
| }, | }, | ||||
| mval, | mval, | ||||
| target, | target, | ||||
| dist_px, | dist_px, | ||||
| r_loc, | r_loc, | ||||
| r_no, | r_no, | ||||
| Show All 17 Lines | bool peelObjectsTransform(TransInfo *t, | ||||
| float *r_thickness) | float *r_thickness) | ||||
| { | { | ||||
| ListBase depths_peel = {0}; | ListBase depths_peel = {0}; | ||||
| ED_transform_snap_object_project_all_view3d_ex( | ED_transform_snap_object_project_all_view3d_ex( | ||||
| t->tsnap.object_context, | t->tsnap.object_context, | ||||
| t->depsgraph, | t->depsgraph, | ||||
| &(const struct SnapObjectParams){ | &(const struct SnapObjectParams){ | ||||
| .snap_select = t->tsnap.modeSelect, | .snap_select = t->tsnap.modeSelect, | ||||
| .use_object_edit_cage = (t->flag & T_EDIT) != 0, | .edit_mode_type = (t->flag & T_EDIT) != 0 ? SNAP_GEOM_EDIT : SNAP_GEOM_FINAL, | ||||
| }, | }, | ||||
| mval, | mval, | ||||
| -1.0f, | -1.0f, | ||||
| false, | false, | ||||
| &depths_peel); | &depths_peel); | ||||
| if (!BLI_listbase_is_empty(&depths_peel)) { | if (!BLI_listbase_is_empty(&depths_peel)) { | ||||
| /* At the moment we only use the hits of the first object */ | /* At the moment we only use the hits of the first object */ | ||||
| ▲ Show 20 Lines • Show All 393 Lines • Show Last 20 Lines | |||||