Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_snap_object.cc
| Show First 20 Lines • Show All 3,041 Lines • ▼ Show 20 Lines | |||||
| void ED_transform_snap_object_context_set_editmesh_callbacks( | void ED_transform_snap_object_context_set_editmesh_callbacks( | ||||
| SnapObjectContext *sctx, | SnapObjectContext *sctx, | ||||
| bool (*test_vert_fn)(BMVert *, void *user_data), | bool (*test_vert_fn)(BMVert *, void *user_data), | ||||
| bool (*test_edge_fn)(BMEdge *, void *user_data), | bool (*test_edge_fn)(BMEdge *, void *user_data), | ||||
| bool (*test_face_fn)(BMFace *, void *user_data), | bool (*test_face_fn)(BMFace *, void *user_data), | ||||
| void *user_data) | void *user_data) | ||||
| { | { | ||||
| bool is_cache_dirty = false; | |||||
| if (sctx->callbacks.edit_mesh.test_vert_fn != test_vert_fn) { | |||||
| sctx->callbacks.edit_mesh.test_vert_fn = test_vert_fn; | sctx->callbacks.edit_mesh.test_vert_fn = test_vert_fn; | ||||
| is_cache_dirty = true; | |||||
| } | |||||
| if (sctx->callbacks.edit_mesh.test_edge_fn != test_edge_fn) { | |||||
| sctx->callbacks.edit_mesh.test_edge_fn = test_edge_fn; | sctx->callbacks.edit_mesh.test_edge_fn = test_edge_fn; | ||||
| is_cache_dirty = true; | |||||
| } | |||||
| if (sctx->callbacks.edit_mesh.test_face_fn != test_face_fn) { | |||||
| sctx->callbacks.edit_mesh.test_face_fn = test_face_fn; | sctx->callbacks.edit_mesh.test_face_fn = test_face_fn; | ||||
| is_cache_dirty = true; | |||||
| } | |||||
| if (sctx->callbacks.edit_mesh.user_data != user_data) { | |||||
| sctx->callbacks.edit_mesh.user_data = user_data; | sctx->callbacks.edit_mesh.user_data = user_data; | ||||
| is_cache_dirty = true; | |||||
| } | |||||
| if (is_cache_dirty) { | |||||
| sctx->editmesh_caches.clear(); | |||||
| } | |||||
| } | } | ||||
| bool ED_transform_snap_object_project_ray_ex(SnapObjectContext *sctx, | bool ED_transform_snap_object_project_ray_ex(SnapObjectContext *sctx, | ||||
| Depsgraph *depsgraph, | Depsgraph *depsgraph, | ||||
| const View3D *v3d, | const View3D *v3d, | ||||
| const SnapObjectParams *params, | const SnapObjectParams *params, | ||||
| const float ray_start[3], | const float ray_start[3], | ||||
| const float ray_normal[3], | const float ray_normal[3], | ||||
| ▲ Show 20 Lines • Show All 423 Lines • Show Last 20 Lines | |||||