diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-09-04 15:30:25 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-09-04 15:31:21 +0300 |
commit | f1de256ea018e0850fbe337d04f35422b8fbaf2d (patch) | |
tree | cc4914c051cb291da9e691e1eaef646876db5b0f /source/blender/editors/space_view3d | |
parent | 4dfc846fe3d8056b8d58e042846100ef6eff83c6 (diff) |
Fix T56679: Blender 2.8 crashes with bezier curve snap.
Follow up to rB621b16468ef72fb actually... Seriously... :/
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_snap.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/source/blender/editors/space_view3d/view3d_snap.c b/source/blender/editors/space_view3d/view3d_snap.c index 1c2415c67b9..58406470f36 100644 --- a/source/blender/editors/space_view3d/view3d_snap.c +++ b/source/blender/editors/space_view3d/view3d_snap.c @@ -93,10 +93,13 @@ static int snap_sel_to_grid_exec(bContext *C, wmOperator *UNUSED(op)) Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data(view_layer, &objects_len); for (uint ob_index = 0; ob_index < objects_len; ob_index++) { obedit = objects[ob_index]; - BMEditMesh *em = BKE_editmesh_from_object(obedit); - if (em->bm->totvertsel == 0) { - continue; + if (obedit->type == OB_MESH) { + BMEditMesh *em = BKE_editmesh_from_object(obedit); + + if (em->bm->totvertsel == 0) { + continue; + } } if (ED_transverts_check_obedit(obedit)) { @@ -268,10 +271,13 @@ static int snap_selected_to_location(bContext *C, const float snap_target_global Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data(view_layer, &objects_len); for (uint ob_index = 0; ob_index < objects_len; ob_index++) { obedit = objects[ob_index]; - BMEditMesh *em = BKE_editmesh_from_object(obedit); - if (em->bm->totvertsel == 0) { - continue; + if (obedit->type == OB_MESH) { + BMEditMesh *em = BKE_editmesh_from_object(obedit); + + if (em->bm->totvertsel == 0) { + continue; + } } if (ED_transverts_check_obedit(obedit)) { |