Fix #119716: snap in curve editing when mesh is generated by Geometry Nodes

In these cases, the Mesh is defined as an instance of the object.
These instances need to be ignored when in edit mode.
This commit is contained in:
Germano Cavalcante
2024-03-20 23:46:55 -03:00
parent 43e1e88223
commit 24be7bd99e

View File

@@ -899,6 +899,12 @@ static eSnapMode snap_obj_fn(SnapObjectContext *sctx,
}
if (GS(ob_data->name) == ID_ME) {
if (ob_eval->type == OB_CURVES_LEGACY && BKE_object_is_in_editmode(ob_eval)) {
/* Sometimes, such as when Mesh is generated by Geometry Nodes, a Curve object may have Mesh
* instances.
* In these cases, skip the snap to Mesh if the Curve is in edit mode. */
return SCE_SNAP_TO_NONE;
}
return snap_object_mesh(sctx, ob_eval, ob_data, obmat, sctx->runtime.snap_to_flag, use_hide);
}