Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/mesh.cc
| Show All 38 Lines | |||||
| #include "BLI_ghash.h" | #include "BLI_ghash.h" | ||||
| #include "BLI_hash.h" | #include "BLI_hash.h" | ||||
| #include "BLI_index_range.hh" | #include "BLI_index_range.hh" | ||||
| #include "BLI_linklist.h" | #include "BLI_linklist.h" | ||||
| #include "BLI_listbase.h" | #include "BLI_listbase.h" | ||||
| #include "BLI_math.h" | #include "BLI_math.h" | ||||
| #include "BLI_math_vec_types.hh" | #include "BLI_math_vec_types.hh" | ||||
| #include "BLI_memarena.h" | #include "BLI_memarena.h" | ||||
| #include "BLI_span.hh" | |||||
sergey: Not really sure where this is used. | |||||
HooglyBooglyAuthorUnsubmitted Done Inline ActionsRight, sorry, I forgot to remove that. HooglyBoogly: Right, sorry, I forgot to remove that. | |||||
| #include "BLI_string.h" | #include "BLI_string.h" | ||||
| #include "BLI_task.hh" | #include "BLI_task.hh" | ||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "BLT_translation.h" | #include "BLT_translation.h" | ||||
| #include "BKE_anim_data.h" | #include "BKE_anim_data.h" | ||||
| #include "BKE_bpath.h" | #include "BKE_bpath.h" | ||||
| Show All 15 Lines | |||||
| #include "PIL_time.h" | #include "PIL_time.h" | ||||
| #include "DEG_depsgraph.h" | #include "DEG_depsgraph.h" | ||||
| #include "DEG_depsgraph_query.h" | #include "DEG_depsgraph_query.h" | ||||
| #include "BLO_read_write.h" | #include "BLO_read_write.h" | ||||
| using blender::MutableSpan; | |||||
sergeyUnsubmitted Done Inline ActionsSame as above. sergey: Same as above. | |||||
| static void mesh_clear_geometry(Mesh *mesh); | static void mesh_clear_geometry(Mesh *mesh); | ||||
| static void mesh_tessface_clear_intern(Mesh *mesh, int free_customdata); | static void mesh_tessface_clear_intern(Mesh *mesh, int free_customdata); | ||||
| static void mesh_init_data(ID *id) | static void mesh_init_data(ID *id) | ||||
| { | { | ||||
| Mesh *mesh = (Mesh *)id; | Mesh *mesh = (Mesh *)id; | ||||
| BLI_assert(MEMCMP_STRUCT_AFTER_IS_ZERO(mesh, id)); | BLI_assert(MEMCMP_STRUCT_AFTER_IS_ZERO(mesh, id)); | ||||
| ▲ Show 20 Lines • Show All 1,129 Lines • ▼ Show 20 Lines | Mesh *BKE_mesh_from_bmesh_for_eval_nomain(BMesh *bm, | ||||
| const Mesh *me_settings) | const Mesh *me_settings) | ||||
| { | { | ||||
| Mesh *mesh = (Mesh *)BKE_id_new_nomain(ID_ME, nullptr); | Mesh *mesh = (Mesh *)BKE_id_new_nomain(ID_ME, nullptr); | ||||
| BM_mesh_bm_to_me_for_eval(bm, mesh, cd_mask_extra); | BM_mesh_bm_to_me_for_eval(bm, mesh, cd_mask_extra); | ||||
| BKE_mesh_copy_parameters_for_eval(mesh, me_settings); | BKE_mesh_copy_parameters_for_eval(mesh, me_settings); | ||||
| return mesh; | return mesh; | ||||
| } | } | ||||
| static void ensure_orig_index_layer(CustomData &data, const int size) | |||||
| { | |||||
| if (CustomData_has_layer(&data, CD_ORIGINDEX)) { | |||||
| return; | |||||
| } | |||||
| range_vn_i((int *)CustomData_add_layer(&data, CD_ORIGINDEX, CD_DEFAULT, nullptr, size), size, 0); | |||||
sergeyUnsubmitted Done Inline ActionsSuggest to split it into 2 lines to make it easier to follow what's going on. sergey: Suggest to split it into 2 lines to make it easier to follow what's going on. | |||||
| } | |||||
| void BKE_mesh_ensure_default_orig_index_layers(Mesh *mesh) | |||||
| { | |||||
| BLI_assert(mesh->runtime.wrapper_type == ME_WRAPPER_TYPE_MDATA); | |||||
| ensure_orig_index_layer(mesh->vdata, mesh->totvert); | |||||
| ensure_orig_index_layer(mesh->edata, mesh->totedge); | |||||
| ensure_orig_index_layer(mesh->pdata, mesh->totpoly); | |||||
| } | |||||
| BoundBox *BKE_mesh_boundbox_get(Object *ob) | BoundBox *BKE_mesh_boundbox_get(Object *ob) | ||||
| { | { | ||||
| /* This is Object-level data access, | /* This is Object-level data access, | ||||
| * DO NOT touch to Mesh's bb, would be totally thread-unsafe. */ | * DO NOT touch to Mesh's bb, would be totally thread-unsafe. */ | ||||
| if (ob->runtime.bb == nullptr || ob->runtime.bb->flag & BOUNDBOX_DIRTY) { | if (ob->runtime.bb == nullptr || ob->runtime.bb->flag & BOUNDBOX_DIRTY) { | ||||
| Mesh *me = (Mesh *)ob->data; | Mesh *me = (Mesh *)ob->data; | ||||
| float min[3], max[3]; | float min[3], max[3]; | ||||
| ▲ Show 20 Lines • Show All 992 Lines • Show Last 20 Lines | |||||
Not really sure where this is used.