Blender
V3.3
|
#include <string.h>
#include "MEM_guardedalloc.h"
#include "BLI_jitter_2d.h"
#include "BLI_kdtree.h"
#include "BLI_math.h"
#include "BLI_math_geom.h"
#include "BLI_rand.h"
#include "BLI_sort.h"
#include "BLI_task.h"
#include "BLI_utildefines.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_modifier_types.h"
#include "DNA_particle_types.h"
#include "DNA_scene_types.h"
#include "BKE_customdata.h"
#include "BKE_global.h"
#include "BKE_lib_id.h"
#include "BKE_mesh.h"
#include "BKE_mesh_legacy_convert.h"
#include "BKE_object.h"
#include "BKE_particle.h"
#include "DEG_depsgraph_query.h"
Go to the source code of this file.
Macros | |
#define | PSYS_RND_DIST_SKIP 3 |
#define | ONLY_WORKING_WITH_PA_VERTS 0 |
#define ONLY_WORKING_WITH_PA_VERTS 0 |
Definition at line 461 of file particle_distribute.c.
#define PSYS_RND_DIST_SKIP 3 |
Definition at line 458 of file particle_distribute.c.
|
static |
Definition at line 37 of file particle_distribute.c.
References ParticleSystem::child, ParticleSettings::childtype, MEM_callocN, MEM_freeN, NULL, ParticleSystem::part, and ParticleSystem::totchild.
Referenced by distribute_simple_children(), and psys_thread_context_init_distribute().
Definition at line 422 of file particle_distribute.c.
References high(), low(), and sum().
Referenced by psys_thread_context_init_distribute().
|
static |
Definition at line 672 of file particle_distribute.c.
References BKE_mesh_orco_verts_transform(), BLI_rng_get_float(), BLI_rng_skip(), ParticleThreadContext::cfrom, Object::data, DMCACHE_ISCHILD, float(), ChildParticle::foffset, ChildParticle::fuv, ParticleThreadContext::index, ParticleThreadContext::mesh, mesh, Mesh::mface, NULL, ChildParticle::num, ParticleSimulationData::ob, ChildParticle::pa, ChildParticle::parent, pow(), psys_particle_on_dm(), PSYS_RND_DIST_SKIP, psys_uv_to_w(), ParticleThreadContext::sim, ParticleThreadContext::tree, MFace::v4, w(), and ChildParticle::w.
Referenced by exec_distribute_child().
|
static |
Definition at line 810 of file particle_distribute.c.
References user_data.
Referenced by psys_thread_context_init_distribute().
|
static |
Definition at line 519 of file particle_distribute.c.
References BLI_assert, BLI_rng_get_float(), BLI_rng_skip(), ParticleThreadContext::distr, ParticleData::foffset, ParticleData::fuv, ParticleThreadContext::index, libmv::isnan(), ParticleThreadContext::jit, ParticleThreadContext::jitlevel, ParticleThreadContext::jitoff, ParticleThreadContext::mesh, mesh, Mesh::mface, ParticleData::num, offset, PART_DISTR_JIT, PART_DISTR_RAND, PSYS_RND_DIST_SKIP, psys_uv_to_w(), and MFace::v4.
Referenced by exec_distribute_parent().
|
static |
Definition at line 462 of file particle_distribute.c.
References BKE_mesh_orco_verts_transform(), BLI_assert, BLI_rng_skip(), DMCACHE_NOTFOUND, ELEM, ParticleData::foffset, from, ParticleData::fuv, ParticleThreadContext::index, ParticleThreadContext::mesh, Mesh::mface, ParticleData::num, ParticleData::num_dmcache, psys_particle_on_dm(), PSYS_RND_DIST_SKIP, Mesh::totface, Mesh::totvert, ParticleThreadContext::tree, MFace::v1, MFace::v2, MFace::v3, MFace::v4, w(), and zero_v4().
Referenced by exec_distribute_parent().
|
static |
Definition at line 567 of file particle_distribute.c.
References BKE_mesh_vertex_normals_ensure(), BLI_assert, BLI_rng_get_float(), BLI_rng_skip(), MVert::co, ParticleThreadContext::distr, ParticleData::foffset, ParticleData::fuv, ParticleThreadContext::index, intersect(), isect_ray_tri_v3(), libmv::isnan(), ParticleThreadContext::jit, ParticleThreadContext::jitlevel, ParticleThreadContext::jitoff, ParticleThreadContext::mesh, mesh, Mesh::mface, Mesh::mvert, negate_v3(), nor, normalize_v3(), NULL, ParticleData::num, offset, PART_DISTR_JIT, PART_DISTR_RAND, psys_interpolate_face(), PSYS_RND_DIST_SKIP, psys_uv_to_w(), Mesh::totface, v1, MFace::v1, v2, MFace::v2, MFace::v3, and MFace::v4.
Referenced by exec_distribute_parent().
|
static |
Definition at line 96 of file particle_distribute.c.
References Freestyle::a, axis_dominant_v3_single(), ceil(), MVert::co, copy_v3_v3(), ELEM, ParticleData::flag, ParticleSettings::flag, float(), from, ParticleSettings::from, ParticleData::fuv, ParticleSettings::grid_rand, ParticleSettings::grid_res, ParticleData::hair_index, isect_ray_tri_watertight_v3(), isect_ray_tri_watertight_v3_precalc(), max, MAX2, mesh, Mesh::mface, min, MIN2, minmax_v3v3_v3(), Mesh::mvert, NULL, PARS_UNEXIST, ParticleSystem::part, PART_FROM_FACE, PART_FROM_VERT, PART_FROM_VOLUME, PART_GRID_HEXAGONAL, PART_GRID_INVERT, ParticleSystem::particles, psys_frand(), size(), sub_v3_v3v3(), Mesh::totface, Mesh::totvert, v1, MFace::v1, v2, MFace::v2, MFace::v3, MFace::v4, and zero_v3().
Referenced by psys_thread_context_init_distribute().
|
static |
Definition at line 835 of file particle_distribute.c.
References ParticleSystem::child, DAG_EVAL_RENDER, DEG_get_mode(), ParticleSimulationData::depsgraph, ChildParticle::foffset, from, ChildParticle::fuv, LOOP_PARTICLES, ChildParticle::num, ChildParticle::pa, ChildParticle::parent, PART_FROM_CHILD, PARTICLE_P, ParticleSimulationData::psys, psys_get_tot_child(), ParticleSimulationData::scene, and scene.
Referenced by distribute_particles(), distribute_particles_on_shape(), and psys_thread_context_init_distribute().
void distribute_particles | ( | ParticleSimulationData * | sim, |
int | from | ||
) |
Definition at line 1358 of file particle_distribute.c.
References distribute_invalid(), distribute_particles_on_dm(), distribute_particles_on_shape(), from, and PARTICLE_PSMD.
Referenced by particle_system_update(), psys_update_path_cache(), system_step(), and update_children().
|
static |
Definition at line 1307 of file particle_distribute.c.
References BKE_id_free(), BLI_task_pool_create(), BLI_task_pool_free(), BLI_task_pool_push(), BLI_task_pool_work_and_wait(), exec_distribute_child(), exec_distribute_parent(), from, ParticleThreadContext::mesh, ParticleSystemModifierData::mesh_final, ParticleSystemModifierData::mesh_original, NULL, ParticleSimulationData::ob, PART_FROM_CHILD, ParticleSimulationData::psmd, ParticleSimulationData::psys, psys_calc_dmcache(), psys_task_init_distribute(), psys_tasks_create(), psys_tasks_free(), psys_thread_context_free(), psys_thread_context_init_distribute(), blender::compositor::task, task_pool, TASK_PRIORITY_HIGH, ParticleSystem::totchild, and ParticleSystem::totpart.
Referenced by distribute_particles().
|
static |
Definition at line 1351 of file particle_distribute.c.
References distribute_invalid().
Referenced by distribute_particles().
|
static |
Definition at line 59 of file particle_distribute.c.
References alloc_child_particles(), BLI_rng_free(), BLI_rng_get_float(), BLI_rng_new_srandom(), ParticleSystem::child, ParticleSystem::child_seed, ChildParticle::fuv, len_v3(), blender::math::length(), NULL, ChildParticle::num, ChildParticle::parent, psys_calc_dmcache(), psys_get_child_number(), psys_get_tot_child(), scene, ParticleSystem::seed, and ParticleSystem::totpart.
Referenced by psys_thread_context_init_distribute().
Definition at line 792 of file particle_distribute.c.
References BLI_rng_skip(), ParticleSystem::child, distribute_children_exec(), PSYS_RND_DIST_SKIP, and blender::compositor::task.
Referenced by distribute_particles_on_dm().
Definition at line 763 of file particle_distribute.c.
References BLI_rng_skip(), distribute_from_faces_exec(), distribute_from_verts_exec(), distribute_from_volume_exec(), ParticleSettings::from, ParticleSystem::part, PART_FROM_FACE, PART_FROM_VERT, PART_FROM_VOLUME, ParticleSystem::particles, PSYS_RND_DIST_SKIP, and blender::compositor::task.
Referenced by distribute_particles_on_dm().
Definition at line 322 of file particle_distribute.c.
References BLI_hammersley_1d(), BLI_rng_free(), BLI_rng_get_double(), BLI_rng_new(), double(), usdtokens::out(), seed, and t.
Referenced by psys_thread_context_init_distribute().
Definition at line 342 of file particle_distribute.c.
References BLI_jitterate1(), BLI_jitterate2(), BLI_rng_free(), BLI_rng_get_float(), BLI_rng_new(), float(), blender::math::floor(), jit, MEM_freeN, MEM_mallocN, sqrtf, and x.
Referenced by psys_thread_context_init_distribute().
|
static |
Definition at line 1299 of file particle_distribute.c.
References BLI_rng_new(), ParticleSimulationData::psys, seed, ParticleSystem::seed, and blender::compositor::task.
Referenced by distribute_particles_on_dm().
|
static |
Definition at line 867 of file particle_distribute.c.
References alloc_child_particles(), area_quad_v3(), area_tri_v3(), BKE_id_copy_ex(), BKE_id_free(), BKE_mesh_orco_ensure(), BKE_mesh_orco_verts_transform(), BKE_mesh_tessface_ensure(), BKE_mesh_texspace_ensure(), BLI_array_randomize(), BLI_assert, BLI_qsort_r(), BLI_rng_free(), BLI_rng_get_float(), BLI_rng_new_srandom(), CD_ORCO, CD_ORIGINDEX, ParticleThreadContext::cfrom, ParticleSystem::child_seed, ParticleSettings::childtype, BMVert::co, MVert::co, copy_v3_v3(), CustomData_get_layer(), DAG_EVAL_RENDER, Object::data, Mesh_Runtime::deformed_only, DEG_get_mode(), ParticleSimulationData::depsgraph, ParticleThreadContext::distr, ParticleSettings::distr, distribute_binary_search(), distribute_compare_orig_index(), distribute_grid(), distribute_invalid(), distribute_simple_children(), ELEM, Mesh::fdata, ParticleSettings::flag, float(), ParticleData::foffset, from, ParticleSettings::from, ParticleData::fuv, G, G_DEBUG, hammersley_create(), if(), ParticleThreadContext::index, init_mv_jit(), ParticleThreadContext::jit, jit, ParticleSettings::jitfac, ParticleThreadContext::jitlevel, ParticleThreadContext::jitoff, LIB_ID_COPY_LOCALIZE, ParticleThreadContext::maxweight, MEM_callocN, MEM_freeN, MEM_mallocN, ParticleThreadContext::mesh, mesh, ParticleSystemModifierData::mesh_final, ParticleSystemModifierData::mesh_original, Mesh::mface, min, MIN2, Mesh::mvert, nor, NULL, ParticleData::num, ParticleData::num_dmcache, ParticleSimulationData::ob, ParticleSettings::parents, ParticleSystem::part, PART_CHILD_FACES, PART_DISTR_GRID, PART_DISTR_JIT, PART_DISTR_RAND, PART_EDISTR, PART_FROM_CHILD, PART_FROM_FACE, PART_FROM_VERT, PART_FROM_VOLUME, PART_HAIR, PART_TRAND, ParticleSystem::particles, pos, ParticleSimulationData::psmd, ParticleSimulationData::psys, psys_cache_vgroup(), psys_get_tot_child(), psys_particle_on_dm(), psys_thread_context_init(), PSYS_VG_DENSITY, Mesh::runtime, ParticleSimulationData::scene, scene, ParticleThreadContext::seams, ParticleSystem::seed, ParticleThreadContext::sim, Mesh::totface, ParticleSystem::totpart, ParticleThreadContext::totseam, Mesh::totvert, ParticleThreadContext::tpars, ParticleThreadContext::tree, tree, ParticleSettings::type, ParticleSettings::use_modifier_stack, ParticleSettings::userjit, v1, MFace::v1, v2, MFace::v2, MFace::v3, MFace::v4, Mesh::vdata, and ParticleThreadContext::weight.
Referenced by distribute_particles_on_dm().
Definition at line 382 of file particle_distribute.c.
References interp_weights_poly_v3(), quad, v, and w().
Referenced by distribute_children_exec(), distribute_from_faces_exec(), and distribute_from_volume_exec().