Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_snap_object.c
| Show First 20 Lines • Show All 1,376 Lines • ▼ Show 20 Lines | static short snap_mesh_edge_verts_mixed(SnapObjectContext *sctx, | ||||
| }; | }; | ||||
| BVHTreeNearest nearest = { | BVHTreeNearest nearest = { | ||||
| .index = -1, | .index = -1, | ||||
| .dist_sq = SQUARE(original_dist_px), | .dist_sq = SQUARE(original_dist_px), | ||||
| }; | }; | ||||
| SnapObjectData *sod = BLI_ghash_lookup(sctx->cache.object_map, ob); | SnapObjectData *sod = BLI_ghash_lookup(sctx->cache.object_map, ob); | ||||
| if (sod == NULL) { | |||||
| /* The object is in edit mode, and the key used | |||||
| * was the object referenced in BMEditMesh */ | |||||
| BMEditMesh *em = BKE_editmesh_from_object(ob); | |||||
| sod = BLI_ghash_lookup(sctx->cache.object_map, em->ob); | |||||
| } | |||||
| BLI_assert(sod != NULL); | BLI_assert(sod != NULL); | ||||
| if (sod->type == SNAP_MESH) { | if (sod->type == SNAP_MESH) { | ||||
| nearest2d.userdata = &((SnapObjectData_Mesh *)sod)->treedata; | nearest2d.userdata = &((SnapObjectData_Mesh *)sod)->treedata; | ||||
| nearest2d.get_vert_co = (Nearest2DGetVertCoCallback)cb_mvert_co_get; | nearest2d.get_vert_co = (Nearest2DGetVertCoCallback)cb_mvert_co_get; | ||||
| nearest2d.get_edge_verts_index = (Nearest2DGetEdgeVertsCallback)cb_medge_verts_get; | nearest2d.get_edge_verts_index = (Nearest2DGetEdgeVertsCallback)cb_medge_verts_get; | ||||
| nearest2d.copy_vert_no = (Nearest2DCopyVertNoCallback)cb_mvert_no_copy; | nearest2d.copy_vert_no = (Nearest2DCopyVertNoCallback)cb_mvert_no_copy; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 1,497 Lines • Show Last 20 Lines | |||||