|
Blender V5.0
|
#include <algorithm>#include <cstring>#include "MEM_guardedalloc.h"#include "BLI_jitter_2d.h"#include "BLI_kdtree.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 "BKE_customdata.hh"#include "BKE_global.hh"#include "BKE_lib_id.hh"#include "BKE_mesh.hh"#include "BKE_mesh_legacy_convert.hh"#include "BKE_particle.h"#include "DEG_depsgraph_query.hh"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 460 of file particle_distribute.cc.
| #define PSYS_RND_DIST_SKIP 3 |
Definition at line 457 of file particle_distribute.cc.
Referenced by distribute_children_exec(), distribute_from_faces_exec(), distribute_from_verts_exec(), distribute_from_volume_exec(), exec_distribute_child(), and exec_distribute_parent().
|
static |
Definition at line 36 of file particle_distribute.cc.
References ParticleSystem::child, ParticleSettings::childtype, MEM_calloc_arrayN(), MEM_freeN(), ParticleSystem::part, and ParticleSystem::totchild.
Referenced by distribute_simple_children(), and psys_thread_context_init_distribute().
Definition at line 421 of file particle_distribute.cc.
References sum().
Referenced by psys_thread_context_init_distribute().
|
static |
Definition at line 688 of file particle_distribute.cc.
References BKE_mesh_orco_verts_transform(), BLI_rng_get_float(), BLI_rng_skip(), CD_MFACE, ParticleThreadContext::cfrom, CustomData_get_layer_for_write(), Object::data, DMCACHE_ISCHILD, Mesh::fdata_legacy, float, ChildParticle::foffset, ChildParticle::fuv, i, ParticleThreadContext::index, ParticleThreadContext::mesh, ChildParticle::num, ParticleSimulationData::ob, ChildParticle::pa, ChildParticle::parent, pow, psys_particle_on_dm(), PSYS_RND_DIST_SKIP, psys_uv_to_w(), ParticleThreadContext::sim, Mesh::totface_legacy, ParticleThreadContext::tree, MFace::v4, ChildParticle::w, and w().
Referenced by exec_distribute_child().
|
static |
Definition at line 828 of file particle_distribute.cc.
Referenced by psys_thread_context_init_distribute().
|
static |
Definition at line 519 of file particle_distribute.cc.
References BLI_assert, BLI_rng_get_float(), BLI_rng_skip(), CD_MFACE, CustomData_get_layer_for_write(), ParticleThreadContext::distr, Mesh::fdata_legacy, fmod(), ParticleData::foffset, ParticleData::fuv, i, ParticleThreadContext::index, isnan, ParticleThreadContext::jit, ParticleThreadContext::jitlevel, ParticleThreadContext::jitoff, ParticleThreadContext::mesh, ParticleData::num, PART_DISTR_JIT, PART_DISTR_RAND, PSYS_RND_DIST_SKIP, psys_uv_to_w(), Mesh::totface_legacy, and MFace::v4.
Referenced by exec_distribute_parent().
|
static |
Definition at line 461 of file particle_distribute.cc.
References BKE_mesh_orco_verts_transform(), BLI_assert, BLI_rng_skip(), CD_MFACE, CustomData_get_layer_for_write(), DMCACHE_NOTFOUND, ELEM, Mesh::fdata_legacy, ParticleData::foffset, ParticleData::fuv, i, ParticleThreadContext::index, ParticleThreadContext::mesh, ParticleData::num, ParticleData::num_dmcache, psys_particle_on_dm(), PSYS_RND_DIST_SKIP, Mesh::totface_legacy, ParticleThreadContext::tree, MFace::v1, MFace::v2, MFace::v3, MFace::v4, Mesh::verts_num, w(), and zero_v4().
Referenced by exec_distribute_parent().
|
static |
Definition at line 569 of file particle_distribute.cc.
References BLI_assert, BLI_rng_get_float(), BLI_rng_skip(), CD_MFACE, CustomData_get_layer_for_write(), blender::Span< T >::data(), ParticleThreadContext::distr, Mesh::fdata_legacy, FLT_MAX, fmod(), ParticleData::foffset, ParticleData::fuv, i, ParticleThreadContext::index, intersect(), isect_ray_tri_v3(), isnan, ParticleThreadContext::jit, ParticleThreadContext::jitlevel, ParticleThreadContext::jitoff, ParticleThreadContext::mesh, negate_v3(), nor, normalize_v3(), ParticleData::num, PART_DISTR_JIT, PART_DISTR_RAND, psys_interpolate_face(), PSYS_RND_DIST_SKIP, psys_uv_to_w(), Mesh::totface_legacy, MFace::v1, MFace::v2, v2, MFace::v3, and MFace::v4.
Referenced by exec_distribute_parent().
|
static |
Definition at line 95 of file particle_distribute.cc.
References axis_dominant_v3_single(), CD_MFACE, ceil, copy_v3_v3(), CustomData_get_layer_for_write(), ELEM, Mesh::fdata_legacy, flag, ParticleData::flag, ParticleSettings::flag, float, ParticleSettings::from, ParticleData::fuv, ParticleSettings::grid_rand, ParticleSettings::grid_res, ParticleData::hair_index, i, in, INIT_MINMAX, isect_ray_tri_watertight_v3(), isect_ray_tri_watertight_v3_precalc(), max, min, minmax_v3v3_v3(), 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_legacy, MFace::v1, MFace::v2, v2, MFace::v3, MFace::v4, Mesh::verts_num, and zero_v3().
Referenced by psys_thread_context_init_distribute().
|
static |
Definition at line 853 of file particle_distribute.cc.
References ParticleSystem::child, DAG_EVAL_RENDER, DEG_get_mode(), ParticleSimulationData::depsgraph, ChildParticle::foffset, ChildParticle::fuv, LOOP_PARTICLES, ChildParticle::num, ChildParticle::pa, ChildParticle::parent, PART_FROM_CHILD, PARTICLE_P, ParticleSimulationData::psys, psys_get_tot_child(), and ParticleSimulationData::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 1382 of file particle_distribute.cc.
References distribute_invalid(), distribute_particles_on_dm(), distribute_particles_on_shape(), and PARTICLE_PSMD.
Referenced by particle_system_update(), psys_update_path_cache(), system_step(), and update_children().
|
static |
Definition at line 1336 of file particle_distribute.cc.
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(), ParticleThreadContext::mesh, ParticleSystemModifierData::mesh_final, ParticleSystemModifierData::mesh_original, 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(), task_pool, TASK_PRIORITY_HIGH, ParticleSystem::totchild, and ParticleSystem::totpart.
Referenced by distribute_particles().
|
static |
Definition at line 1375 of file particle_distribute.cc.
References distribute_invalid().
Referenced by distribute_particles().
|
static |
Definition at line 58 of file particle_distribute.cc.
References alloc_child_particles(), BLI_rng_free(), BLI_rng_get_float(), BLI_rng_new_srandom(), ParticleSystem::child, ParticleSystem::child_seed, ChildParticle::fuv, i, len_v3(), length(), ChildParticle::num, ChildParticle::parent, psys_calc_dmcache(), psys_get_child_number(), psys_get_tot_child(), ParticleSystem::seed, and ParticleSystem::totpart.
Referenced by psys_thread_context_init_distribute().
|
static |
Definition at line 810 of file particle_distribute.cc.
References ParticleTask::begin, BLI_rng_skip(), ParticleSystem::child, ParticleTask::ctx, distribute_children_exec(), ParticleTask::end, ParticleSimulationData::psys, PSYS_RND_DIST_SKIP, ParticleTask::rng, and ParticleThreadContext::sim.
Referenced by distribute_particles_on_dm().
|
static |
Definition at line 781 of file particle_distribute.cc.
References ParticleTask::begin, BLI_rng_skip(), ParticleTask::ctx, 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, ParticleSimulationData::psys, PSYS_RND_DIST_SKIP, ParticleTask::rng, and ParticleThreadContext::sim.
Referenced by distribute_particles_on_dm().
Definition at line 318 of file particle_distribute.cc.
References BLI_hammersley_1d(), BLI_rng_free(), BLI_rng_get_double(), BLI_rng_new(), fmod(), out, and seed.
Referenced by psys_thread_context_init_distribute().
Definition at line 340 of file particle_distribute.cc.
References BLI_jitterate1(), BLI_jitterate2(), BLI_rng_free(), BLI_rng_get_float(), BLI_rng_new(), float, floor, i, jit, MEM_freeN(), MEM_malloc_arrayN(), num, sqrtf, and x.
Referenced by psys_thread_context_init_distribute().
|
static |
Definition at line 1328 of file particle_distribute.cc.
References BLI_rng_new(), ParticleSimulationData::psys, ParticleTask::rng, ParticleSystem::seed, and seed.
Referenced by distribute_particles_on_dm().
|
static |
Definition at line 885 of file particle_distribute.cc.
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_MFACE, CD_ORCO, CD_ORIGINDEX, ParticleThreadContext::cfrom, ParticleSystem::child_seed, ParticleSettings::childtype, copy_v3_v3(), CustomData_get_layer(), CustomData_get_layer_for_write(), DAG_EVAL_RENDER, Object::data, DEG_get_mode(), ParticleSimulationData::depsgraph, ParticleSettings::distr, ParticleThreadContext::distr, distribute_binary_search(), distribute_compare_orig_index(), distribute_grid(), distribute_invalid(), distribute_simple_children(), ELEM, Mesh::fdata_legacy, ParticleSettings::flag, float, ParticleData::foffset, ParticleSettings::from, ParticleData::fuv, G, G_DEBUG, hammersley_create(), i, ParticleThreadContext::index, init_mv_jit(), jit, ParticleThreadContext::jit, ParticleSettings::jitfac, ParticleThreadContext::jitlevel, ParticleThreadContext::jitoff, LIB_ID_COPY_LOCALIZE, ParticleThreadContext::maxweight, MEM_calloc_arrayN(), MEM_freeN(), MEM_malloc_arrayN(), ParticleThreadContext::mesh, ParticleSystemModifierData::mesh_final, ParticleSystemModifierData::mesh_original, min, nor, 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, printf, 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, ParticleThreadContext::seams, ParticleSystem::seed, ParticleThreadContext::sim, step, Mesh::totface_legacy, ParticleSystem::totpart, ParticleThreadContext::totseam, ParticleThreadContext::tpars, ParticleThreadContext::tree, tree, ParticleSettings::type, ParticleSettings::use_modifier_stack, ParticleSettings::userjit, MFace::v1, MFace::v2, MFace::v3, MFace::v4, Mesh::vert_data, Mesh::verts_num, and ParticleThreadContext::weight.
Referenced by distribute_particles_on_dm().
Definition at line 381 of file particle_distribute.cc.
References interp_weights_poly_v3(), quad, v, and w().
Referenced by distribute_children_exec(), distribute_from_faces_exec(), and distribute_from_volume_exec().