Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_snap.c
| Show First 20 Lines • Show All 497 Lines • ▼ Show 20 Lines | static bool bm_face_is_snap_target(BMFace *f, void *UNUSED(user_data)) | ||||
| return true; | return true; | ||||
| } | } | ||||
| static void initSnappingMode(TransInfo *t) | static void initSnappingMode(TransInfo *t) | ||||
| { | { | ||||
| ToolSettings *ts = t->settings; | ToolSettings *ts = t->settings; | ||||
| Object *obedit = t->obedit; | Object *obedit = t->obedit; | ||||
| SceneLayer *sl = t->scene_layer; | ViewLayer *sl = t->view_layer; | ||||
| Base *base_act = sl->basact; | Base *base_act = sl->basact; | ||||
| if (t->spacetype == SPACE_NODE) { | if (t->spacetype == SPACE_NODE) { | ||||
| /* force project off when not supported */ | /* force project off when not supported */ | ||||
| t->tsnap.project = 0; | t->tsnap.project = 0; | ||||
| t->tsnap.mode = ts->snap_node_mode; | t->tsnap.mode = ts->snap_node_mode; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 65 Lines • ▼ Show 20 Lines | static void initSnappingMode(TransInfo *t) | ||||
| else { | else { | ||||
| /* Always grid outside of 3D view */ | /* Always grid outside of 3D view */ | ||||
| t->tsnap.mode = SCE_SNAP_MODE_INCREMENT; | t->tsnap.mode = SCE_SNAP_MODE_INCREMENT; | ||||
| } | } | ||||
| if (t->spacetype == SPACE_VIEW3D) { | if (t->spacetype == SPACE_VIEW3D) { | ||||
| if (t->tsnap.object_context == NULL) { | if (t->tsnap.object_context == NULL) { | ||||
| t->tsnap.object_context = ED_transform_snap_object_context_create_view3d( | t->tsnap.object_context = ED_transform_snap_object_context_create_view3d( | ||||
| G.main, t->scene, t->scene_layer, t->engine, 0, | G.main, t->scene, t->view_layer, t->engine, 0, | ||||
| t->ar, t->view); | t->ar, t->view); | ||||
| ED_transform_snap_object_context_set_editmesh_callbacks( | ED_transform_snap_object_context_set_editmesh_callbacks( | ||||
| t->tsnap.object_context, | t->tsnap.object_context, | ||||
| (bool (*)(BMVert *, void *))BM_elem_cb_check_hflag_disabled, | (bool (*)(BMVert *, void *))BM_elem_cb_check_hflag_disabled, | ||||
| bm_edge_is_snap_target, | bm_edge_is_snap_target, | ||||
| bm_face_is_snap_target, | bm_face_is_snap_target, | ||||
| SET_UINT_IN_POINTER((BM_ELEM_SELECT | BM_ELEM_HIDDEN))); | SET_UINT_IN_POINTER((BM_ELEM_SELECT | BM_ELEM_HIDDEN))); | ||||
| ▲ Show 20 Lines • Show All 929 Lines • Show Last 20 Lines | |||||