Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_view3d/view3d_ruler.c
| Context not available. | |||||
| } | } | ||||
| else if (state == RULER_STATE_DRAG) { | else if (state == RULER_STATE_DRAG) { | ||||
| ruler_info->snap_context = ED_transform_snap_object_context_create_view3d( | ruler_info->snap_context = ED_transform_snap_object_context_create_view3d( | ||||
| CTX_data_main(C), CTX_data_scene(C), CTX_data_scene_layer(C), 0, | CTX_data_main(C), CTX_data_scene(C), CTX_data_scene_layer(C), SNAP_ALL, true, | ||||
| ruler_info->ar, CTX_wm_view3d(C)); | ruler_info->ar, CTX_wm_view3d(C), MVAL_MAX_PX_DIST * U.pixelsize); | ||||
| } | } | ||||
| else { | else { | ||||
| BLI_assert(0); | BLI_assert(0); | ||||
| Context not available. | |||||
| if (ED_transform_snap_object_project_view3d_mixed( | if (ED_transform_snap_object_project_view3d_mixed( | ||||
| ruler_info->snap_context, | ruler_info->snap_context, | ||||
| SCE_SELECT_FACE, | SCE_SELECT_FACE, | ||||
| &(const struct SnapObjectParams){ | |||||
| .snap_select = SNAP_ALL, | |||||
| .use_object_edit_cage = true, | |||||
| }, | |||||
| mval_fl, &dist_px, true, | mval_fl, &dist_px, true, | ||||
| co, ray_normal)) | co, ray_normal)) | ||||
| { | { | ||||
| Context not available. | |||||
| madd_v3_v3v3fl(ray_start, co, ray_normal, eps_bias); | madd_v3_v3v3fl(ray_start, co, ray_normal, eps_bias); | ||||
| ED_transform_snap_object_project_ray( | ED_transform_snap_object_project_ray( | ||||
| ruler_info->snap_context, | ruler_info->snap_context, | ||||
| &(const struct SnapObjectParams){ | |||||
| .snap_select = SNAP_ALL, | |||||
| .use_object_edit_cage = true, | |||||
| }, | |||||
| ray_start, ray_normal, NULL, | ray_start, ray_normal, NULL, | ||||
| co_other, NULL); | co_other, NULL); | ||||
| } | } | ||||
| Context not available. | |||||
| if (ED_transform_snap_object_project_view3d_mixed( | if (ED_transform_snap_object_project_view3d_mixed( | ||||
| ruler_info->snap_context, | ruler_info->snap_context, | ||||
| (SCE_SELECT_VERTEX | SCE_SELECT_EDGE) | (use_depth ? SCE_SELECT_FACE : 0), | (SCE_SELECT_VERTEX | SCE_SELECT_EDGE) | (use_depth ? SCE_SELECT_FACE : 0), | ||||
| &(const struct SnapObjectParams){ | |||||
| .snap_select = SNAP_ALL, | |||||
| .use_object_edit_cage = true, | |||||
| }, | |||||
| mval_fl, &dist_px, use_depth, | mval_fl, &dist_px, use_depth, | ||||
| co, NULL)) | co, NULL)) | ||||
| { | { | ||||
| Context not available. | |||||