Changeset View
Changeset View
Standalone View
Standalone View
source/blender/modifiers/intern/MOD_mirror.c
| Show First 20 Lines • Show All 89 Lines • ▼ Show 20 Lines | static Mesh *doBiscetOnMirrorPlane( | ||||
| BMIter viter; | BMIter viter; | ||||
| BMVert *v, *v_next; | BMVert *v, *v_next; | ||||
| bm = BKE_mesh_to_bmesh_ex( | bm = BKE_mesh_to_bmesh_ex( | ||||
| mesh, | mesh, | ||||
| &(struct BMeshCreateParams){0}, | &(struct BMeshCreateParams){0}, | ||||
| &(struct BMeshFromMeshParams){ | &(struct BMeshFromMeshParams){ | ||||
| .calc_face_normal = true, | .calc_face_normal = true, | ||||
| .cd_mask_extra = CD_MASK_ORIGINDEX, | .cd_mask_extra = {.vmask=CD_MASK_ORIGINDEX, .emask=CD_MASK_ORIGINDEX, .pmask=CD_MASK_ORIGINDEX}, | ||||
| }); | }); | ||||
| /* Define bisecting plane (aka mirror plane). */ | /* Define bisecting plane (aka mirror plane). */ | ||||
| float plane[4]; | float plane[4]; | ||||
| if (!do_bisect_flip_axis) { | if (!do_bisect_flip_axis) { | ||||
| /* That reversed condition is a tad weird, but for some reason that's how you keep | /* That reversed condition is a tad weird, but for some reason that's how you keep | ||||
| * the part of the mesh which is on the non-mirrored side when flip option is disabled, | * the part of the mesh which is on the non-mirrored side when flip option is disabled, | ||||
| * think that that is the expected behavior. */ | * think that that is the expected behavior. */ | ||||
| Show All 10 Lines | static Mesh *doBiscetOnMirrorPlane( | ||||
| /* Delete verts across the mirror plane. */ | /* Delete verts across the mirror plane. */ | ||||
| BM_ITER_MESH_MUTABLE(v, v_next, &viter, bm, BM_VERTS_OF_MESH) { | BM_ITER_MESH_MUTABLE(v, v_next, &viter, bm, BM_VERTS_OF_MESH) { | ||||
| if (plane_point_side_v3(plane_offset, v->co) > 0.0f) { | if (plane_point_side_v3(plane_offset, v->co) > 0.0f) { | ||||
| BM_vert_kill(bm, v); | BM_vert_kill(bm, v); | ||||
| } | } | ||||
| } | } | ||||
| result = BKE_mesh_from_bmesh_for_eval_nomain(bm, 0); | result = BKE_mesh_from_bmesh_for_eval_nomain(bm, NULL); | ||||
| BM_mesh_free(bm); | BM_mesh_free(bm); | ||||
| return result; | return result; | ||||
| } | } | ||||
| static Mesh *doMirrorOnAxis( | static Mesh *doMirrorOnAxis( | ||||
| MirrorModifierData *mmd, | MirrorModifierData *mmd, | ||||
| const ModifierEvalContext *ctx, | const ModifierEvalContext *ctx, | ||||
| ▲ Show 20 Lines • Show All 324 Lines • Show Last 20 Lines | |||||