Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/particle_distribute.c
| Show First 20 Lines • Show All 621 Lines • ▼ Show 20 Lines | case PART_DISTR_RAND: | ||||
| break; | break; | ||||
| } | } | ||||
| pa->foffset = 0.0f; | pa->foffset = 0.0f; | ||||
| /* experimental */ | /* experimental */ | ||||
| tot = mesh->totface; | tot = mesh->totface; | ||||
| psys_interpolate_face( | psys_interpolate_face( | ||||
| mvert, BKE_mesh_vertex_normals_ensure(mesh), mface, 0, 0, pa->fuv, co, nor, 0, 0, 0); | mesh, mvert, BKE_mesh_vertex_normals_ensure(mesh), mface, 0, 0, pa->fuv, co, nor, 0, 0, 0); | ||||
| normalize_v3(nor); | normalize_v3(nor); | ||||
| negate_v3(nor); | negate_v3(nor); | ||||
| min_d = FLT_MAX; | min_d = FLT_MAX; | ||||
| intersect = 0; | intersect = 0; | ||||
| for (i = 0, mface = mesh->mface; i < tot; i++, mface++) { | for (i = 0, mface = mesh->mface; i < tot; i++, mface++) { | ||||
| ▲ Show 20 Lines • Show All 314 Lines • ▼ Show 20 Lines | if (part->distr == PART_DISTR_GRID && from != PART_FROM_VERT) { | ||||
| if (mesh != final_mesh) { | if (mesh != final_mesh) { | ||||
| BKE_id_free(NULL, mesh); | BKE_id_free(NULL, mesh); | ||||
| } | } | ||||
| return 0; | return 0; | ||||
| } | } | ||||
| } | } | ||||
| /* After this #BKE_mesh_orco_verts_transform can be used safely from multiple threads. */ | |||||
| BKE_mesh_texspace_ensure(final_mesh); | |||||
| /* Create trees and original coordinates if needed */ | /* Create trees and original coordinates if needed */ | ||||
| if (from == PART_FROM_CHILD) { | if (from == PART_FROM_CHILD) { | ||||
| distr = PART_DISTR_RAND; | distr = PART_DISTR_RAND; | ||||
| rng = BLI_rng_new_srandom(31415926 + psys->seed + psys->child_seed); | rng = BLI_rng_new_srandom(31415926 + psys->seed + psys->child_seed); | ||||
| mesh = final_mesh; | mesh = final_mesh; | ||||
| /* BMESH ONLY */ | /* BMESH ONLY */ | ||||
| BKE_mesh_tessface_ensure(mesh); | BKE_mesh_tessface_ensure(mesh); | ||||
| ▲ Show 20 Lines • Show All 421 Lines • Show Last 20 Lines | |||||