Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenloader/intern/versioning_290.cc
| Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | |||||
| #include "BKE_colortools.h" | #include "BKE_colortools.h" | ||||
| #include "BKE_cryptomatte.h" | #include "BKE_cryptomatte.h" | ||||
| #include "BKE_curve.h" | #include "BKE_curve.h" | ||||
| #include "BKE_fcurve.h" | #include "BKE_fcurve.h" | ||||
| #include "BKE_gpencil.h" | #include "BKE_gpencil.h" | ||||
| #include "BKE_lib_id.h" | #include "BKE_lib_id.h" | ||||
| #include "BKE_main.h" | #include "BKE_main.h" | ||||
| #include "BKE_mesh.h" | #include "BKE_mesh.h" | ||||
| #include "BKE_mesh_legacy_convert.h" | |||||
| #include "BKE_multires.h" | #include "BKE_multires.h" | ||||
| #include "BKE_node.h" | #include "BKE_node.h" | ||||
| #include "IMB_imbuf.h" | #include "IMB_imbuf.h" | ||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| #include "RNA_access.h" | #include "RNA_access.h" | ||||
| ▲ Show 20 Lines • Show All 184 Lines • ▼ Show 20 Lines | |||||
| UNUSED_VARS(fd); | UNUSED_VARS(fd); | ||||
| if (MAIN_VERSION_ATLEAST(bmain, 290, 2) && MAIN_VERSION_OLDER(bmain, 291, 1)) { | if (MAIN_VERSION_ATLEAST(bmain, 290, 2) && MAIN_VERSION_OLDER(bmain, 291, 1)) { | ||||
| /* In this range, the extrude manifold could generate meshes with degenerated face. */ | /* In this range, the extrude manifold could generate meshes with degenerated face. */ | ||||
| LISTBASE_FOREACH (Mesh *, me, &bmain->meshes) { | LISTBASE_FOREACH (Mesh *, me, &bmain->meshes) { | ||||
| for (const MPoly *mp = BKE_mesh_polys(me), *mp_end = mp + me->totpoly; mp < mp_end; mp++) { | for (const MPoly *mp = BKE_mesh_polys(me), *mp_end = mp + me->totpoly; mp < mp_end; mp++) { | ||||
| if (mp->totloop == 2) { | if (mp->totloop == 2) { | ||||
| bool changed; | bool changed; | ||||
| BKE_mesh_legacy_convert_loops_to_corners(me); | |||||
| BKE_mesh_validate_arrays( | BKE_mesh_validate_arrays( | ||||
| me, | me, | ||||
| BKE_mesh_vert_positions_for_write(me), | BKE_mesh_vert_positions_for_write(me), | ||||
| me->totvert, | me->totvert, | ||||
| BKE_mesh_edges_for_write(me), | BKE_mesh_edges_for_write(me), | ||||
| me->totedge, | me->totedge, | ||||
| (MFace *)CustomData_get_layer_for_write(&me->fdata, CD_MFACE, me->totface), | (MFace *)CustomData_get_layer_for_write(&me->fdata, CD_MFACE, me->totface), | ||||
| me->totface, | me->totface, | ||||
| BKE_mesh_loops_for_write(me), | me->corner_verts_for_write().data(), | ||||
| me->corner_edges_for_write().data(), | |||||
| me->totloop, | me->totloop, | ||||
| BKE_mesh_polys_for_write(me), | BKE_mesh_polys_for_write(me), | ||||
| me->totpoly, | me->totpoly, | ||||
| BKE_mesh_deform_verts_for_write(me), | BKE_mesh_deform_verts_for_write(me), | ||||
| false, | false, | ||||
| true, | true, | ||||
| &changed); | &changed); | ||||
| break; | break; | ||||
| ▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines | |||||