`em_setup_vivewcontext` cannot be used in this function now as it expects `obedit` to be a mesh. It also duplicated the viewcontext init. Instead `BKE_editmesh_from_object` is called only when type is a mesh.
`em_setup_vivewcontext` cannot be used in this function now as it expects `obedit` to be a mesh. It also duplicated the viewcontext init. Instead `BKE_editmesh_from_object` is called only when type is a mesh.