Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/particle_distribute.c
| Show First 20 Lines • Show All 1,324 Lines • ▼ Show 20 Lines | static void distribute_particles_on_dm(ParticleSimulationData *sim, int from) | ||||
| Mesh *final_mesh = sim->psmd->mesh_final; | Mesh *final_mesh = sim->psmd->mesh_final; | ||||
| int i, totpart, numtasks; | int i, totpart, numtasks; | ||||
| /* create a task pool for distribution tasks */ | /* create a task pool for distribution tasks */ | ||||
| if (!psys_thread_context_init_distribute(&ctx, sim, from)) { | if (!psys_thread_context_init_distribute(&ctx, sim, from)) { | ||||
| return; | return; | ||||
| } | } | ||||
| task_pool = BLI_task_pool_create(&ctx, TASK_PRIORITY_LOW); | task_pool = BLI_task_pool_create(&ctx, TASK_PRIORITY_LOW, TASK_ISOLATION_ON); | ||||
| totpart = (from == PART_FROM_CHILD ? sim->psys->totchild : sim->psys->totpart); | totpart = (from == PART_FROM_CHILD ? sim->psys->totchild : sim->psys->totpart); | ||||
| psys_tasks_create(&ctx, 0, totpart, &tasks, &numtasks); | psys_tasks_create(&ctx, 0, totpart, &tasks, &numtasks); | ||||
| for (i = 0; i < numtasks; i++) { | for (i = 0; i < numtasks; i++) { | ||||
| ParticleTask *task = &tasks[i]; | ParticleTask *task = &tasks[i]; | ||||
| psys_task_init_distribute(task, sim); | psys_task_init_distribute(task, sim); | ||||
| if (from == PART_FROM_CHILD) { | if (from == PART_FROM_CHILD) { | ||||
| ▲ Show 20 Lines • Show All 52 Lines • Show Last 20 Lines | |||||