Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_snap.c
| Show First 20 Lines • Show All 322 Lines • ▼ Show 20 Lines | FOREACH_TRANS_DATA_CONTAINER (t, tc) { | ||||
| t->tsnap.object_context, | t->tsnap.object_context, | ||||
| 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, | .use_object_edit_cage = (t->flag & T_EDIT) != 0, | ||||
| .use_occlusion_test = false, | .use_occlusion_test = false, | ||||
| }, | }, | ||||
| mval_fl, | mval_fl, | ||||
| NULL, | |||||
| 0, | 0, | ||||
| loc, | loc, | ||||
| no)) { | no)) { | ||||
| #if 0 | #if 0 | ||||
| if (tc->use_local_mat) { | if (tc->use_local_mat) { | ||||
| mul_m4_v3(tc->imat, loc); | mul_m4_v3(tc->imat, loc); | ||||
| } | } | ||||
| #endif | #endif | ||||
| ▲ Show 20 Lines • Show All 655 Lines • ▼ Show 20 Lines | if (t->spacetype == SPACE_VIEW3D) { | ||||
| float mval[2]; | float mval[2]; | ||||
| bool found = false; | bool found = false; | ||||
| float dist_px = SNAP_MIN_DISTANCE; // Use a user defined value here | float dist_px = SNAP_MIN_DISTANCE; // Use a user defined value here | ||||
| mval[0] = t->mval[0]; | mval[0] = t->mval[0]; | ||||
| mval[1] = t->mval[1]; | mval[1] = t->mval[1]; | ||||
| if (t->tsnap.mode & (SCE_SNAP_MODE_VERTEX | SCE_SNAP_MODE_EDGE | SCE_SNAP_MODE_FACE | | if (t->tsnap.mode & (SCE_SNAP_MODE_VERTEX | SCE_SNAP_MODE_EDGE | SCE_SNAP_MODE_FACE | | ||||
| SCE_SNAP_MODE_EDGE_MIDPOINT)) { | SCE_SNAP_MODE_EDGE_MIDPOINT | SCE_SNAP_MODE_EDGE_PERPENDICULAR)) { | ||||
| zero_v3(no); /* objects won't set this */ | zero_v3(no); /* objects won't set this */ | ||||
| found = snapObjectsTransform(t, mval, &dist_px, loc, no); | found = snapObjectsTransform(t, mval, &dist_px, loc, no); | ||||
| } | } | ||||
| if ((found == false) && (t->tsnap.mode & SCE_SNAP_MODE_VOLUME)) { | if ((found == false) && (t->tsnap.mode & SCE_SNAP_MODE_VOLUME)) { | ||||
| found = peelObjectsTransform( | found = peelObjectsTransform( | ||||
| t, mval, (t->settings->snap_flag & SCE_SNAP_PEEL_OBJECT) != 0, loc, no, NULL); | t, mval, (t->settings->snap_flag & SCE_SNAP_PEEL_OBJECT) != 0, loc, no, NULL); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 256 Lines • ▼ Show 20 Lines | return ED_transform_snap_object_project_view3d( | ||||
| t->tsnap.object_context, | t->tsnap.object_context, | ||||
| t->scene->toolsettings->snap_mode, | t->scene->toolsettings->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, | .use_object_edit_cage = (t->flag & T_EDIT) != 0, | ||||
| .use_occlusion_test = t->scene->toolsettings->snap_mode != SCE_SNAP_MODE_FACE, | .use_occlusion_test = t->scene->toolsettings->snap_mode != SCE_SNAP_MODE_FACE, | ||||
| }, | }, | ||||
| mval, | mval, | ||||
| t->center_global, | |||||
| dist_px, | dist_px, | ||||
| r_loc, | r_loc, | ||||
| r_no); | r_no); | ||||
| } | } | ||||
| /******************** PEELING *********************************/ | /******************** PEELING *********************************/ | ||||
| bool peelObjectsSnapContext(SnapObjectContext *sctx, | bool peelObjectsSnapContext(SnapObjectContext *sctx, | ||||
| ▲ Show 20 Lines • Show All 366 Lines • Show Last 20 Lines | |||||