Changeset View
Changeset View
Standalone View
Standalone View
source/blender/modifiers/intern/MOD_particlesystem.c
| Show First 20 Lines • Show All 75 Lines • ▼ Show 20 Lines | #endif | ||||
| modifier_copyData_generic(md, target, flag); | modifier_copyData_generic(md, target, flag); | ||||
| tpsmd->mesh_final = NULL; | tpsmd->mesh_final = NULL; | ||||
| tpsmd->mesh_original = NULL; | tpsmd->mesh_original = NULL; | ||||
| tpsmd->totdmvert = tpsmd->totdmedge = tpsmd->totdmface = 0; | tpsmd->totdmvert = tpsmd->totdmedge = tpsmd->totdmface = 0; | ||||
| } | } | ||||
| static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md) | static void requiredDataMask(Object *UNUSED(ob), ModifierData *md, CustomData_MeshMasks *r_cddata_masks) | ||||
| { | { | ||||
| ParticleSystemModifierData *psmd = (ParticleSystemModifierData *) md; | ParticleSystemModifierData *psmd = (ParticleSystemModifierData *) md; | ||||
| return psys_emitter_customdata_mask(psmd->psys); | |||||
| psys_emitter_customdata_mask(psmd->psys, r_cddata_masks); | |||||
| } | } | ||||
| /* saves the current emitter state for a particle system and calculates particles */ | /* saves the current emitter state for a particle system and calculates particles */ | ||||
| static void deformVerts( | static void deformVerts( | ||||
| ModifierData *md, const ModifierEvalContext *ctx, | ModifierData *md, const ModifierEvalContext *ctx, | ||||
| Mesh *mesh, | Mesh *mesh, | ||||
| float (*vertexCos)[3], | float (*vertexCos)[3], | ||||
| int numVerts) | int numVerts) | ||||
| ▲ Show 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | if (!psmd->mesh_final->runtime.deformed_only) { | ||||
| * them to the final mesh (typically subdivision surfaces). */ | * them to the final mesh (typically subdivision surfaces). */ | ||||
| Mesh *mesh_original = NULL; | Mesh *mesh_original = NULL; | ||||
| if (ctx->object->type == OB_MESH) { | if (ctx->object->type == OB_MESH) { | ||||
| BMEditMesh *em = BKE_editmesh_from_object(ctx->object); | BMEditMesh *em = BKE_editmesh_from_object(ctx->object); | ||||
| if (em) { | if (em) { | ||||
| /* In edit mode get directly from the edit mesh. */ | /* In edit mode get directly from the edit mesh. */ | ||||
| psmd->mesh_original = BKE_mesh_from_bmesh_for_eval_nomain(em->bm, 0); | psmd->mesh_original = BKE_mesh_from_bmesh_for_eval_nomain(em->bm, NULL); | ||||
| } | } | ||||
| else { | else { | ||||
| /* Otherwise get regular mesh. */ | /* Otherwise get regular mesh. */ | ||||
| mesh_original = ctx->object->data; | mesh_original = ctx->object->data; | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| mesh_original = mesh_src; | mesh_original = mesh_src; | ||||
| ▲ Show 20 Lines • Show All 105 Lines • Show Last 20 Lines | |||||