Changeset View
Changeset View
Standalone View
Standalone View
source/blender/modifiers/intern/MOD_mirror.c
| Show First 20 Lines • Show All 124 Lines • ▼ Show 20 Lines | static Mesh *doBiscetOnMirrorPlane( | ||||
| result = BKE_mesh_from_bmesh_for_eval_nomain(bm, NULL); | 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 *UNUSED(ctx), | ||||
| Object *ob, | Object *ob, | ||||
| const Mesh *mesh, | const Mesh *mesh, | ||||
| int axis) | int axis) | ||||
| { | { | ||||
| const float tolerance_sq = mmd->tolerance * mmd->tolerance; | const float tolerance_sq = mmd->tolerance * mmd->tolerance; | ||||
| const bool do_vtargetmap = (mmd->flag & MOD_MIR_NO_MERGE) == 0; | const bool do_vtargetmap = (mmd->flag & MOD_MIR_NO_MERGE) == 0; | ||||
| int tot_vtargetmap = 0; /* total merge vertices */ | int tot_vtargetmap = 0; /* total merge vertices */ | ||||
| Show All 12 Lines | static Mesh *doMirrorOnAxis( | ||||
| int i; | int i; | ||||
| int a, totshape; | int a, totshape; | ||||
| int *vtargetmap = NULL, *vtmap_a = NULL, *vtmap_b = NULL; | int *vtargetmap = NULL, *vtmap_a = NULL, *vtmap_b = NULL; | ||||
| /* mtx is the mirror transformation */ | /* mtx is the mirror transformation */ | ||||
| unit_m4(mtx); | unit_m4(mtx); | ||||
| mtx[axis][axis] = -1.0f; | mtx[axis][axis] = -1.0f; | ||||
| Object *mirror_ob = DEG_get_evaluated_object(ctx->depsgraph, mmd->mirror_ob); | Object *mirror_ob = mmd->mirror_ob; | ||||
| if (mirror_ob != NULL) { | if (mirror_ob != NULL) { | ||||
| float tmp[4][4]; | float tmp[4][4]; | ||||
| float itmp[4][4]; | float itmp[4][4]; | ||||
| /* tmp is a transform from coords relative to the object's own origin, | /* tmp is a transform from coords relative to the object's own origin, | ||||
| * to coords relative to the mirror object origin */ | * to coords relative to the mirror object origin */ | ||||
| invert_m4_m4(tmp, mirror_ob->obmat); | invert_m4_m4(tmp, mirror_ob->obmat); | ||||
| mul_m4_m4m4(tmp, tmp, ob->obmat); | mul_m4_m4m4(tmp, tmp, ob->obmat); | ||||
| ▲ Show 20 Lines • Show All 288 Lines • Show Last 20 Lines | |||||