Changeset View
Changeset View
Standalone View
Standalone View
source/blender/modifiers/intern/MOD_explode.c
| Show First 20 Lines • Show All 979 Lines • ▼ Show 20 Lines | static Mesh *explodeMesh(ExplodeModifierData *emd, | ||||
| BLI_edgehashIterator_free(ehi); | BLI_edgehashIterator_free(ehi); | ||||
| /* the final duplicated vertices */ | /* the final duplicated vertices */ | ||||
| explode = BKE_mesh_new_nomain_from_template(mesh, totdup, 0, totface - delface, 0, 0); | explode = BKE_mesh_new_nomain_from_template(mesh, totdup, 0, totface - delface, 0, 0); | ||||
| MTFace *mtface = CustomData_get_layer_named(&explode->fdata, CD_MTFACE, emd->uvname); | MTFace *mtface = CustomData_get_layer_named(&explode->fdata, CD_MTFACE, emd->uvname); | ||||
| /* getting back to object space */ | /* getting back to object space */ | ||||
| invert_m4_m4(imat, ctx->object->obmat); | invert_m4_m4(imat, ctx->object->object_to_world); | ||||
| psmd->psys->lattice_deform_data = psys_create_lattice_deform_data(&sim); | psmd->psys->lattice_deform_data = psys_create_lattice_deform_data(&sim); | ||||
| const MVert *mesh_verts = BKE_mesh_verts(mesh); | const MVert *mesh_verts = BKE_mesh_verts(mesh); | ||||
| MVert *explode_verts = BKE_mesh_verts_for_write(explode); | MVert *explode_verts = BKE_mesh_verts_for_write(explode); | ||||
| /* duplicate & displace vertices */ | /* duplicate & displace vertices */ | ||||
| ehi = BLI_edgehashIterator_new(vertpahash); | ehi = BLI_edgehashIterator_new(vertpahash); | ||||
| Show All 18 Lines | if (ed_v2 != totpart) { | ||||
| pa = pars + ed_v2; | pa = pars + ed_v2; | ||||
| psys_get_birth_coords(&sim, pa, &birth, 0, 0); | psys_get_birth_coords(&sim, pa, &birth, 0, 0); | ||||
| state.time = ctime; | state.time = ctime; | ||||
| psys_get_particle_state(&sim, ed_v2, &state, 1); | psys_get_particle_state(&sim, ed_v2, &state, 1); | ||||
| vertco = explode_verts[v].co; | vertco = explode_verts[v].co; | ||||
| mul_m4_v3(ctx->object->obmat, vertco); | mul_m4_v3(ctx->object->object_to_world, vertco); | ||||
| sub_v3_v3(vertco, birth.co); | sub_v3_v3(vertco, birth.co); | ||||
| /* apply rotation, size & location */ | /* apply rotation, size & location */ | ||||
| sub_qt_qtqt(rot, state.rot, birth.rot); | sub_qt_qtqt(rot, state.rot, birth.rot); | ||||
| mul_qt_v3(rot, vertco); | mul_qt_v3(rot, vertco); | ||||
| if (emd->flag & eExplodeFlag_PaSize) { | if (emd->flag & eExplodeFlag_PaSize) { | ||||
| ▲ Show 20 Lines • Show All 234 Lines • Show Last 20 Lines | |||||