Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/mesh_convert.c
| Show First 20 Lines • Show All 1,215 Lines • ▼ Show 20 Lines | |||||
| static Mesh *mesh_new_from_mesh_object(Depsgraph *depsgraph, | static Mesh *mesh_new_from_mesh_object(Depsgraph *depsgraph, | ||||
| Object *object, | Object *object, | ||||
| bool preserve_all_data_layers) | bool preserve_all_data_layers) | ||||
| { | { | ||||
| if (preserve_all_data_layers) { | if (preserve_all_data_layers) { | ||||
| return mesh_new_from_mesh_object_with_layers(depsgraph, object); | return mesh_new_from_mesh_object_with_layers(depsgraph, object); | ||||
| } | } | ||||
| Mesh *mesh_input = object->data; | Mesh *mesh_input = object->data; | ||||
| EditMeshEval *em_eval = &mesh_input->runtime.edit_eval; | |||||
| /* If we are in edit mode, use evaluated mesh from edit structure, matching to what | /* If we are in edit mode, use evaluated mesh from edit structure, matching to what | ||||
| * viewport is using for visualization. */ | * viewport is using for visualization. */ | ||||
| if (mesh_input->edit_mesh != NULL && mesh_input->edit_mesh->mesh_eval_final) { | if (mesh_input->edit_mesh != NULL && (em_eval->mesh_final != NULL)) { | ||||
| mesh_input = mesh_input->edit_mesh->mesh_eval_final; | mesh_input = em_eval->mesh_final; | ||||
| } | } | ||||
| return mesh_new_from_mesh(object, mesh_input); | return mesh_new_from_mesh(object, mesh_input); | ||||
| } | } | ||||
| Mesh *BKE_mesh_new_from_object(Depsgraph *depsgraph, Object *object, bool preserve_all_data_layers) | Mesh *BKE_mesh_new_from_object(Depsgraph *depsgraph, Object *object, bool preserve_all_data_layers) | ||||
| { | { | ||||
| Mesh *new_mesh = NULL; | Mesh *new_mesh = NULL; | ||||
| switch (object->type) { | switch (object->type) { | ||||
| ▲ Show 20 Lines • Show All 476 Lines • Show Last 20 Lines | |||||