diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2022-04-25 18:31:13 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2022-04-25 18:35:55 +0300 |
commit | 35dc4ba9e23ac37a22fee49c813aee2a6a2d3e61 (patch) | |
tree | 7eb4bc2715a5ea16c33fb4b37be20117c51c7651 /source/blender/editors/transform/transform_snap_object.cc | |
parent | 696370380145e6f89e79c1e3dc12203077ef3e45 (diff) |
Fix T97401: Snap options ignored for Nurbs surfaces
The editing data of a `SURF`s is similar to that of Curves and should be supported for snapping.
But unlike Curve objects, for snapping, only support the nurb points if the object is in edit mode.
This matches the solution for Meshes and avoids having to create a kind
of "boundbox" for the SURF nurb points.
Diffstat (limited to 'source/blender/editors/transform/transform_snap_object.cc')
-rw-r--r-- | source/blender/editors/transform/transform_snap_object.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/editors/transform/transform_snap_object.cc b/source/blender/editors/transform/transform_snap_object.cc index abeb376a9a6..f533b2c298c 100644 --- a/source/blender/editors/transform/transform_snap_object.cc +++ b/source/blender/editors/transform/transform_snap_object.cc @@ -2746,6 +2746,14 @@ static void snap_obj_fn(SnapObjectContext *sctx, sctx, params, ob_eval, obmat, dt->dist_px, dt->r_loc, dt->r_no, dt->r_index); break; /* Use ATTR_FALLTHROUGH if we want to snap to the generated mesh. */ case OB_SURF: + if (BKE_object_is_in_editmode(ob_eval)) { + retval = snapCurve( + sctx, params, ob_eval, obmat, dt->dist_px, dt->r_loc, dt->r_no, dt->r_index); + if (params->edit_mode_type != SNAP_GEOM_FINAL) { + break; + } + } + ATTR_FALLTHROUGH; case OB_FONT: { const Mesh *mesh_eval = BKE_object_get_evaluated_mesh(ob_eval); if (mesh_eval) { |