Changeset View
Changeset View
Standalone View
Standalone View
source/blender/modifiers/intern/MOD_laplaciandeform.c
| Show All 29 Lines | |||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "BLI_utildefines_stack.h" | #include "BLI_utildefines_stack.h" | ||||
| #include "BLI_math.h" | #include "BLI_math.h" | ||||
| #include "BLI_string.h" | #include "BLI_string.h" | ||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| #include "BKE_deform.h" | |||||
| #include "BKE_editmesh.h" | |||||
| #include "BKE_library.h" | |||||
| #include "BKE_mesh.h" | |||||
| #include "BKE_mesh_mapping.h" | #include "BKE_mesh_mapping.h" | ||||
| #include "BKE_cdderivedmesh.h" | |||||
| #include "BKE_particle.h" | #include "BKE_particle.h" | ||||
| #include "BKE_deform.h" | |||||
| #include "DNA_mesh_types.h" | |||||
| #include "DNA_meshdata_types.h" | |||||
sybren: Add new includes in alphabetical order. | |||||
| #include "MOD_util.h" | #include "MOD_util.h" | ||||
| #include "eigen_capi.h" | #include "eigen_capi.h" | ||||
| enum { | enum { | ||||
| LAPDEFORM_SYSTEM_NOT_CHANGE = 0, | LAPDEFORM_SYSTEM_NOT_CHANGE = 0, | ||||
| LAPDEFORM_SYSTEM_IS_DIFFERENT, | LAPDEFORM_SYSTEM_IS_DIFFERENT, | ||||
| LAPDEFORM_SYSTEM_ONLY_CHANGE_ANCHORS, | LAPDEFORM_SYSTEM_ONLY_CHANGE_ANCHORS, | ||||
| ▲ Show 20 Lines • Show All 443 Lines • ▼ Show 20 Lines | if (EIG_linear_solver_solve(sys->context)) { | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| sys->has_solution = false; | sys->has_solution = false; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| static bool isValidVertexGroup(LaplacianDeformModifierData *lmd, Object *ob, DerivedMesh *dm) | static bool isValidVertexGroup(LaplacianDeformModifierData *lmd, Object *ob, Mesh *mesh) | ||||
| { | { | ||||
| int defgrp_index; | int defgrp_index; | ||||
| MDeformVert *dvert = NULL; | MDeformVert *dvert = NULL; | ||||
| modifier_get_vgroup(ob, dm, lmd->anchor_grp_name, &dvert, &defgrp_index); | modifier_get_vgroup_mesh(ob, mesh, lmd->anchor_grp_name, &dvert, &defgrp_index); | ||||
| return (dvert != NULL); | return (dvert != NULL); | ||||
| } | } | ||||
| static void initSystem(LaplacianDeformModifierData *lmd, Object *ob, DerivedMesh *dm, | static void initSystem(LaplacianDeformModifierData *lmd, Object *ob, Mesh *mesh, | ||||
| float (*vertexCos)[3], int numVerts) | float (*vertexCos)[3], int numVerts) | ||||
| { | { | ||||
| int i; | int i; | ||||
| int defgrp_index; | int defgrp_index; | ||||
| int total_anchors; | int total_anchors; | ||||
| float wpaint; | float wpaint; | ||||
| MDeformVert *dvert = NULL; | MDeformVert *dvert = NULL; | ||||
| MDeformVert *dv = NULL; | MDeformVert *dv = NULL; | ||||
| LaplacianSystem *sys; | LaplacianSystem *sys; | ||||
| if (isValidVertexGroup(lmd, ob, dm)) { | if (isValidVertexGroup(lmd, ob, mesh)) { | ||||
| int *index_anchors = MEM_malloc_arrayN(numVerts, sizeof(int), __func__); /* over-alloc */ | int *index_anchors = MEM_malloc_arrayN(numVerts, sizeof(int), __func__); /* over-alloc */ | ||||
| const MLoopTri *mlooptri; | const MLoopTri *mlooptri; | ||||
| const MLoop *mloop; | const MLoop *mloop; | ||||
| STACK_DECLARE(index_anchors); | STACK_DECLARE(index_anchors); | ||||
| STACK_INIT(index_anchors, numVerts); | STACK_INIT(index_anchors, numVerts); | ||||
| modifier_get_vgroup(ob, dm, lmd->anchor_grp_name, &dvert, &defgrp_index); | modifier_get_vgroup_mesh(ob, mesh, lmd->anchor_grp_name, &dvert, &defgrp_index); | ||||
| BLI_assert(dvert != NULL); | BLI_assert(dvert != NULL); | ||||
| dv = dvert; | dv = dvert; | ||||
| for (i = 0; i < numVerts; i++) { | for (i = 0; i < numVerts; i++) { | ||||
| wpaint = defvert_find_weight(dv, defgrp_index); | wpaint = defvert_find_weight(dv, defgrp_index); | ||||
| dv++; | dv++; | ||||
| if (wpaint > 0.0f) { | if (wpaint > 0.0f) { | ||||
| STACK_PUSH(index_anchors, i); | STACK_PUSH(index_anchors, i); | ||||
| } | } | ||||
| } | } | ||||
| total_anchors = STACK_SIZE(index_anchors); | total_anchors = STACK_SIZE(index_anchors); | ||||
| lmd->cache_system = initLaplacianSystem(numVerts, dm->getNumEdges(dm), dm->getNumLoopTri(dm), | lmd->cache_system = initLaplacianSystem(numVerts, mesh->totedge, BKE_mesh_runtime_looptri_len(mesh), | ||||
Not Done Inline ActionsUse BKE_mesh_runtime_looptri_len to get the number of looptris. sybren: Use `BKE_mesh_runtime_looptri_len` to get the number of looptris. | |||||
| total_anchors, lmd->anchor_grp_name, lmd->repeat); | total_anchors, lmd->anchor_grp_name, lmd->repeat); | ||||
| sys = (LaplacianSystem *)lmd->cache_system; | sys = (LaplacianSystem *)lmd->cache_system; | ||||
| memcpy(sys->index_anchors, index_anchors, sizeof(int) * total_anchors); | memcpy(sys->index_anchors, index_anchors, sizeof(int) * total_anchors); | ||||
| memcpy(sys->co, vertexCos, sizeof(float[3]) * numVerts); | memcpy(sys->co, vertexCos, sizeof(float[3]) * numVerts); | ||||
| MEM_freeN(index_anchors); | MEM_freeN(index_anchors); | ||||
| lmd->vertexco = MEM_malloc_arrayN(numVerts, sizeof(float[3]), "ModDeformCoordinates"); | lmd->vertexco = MEM_malloc_arrayN(numVerts, sizeof(float[3]), "ModDeformCoordinates"); | ||||
| memcpy(lmd->vertexco, vertexCos, sizeof(float[3]) * numVerts); | memcpy(lmd->vertexco, vertexCos, sizeof(float[3]) * numVerts); | ||||
| lmd->total_verts = numVerts; | lmd->total_verts = numVerts; | ||||
| createFaceRingMap( | createFaceRingMap( | ||||
| dm->getNumVerts(dm), dm->getLoopTriArray(dm), dm->getNumLoopTri(dm), | mesh->totvert, BKE_mesh_runtime_looptri_ensure(mesh), BKE_mesh_runtime_looptri_len(mesh), | ||||
| dm->getLoopArray(dm), &sys->ringf_map, &sys->ringf_indices); | mesh->mloop, &sys->ringf_map, &sys->ringf_indices); | ||||
Not Done Inline ActionsUse BKE_mesh_runtime_looptri_len to get the number of looptris. sybren: Use `BKE_mesh_runtime_looptri_len` to get the number of looptris. | |||||
| createVertRingMap( | createVertRingMap( | ||||
| dm->getNumVerts(dm), dm->getEdgeArray(dm), dm->getNumEdges(dm), | mesh->totvert, mesh->medge, mesh->totedge, | ||||
| &sys->ringv_map, &sys->ringv_indices); | &sys->ringv_map, &sys->ringv_indices); | ||||
| mlooptri = dm->getLoopTriArray(dm); | mlooptri = BKE_mesh_runtime_looptri_ensure(mesh); | ||||
| mloop = dm->getLoopArray(dm); | mloop = mesh->mloop;; | ||||
Not Done Inline ActionsUse BKE_mesh_runtime_looptri_ensure to get the array. sybren: Use `BKE_mesh_runtime_looptri_ensure` to get the array. | |||||
| for (i = 0; i < sys->total_tris; i++) { | for (i = 0; i < sys->total_tris; i++) { | ||||
| sys->tris[i][0] = mloop[mlooptri[i].tri[0]].v; | sys->tris[i][0] = mloop[mlooptri[i].tri[0]].v; | ||||
| sys->tris[i][1] = mloop[mlooptri[i].tri[1]].v; | sys->tris[i][1] = mloop[mlooptri[i].tri[1]].v; | ||||
| sys->tris[i][2] = mloop[mlooptri[i].tri[2]].v; | sys->tris[i][2] = mloop[mlooptri[i].tri[2]].v; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| static int isSystemDifferent(LaplacianDeformModifierData *lmd, Object *ob, DerivedMesh *dm, int numVerts) | static int isSystemDifferent(LaplacianDeformModifierData *lmd, Object *ob, Mesh *mesh, int numVerts) | ||||
| { | { | ||||
| int i; | int i; | ||||
| int defgrp_index; | int defgrp_index; | ||||
| int total_anchors = 0; | int total_anchors = 0; | ||||
| float wpaint; | float wpaint; | ||||
| MDeformVert *dvert = NULL; | MDeformVert *dvert = NULL; | ||||
| MDeformVert *dv = NULL; | MDeformVert *dv = NULL; | ||||
| LaplacianSystem *sys = (LaplacianSystem *)lmd->cache_system; | LaplacianSystem *sys = (LaplacianSystem *)lmd->cache_system; | ||||
| if (sys->total_verts != numVerts) { | if (sys->total_verts != numVerts) { | ||||
| return LAPDEFORM_SYSTEM_CHANGE_VERTEXES; | return LAPDEFORM_SYSTEM_CHANGE_VERTEXES; | ||||
| } | } | ||||
| if (sys->total_edges != dm->getNumEdges(dm)) { | if (sys->total_edges != mesh->totedge) { | ||||
| return LAPDEFORM_SYSTEM_CHANGE_EDGES; | return LAPDEFORM_SYSTEM_CHANGE_EDGES; | ||||
| } | } | ||||
| if (!STREQ(lmd->anchor_grp_name, sys->anchor_grp_name)) { | if (!STREQ(lmd->anchor_grp_name, sys->anchor_grp_name)) { | ||||
| return LAPDEFORM_SYSTEM_ONLY_CHANGE_GROUP; | return LAPDEFORM_SYSTEM_ONLY_CHANGE_GROUP; | ||||
| } | } | ||||
| modifier_get_vgroup(ob, dm, lmd->anchor_grp_name, &dvert, &defgrp_index); | modifier_get_vgroup_mesh(ob, mesh, lmd->anchor_grp_name, &dvert, &defgrp_index); | ||||
| if (!dvert) { | if (!dvert) { | ||||
| return LAPDEFORM_SYSTEM_CHANGE_NOT_VALID_GROUP; | return LAPDEFORM_SYSTEM_CHANGE_NOT_VALID_GROUP; | ||||
| } | } | ||||
| dv = dvert; | dv = dvert; | ||||
| for (i = 0; i < numVerts; i++) { | for (i = 0; i < numVerts; i++) { | ||||
| wpaint = defvert_find_weight(dv, defgrp_index); | wpaint = defvert_find_weight(dv, defgrp_index); | ||||
| dv++; | dv++; | ||||
| if (wpaint > 0.0f) { | if (wpaint > 0.0f) { | ||||
| total_anchors++; | total_anchors++; | ||||
| } | } | ||||
| } | } | ||||
| if (sys->total_anchors != total_anchors) { | if (sys->total_anchors != total_anchors) { | ||||
| return LAPDEFORM_SYSTEM_ONLY_CHANGE_ANCHORS; | return LAPDEFORM_SYSTEM_ONLY_CHANGE_ANCHORS; | ||||
| } | } | ||||
| return LAPDEFORM_SYSTEM_NOT_CHANGE; | return LAPDEFORM_SYSTEM_NOT_CHANGE; | ||||
| } | } | ||||
| static void LaplacianDeformModifier_do( | static void LaplacianDeformModifier_do( | ||||
| LaplacianDeformModifierData *lmd, Object *ob, DerivedMesh *dm, | LaplacianDeformModifierData *lmd, Object *ob, Mesh *mesh, | ||||
| float (*vertexCos)[3], int numVerts) | float (*vertexCos)[3], int numVerts) | ||||
| { | { | ||||
| float (*filevertexCos)[3]; | float (*filevertexCos)[3]; | ||||
| int sysdif; | int sysdif; | ||||
| LaplacianSystem *sys = NULL; | LaplacianSystem *sys = NULL; | ||||
| filevertexCos = NULL; | filevertexCos = NULL; | ||||
| if (!(lmd->flag & MOD_LAPLACIANDEFORM_BIND)) { | if (!(lmd->flag & MOD_LAPLACIANDEFORM_BIND)) { | ||||
| if (lmd->cache_system) { | if (lmd->cache_system) { | ||||
| sys = lmd->cache_system; | sys = lmd->cache_system; | ||||
| deleteLaplacianSystem(sys); | deleteLaplacianSystem(sys); | ||||
| lmd->cache_system = NULL; | lmd->cache_system = NULL; | ||||
| } | } | ||||
| lmd->total_verts = 0; | lmd->total_verts = 0; | ||||
| MEM_SAFE_FREE(lmd->vertexco); | MEM_SAFE_FREE(lmd->vertexco); | ||||
| return; | return; | ||||
| } | } | ||||
| if (lmd->cache_system) { | if (lmd->cache_system) { | ||||
| sysdif = isSystemDifferent(lmd, ob, dm, numVerts); | sysdif = isSystemDifferent(lmd, ob, mesh, numVerts); | ||||
| sys = lmd->cache_system; | sys = lmd->cache_system; | ||||
| if (sysdif) { | if (sysdif) { | ||||
| if (sysdif == LAPDEFORM_SYSTEM_ONLY_CHANGE_ANCHORS || sysdif == LAPDEFORM_SYSTEM_ONLY_CHANGE_GROUP) { | if (sysdif == LAPDEFORM_SYSTEM_ONLY_CHANGE_ANCHORS || sysdif == LAPDEFORM_SYSTEM_ONLY_CHANGE_GROUP) { | ||||
| filevertexCos = MEM_malloc_arrayN(numVerts, sizeof(float[3]), "TempModDeformCoordinates"); | filevertexCos = MEM_malloc_arrayN(numVerts, sizeof(float[3]), "TempModDeformCoordinates"); | ||||
| memcpy(filevertexCos, lmd->vertexco, sizeof(float[3]) * numVerts); | memcpy(filevertexCos, lmd->vertexco, sizeof(float[3]) * numVerts); | ||||
| MEM_SAFE_FREE(lmd->vertexco); | MEM_SAFE_FREE(lmd->vertexco); | ||||
| lmd->total_verts = 0; | lmd->total_verts = 0; | ||||
| deleteLaplacianSystem(sys); | deleteLaplacianSystem(sys); | ||||
| lmd->cache_system = NULL; | lmd->cache_system = NULL; | ||||
| initSystem(lmd, ob, dm, filevertexCos, numVerts); | initSystem(lmd, ob, mesh, filevertexCos, numVerts); | ||||
| sys = lmd->cache_system; /* may have been reallocated */ | sys = lmd->cache_system; /* may have been reallocated */ | ||||
| MEM_SAFE_FREE(filevertexCos); | MEM_SAFE_FREE(filevertexCos); | ||||
| if (sys) { | if (sys) { | ||||
| laplacianDeformPreview(sys, vertexCos); | laplacianDeformPreview(sys, vertexCos); | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| if (sysdif == LAPDEFORM_SYSTEM_CHANGE_VERTEXES) { | if (sysdif == LAPDEFORM_SYSTEM_CHANGE_VERTEXES) { | ||||
| modifier_setError(&lmd->modifier, "Vertices changed from %d to %d", lmd->total_verts, numVerts); | modifier_setError(&lmd->modifier, "Vertices changed from %d to %d", lmd->total_verts, numVerts); | ||||
| } | } | ||||
| else if (sysdif == LAPDEFORM_SYSTEM_CHANGE_EDGES) { | else if (sysdif == LAPDEFORM_SYSTEM_CHANGE_EDGES) { | ||||
| modifier_setError(&lmd->modifier, "Edges changed from %d to %d", sys->total_edges, dm->getNumEdges(dm)); | modifier_setError(&lmd->modifier, "Edges changed from %d to %d", sys->total_edges, mesh->totedge); | ||||
| } | } | ||||
| else if (sysdif == LAPDEFORM_SYSTEM_CHANGE_NOT_VALID_GROUP) { | else if (sysdif == LAPDEFORM_SYSTEM_CHANGE_NOT_VALID_GROUP) { | ||||
| modifier_setError(&lmd->modifier, "Vertex group '%s' is not valid", sys->anchor_grp_name); | modifier_setError(&lmd->modifier, "Vertex group '%s' is not valid", sys->anchor_grp_name); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| sys->repeat = lmd->repeat; | sys->repeat = lmd->repeat; | ||||
| laplacianDeformPreview(sys, vertexCos); | laplacianDeformPreview(sys, vertexCos); | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| if (!isValidVertexGroup(lmd, ob, dm)) { | if (!isValidVertexGroup(lmd, ob, mesh)) { | ||||
| modifier_setError(&lmd->modifier, "Vertex group '%s' is not valid", lmd->anchor_grp_name); | modifier_setError(&lmd->modifier, "Vertex group '%s' is not valid", lmd->anchor_grp_name); | ||||
| lmd->flag &= ~MOD_LAPLACIANDEFORM_BIND; | lmd->flag &= ~MOD_LAPLACIANDEFORM_BIND; | ||||
| } | } | ||||
| else if (lmd->total_verts > 0 && lmd->total_verts == numVerts) { | else if (lmd->total_verts > 0 && lmd->total_verts == numVerts) { | ||||
| filevertexCos = MEM_malloc_arrayN(numVerts, sizeof(float[3]), "TempDeformCoordinates"); | filevertexCos = MEM_malloc_arrayN(numVerts, sizeof(float[3]), "TempDeformCoordinates"); | ||||
| memcpy(filevertexCos, lmd->vertexco, sizeof(float[3]) * numVerts); | memcpy(filevertexCos, lmd->vertexco, sizeof(float[3]) * numVerts); | ||||
| MEM_SAFE_FREE(lmd->vertexco); | MEM_SAFE_FREE(lmd->vertexco); | ||||
| lmd->total_verts = 0; | lmd->total_verts = 0; | ||||
| initSystem(lmd, ob, dm, filevertexCos, numVerts); | initSystem(lmd, ob, mesh, filevertexCos, numVerts); | ||||
| sys = lmd->cache_system; | sys = lmd->cache_system; | ||||
| MEM_SAFE_FREE(filevertexCos); | MEM_SAFE_FREE(filevertexCos); | ||||
| laplacianDeformPreview(sys, vertexCos); | laplacianDeformPreview(sys, vertexCos); | ||||
| } | } | ||||
| else { | else { | ||||
| initSystem(lmd, ob, dm, vertexCos, numVerts); | initSystem(lmd, ob, mesh, vertexCos, numVerts); | ||||
| sys = lmd->cache_system; | sys = lmd->cache_system; | ||||
| laplacianDeformPreview(sys, vertexCos); | laplacianDeformPreview(sys, vertexCos); | ||||
| } | } | ||||
| } | } | ||||
| if (sys && sys->is_matrix_computed && !sys->has_solution) { | if (sys && sys->is_matrix_computed && !sys->has_solution) { | ||||
| modifier_setError(&lmd->modifier, "The system did not find a solution"); | modifier_setError(&lmd->modifier, "The system did not find a solution"); | ||||
| } | } | ||||
| } | } | ||||
| Show All 30 Lines | |||||
| static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md) | static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md) | ||||
| { | { | ||||
| LaplacianDeformModifierData *lmd = (LaplacianDeformModifierData *)md; | LaplacianDeformModifierData *lmd = (LaplacianDeformModifierData *)md; | ||||
| CustomDataMask dataMask = 0; | CustomDataMask dataMask = 0; | ||||
| if (lmd->anchor_grp_name[0]) dataMask |= CD_MASK_MDEFORMVERT; | if (lmd->anchor_grp_name[0]) dataMask |= CD_MASK_MDEFORMVERT; | ||||
| return dataMask; | return dataMask; | ||||
| } | } | ||||
| static void deformVerts(ModifierData *md, const ModifierEvalContext *ctx, DerivedMesh *derivedData, | static void deformVerts(ModifierData *md, const ModifierEvalContext *ctx, Mesh *mesh, | ||||
| float (*vertexCos)[3], int numVerts) | float (*vertexCos)[3], int numVerts) | ||||
| { | { | ||||
| DerivedMesh *dm = get_dm(ctx->object, NULL, derivedData, NULL, false, false); | Mesh *mesh_src = get_mesh(ctx->object, NULL, mesh, NULL, false, false); | ||||
Not Done Inline ActionsRename mesh to mesh_src and meshData to mesh, to be consistent with the other modifiers. sybren: Rename `mesh` to `mesh_src` and `meshData` to `mesh`, to be consistent with the other modifiers. | |||||
| LaplacianDeformModifier_do((LaplacianDeformModifierData *)md, ctx->object, dm, vertexCos, numVerts); | LaplacianDeformModifier_do((LaplacianDeformModifierData *)md, ctx->object, mesh_src, vertexCos, numVerts); | ||||
| if (dm != derivedData) { | if (mesh_src != mesh) { | ||||
| dm->release(dm); | BKE_id_free(NULL, mesh_src); | ||||
| } | } | ||||
| } | } | ||||
| static void deformVertsEM( | static void deformVertsEM( | ||||
| ModifierData *md, const ModifierEvalContext *ctx, struct BMEditMesh *editData, | ModifierData *md, const ModifierEvalContext *ctx, struct BMEditMesh *editData, | ||||
| DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts) | Mesh *mesh, float (*vertexCos)[3], int numVerts) | ||||
Not Done Inline ActionsRename mesh to mesh_src and meshData to mesh, to be consistent with the other modifiers. sybren: Rename `mesh` to `mesh_src` and `meshData` to `mesh`, to be consistent with the other modifiers. | |||||
| { | { | ||||
| DerivedMesh *dm = get_dm(ctx->object, editData, derivedData, NULL, false, false); | Mesh *mesh_src = get_mesh(ctx->object, editData, mesh, NULL, false, false); | ||||
| LaplacianDeformModifier_do((LaplacianDeformModifierData *)md, ctx->object, dm, | LaplacianDeformModifier_do((LaplacianDeformModifierData *)md, ctx->object, mesh_src, | ||||
Not Done Inline ActionsUse get_mesh to get the mesh. sybren: Use `get_mesh` to get the mesh. | |||||
| vertexCos, numVerts); | vertexCos, numVerts); | ||||
| if (dm != derivedData) { | if (mesh_src != mesh) { | ||||
| dm->release(dm); | BKE_id_free(NULL, mesh_src); | ||||
| } | } | ||||
| } | } | ||||
| static void freeData(ModifierData *md) | static void freeData(ModifierData *md) | ||||
| { | { | ||||
| LaplacianDeformModifierData *lmd = (LaplacianDeformModifierData *)md; | LaplacianDeformModifierData *lmd = (LaplacianDeformModifierData *)md; | ||||
| LaplacianSystem *sys = (LaplacianSystem *)lmd->cache_system; | LaplacianSystem *sys = (LaplacianSystem *)lmd->cache_system; | ||||
| if (sys) { | if (sys) { | ||||
| deleteLaplacianSystem(sys); | deleteLaplacianSystem(sys); | ||||
| } | } | ||||
| MEM_SAFE_FREE(lmd->vertexco); | MEM_SAFE_FREE(lmd->vertexco); | ||||
| lmd->total_verts = 0; | lmd->total_verts = 0; | ||||
| } | } | ||||
| ModifierTypeInfo modifierType_LaplacianDeform = { | ModifierTypeInfo modifierType_LaplacianDeform = { | ||||
| /* name */ "LaplacianDeform", | /* name */ "LaplacianDeform", | ||||
| /* structName */ "LaplacianDeformModifierData", | /* structName */ "LaplacianDeformModifierData", | ||||
| /* structSize */ sizeof(LaplacianDeformModifierData), | /* structSize */ sizeof(LaplacianDeformModifierData), | ||||
| /* type */ eModifierTypeType_OnlyDeform, | /* type */ eModifierTypeType_OnlyDeform, | ||||
| /* flags */ eModifierTypeFlag_AcceptsMesh | eModifierTypeFlag_SupportsEditmode, | /* flags */ eModifierTypeFlag_AcceptsMesh | eModifierTypeFlag_SupportsEditmode, | ||||
| /* copyData */ copyData, | /* copyData */ copyData, | ||||
| /* deformVerts_DM */ deformVerts, | /* deformVerts_DM */ NULL, | ||||
| /* deformMatrices_DM */ NULL, | /* deformMatrices_DM */ NULL, | ||||
| /* deformVertsEM_DM */ deformVertsEM, | /* deformVertsEM_DM */ NULL, | ||||
| /* deformMatricesEM_DM*/NULL, | /* deformMatricesEM_DM*/NULL, | ||||
| /* applyModifier_DM */ NULL, | /* applyModifier_DM */ NULL, | ||||
| /* applyModifierEM_DM */NULL, | /* applyModifierEM_DM */NULL, | ||||
| /* deformVerts */ NULL, | /* deformVerts */ deformVerts, | ||||
| /* deformMatrices */ NULL, | /* deformMatrices */ NULL, | ||||
| /* deformVertsEM */ NULL, | /* deformVertsEM */ deformVertsEM, | ||||
| /* deformMatricesEM */ NULL, | /* deformMatricesEM */ NULL, | ||||
| /* applyModifier */ NULL, | /* applyModifier */ NULL, | ||||
| /* applyModifierEM */ NULL, | /* applyModifierEM */ NULL, | ||||
| /* initData */ initData, | /* initData */ initData, | ||||
| /* requiredDataMask */ requiredDataMask, | /* requiredDataMask */ requiredDataMask, | ||||
| /* freeData */ freeData, | /* freeData */ freeData, | ||||
| /* isDisabled */ isDisabled, | /* isDisabled */ isDisabled, | ||||
| /* updateDepsgraph */ NULL, | /* updateDepsgraph */ NULL, | ||||
| /* dependsOnTime */ NULL, | /* dependsOnTime */ NULL, | ||||
| /* dependsOnNormals */ NULL, | /* dependsOnNormals */ NULL, | ||||
| /* foreachObjectLink */ NULL, | /* foreachObjectLink */ NULL, | ||||
| /* foreachIDLink */ NULL, | /* foreachIDLink */ NULL, | ||||
| /* foreachTexLink */ NULL, | /* foreachTexLink */ NULL, | ||||
| }; | }; | ||||
Add new includes in alphabetical order.