Changeset View
Changeset View
Standalone View
Standalone View
source/blender/modifiers/intern/MOD_mask.cc
| Show First 20 Lines • Show All 287 Lines • ▼ Show 20 Lines | static void copy_masked_polys_to_new_mesh(const Mesh &src_mesh, | ||||
| } | } | ||||
| } | } | ||||
| /* Components of the algorithm: | /* Components of the algorithm: | ||||
| * 1. Figure out which vertices should be present in the output mesh. | * 1. Figure out which vertices should be present in the output mesh. | ||||
| * 2. Find edges and polygons only using those vertices. | * 2. Find edges and polygons only using those vertices. | ||||
| * 3. Create a new mesh that only uses the found vertices, edges and polygons. | * 3. Create a new mesh that only uses the found vertices, edges and polygons. | ||||
| */ | */ | ||||
| static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mesh *mesh) | static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh *mesh) | ||||
| { | { | ||||
| MaskModifierData *mmd = (MaskModifierData *)md; | MaskModifierData *mmd = (MaskModifierData *)md; | ||||
| Object *ob = ctx->object; | Object *ob = ctx->object; | ||||
| const bool invert_mask = mmd->flag & MOD_MASK_INV; | const bool invert_mask = mmd->flag & MOD_MASK_INV; | ||||
| /* Return empty or input mesh when there are no vertex groups. */ | /* Return empty or input mesh when there are no vertex groups. */ | ||||
| MDeformVert *dvert = (MDeformVert *)CustomData_get_layer(&mesh->vdata, CD_MDEFORMVERT); | MDeformVert *dvert = (MDeformVert *)CustomData_get_layer(&mesh->vdata, CD_MDEFORMVERT); | ||||
| if (dvert == NULL) { | if (dvert == NULL) { | ||||
| ▲ Show 20 Lines • Show All 91 Lines • ▼ Show 20 Lines | (ModifierTypeFlag)(eModifierTypeFlag_AcceptsMesh | eModifierTypeFlag_SupportsMapping | | ||||
| eModifierTypeFlag_SupportsEditmode), | eModifierTypeFlag_SupportsEditmode), | ||||
| /* copyData */ modifier_copyData_generic, | /* copyData */ modifier_copyData_generic, | ||||
| /* deformVerts */ NULL, | /* deformVerts */ NULL, | ||||
| /* deformMatrices */ NULL, | /* deformMatrices */ NULL, | ||||
| /* deformVertsEM */ NULL, | /* deformVertsEM */ NULL, | ||||
| /* deformMatricesEM */ NULL, | /* deformMatricesEM */ NULL, | ||||
| /* applyModifier */ applyModifier, | /* modifyMesh */ modifyMesh, | ||||
| /* modifyHair */ NULL, | |||||
| /* modifyPointCloud */ NULL, | |||||
| /* modifyVolume */ NULL, | |||||
| /* initData */ NULL, | /* initData */ NULL, | ||||
| /* requiredDataMask */ requiredDataMask, | /* requiredDataMask */ requiredDataMask, | ||||
| /* freeData */ NULL, | /* freeData */ NULL, | ||||
| /* isDisabled */ isDisabled, | /* isDisabled */ isDisabled, | ||||
| /* updateDepsgraph */ updateDepsgraph, | /* updateDepsgraph */ updateDepsgraph, | ||||
| /* dependsOnTime */ NULL, | /* dependsOnTime */ NULL, | ||||
| /* dependsOnNormals */ NULL, | /* dependsOnNormals */ NULL, | ||||
| /* foreachObjectLink */ foreachObjectLink, | /* foreachObjectLink */ foreachObjectLink, | ||||
| /* foreachIDLink */ NULL, | /* foreachIDLink */ NULL, | ||||
| /* foreachTexLink */ NULL, | /* foreachTexLink */ NULL, | ||||
| /* freeRuntimeData */ NULL, | /* freeRuntimeData */ NULL, | ||||
| }; | }; | ||||