diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2021-04-17 22:34:54 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2021-04-17 22:50:49 +0300 |
commit | 1fc446a9087b8c662f514884a37518078bad6161 (patch) | |
tree | 8f0087f58a8091aedca1375f8e680b8b3f5b3fba /source/blender/editors | |
parent | aca9a1bac3ad6290345d62b6cfe2fb5223854d22 (diff) |
Fix recent snap refactor
It is important to check if editmesh eval cage is also bmesh.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/transform/transform_snap_object.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/source/blender/editors/transform/transform_snap_object.c b/source/blender/editors/transform/transform_snap_object.c index 841c3e86008..fcb4d46358b 100644 --- a/source/blender/editors/transform/transform_snap_object.c +++ b/source/blender/editors/transform/transform_snap_object.c @@ -144,11 +144,6 @@ struct SnapObjectContext { /** \name Utilities * \{ */ -static bool editmesh_eval_final_is_bmesh(const BMEditMesh *em) -{ - return (em->mesh_eval_final->runtime.wrapper_type == ME_WRAPPER_TYPE_BMESH); -} - /* Mesh used for snapping. * If NULL the BMesh should be used. */ static Mesh *mesh_for_snap(Object *ob, eSnapEditType edit_mode_type, bool *r_use_hide) @@ -156,16 +151,22 @@ static Mesh *mesh_for_snap(Object *ob, eSnapEditType edit_mode_type, bool *r_use Mesh *me = ob->data; bool use_hide = false; if (BKE_object_is_in_editmode(ob)) { - if ((edit_mode_type == SNAP_GEOM_EDIT) || editmesh_eval_final_is_bmesh(me->edit_mesh)) { + if (edit_mode_type == SNAP_GEOM_EDIT) { return NULL; } BMEditMesh *em = BKE_editmesh_from_object(ob); if ((edit_mode_type == SNAP_GEOM_FINAL) && em->mesh_eval_final) { + if (em->mesh_eval_final->runtime.wrapper_type == ME_WRAPPER_TYPE_BMESH) { + return NULL; + } me = em->mesh_eval_final; use_hide = true; } else if ((edit_mode_type == SNAP_GEOM_CAGE) && em->mesh_eval_cage) { + if (em->mesh_eval_cage->runtime.wrapper_type == ME_WRAPPER_TYPE_BMESH) { + return NULL; + } me = em->mesh_eval_cage; use_hide = true; } |