Hi,
I want to check if the object the operator is acting on is in object mode.
I’m trying to port VIEW3D_OT_snap_selected_to_cursor
to support multiple objects in edit mode. For now it uses if (obedit) { ...
to check if the object is in edit mode, but when I use
objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data(view_layer, &objects_len);
then if (objects[0]) {...
is always true.
So should I use something like if (OBEDIT_FROM_VIEW_LAYER(view_layer) == NULL)
or if (mesh->edit_btmesh) {..
? Or is there a better way to achieve this? Thanks.