|
Blender V4.3
|
#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 459 of file particle_distribute.cc.
| #define PSYS_RND_DIST_SKIP 3 |
Definition at line 456 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 35 of file particle_distribute.cc.
References ParticleSystem::child, ParticleSettings::childtype, MEM_callocN, MEM_freeN(), ParticleSystem::part, and ParticleSystem::totchild.
Referenced by distribute_simple_children(), and psys_thread_context_init_distribute().
Definition at line 420 of file particle_distribute.cc.
References sum().
Referenced by psys_thread_context_init_distribute().
|
static |
Definition at line 687 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, float, ChildParticle::foffset, ChildParticle::fuv, 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, ParticleThreadContext::tree, MFace::v4, ChildParticle::w, and w().
Referenced by exec_distribute_child().
|
static |
Definition at line 827 of file particle_distribute.cc.
Referenced by psys_thread_context_init_distribute().
|
static |
Definition at line 518 of file particle_distribute.cc.
References BLI_assert, BLI_rng_get_float(), BLI_rng_skip(), CD_MFACE, CustomData_get_layer_for_write(), ParticleThreadContext::distr, fmod(), ParticleData::foffset, ParticleData::fuv, ParticleThreadContext::index, ParticleThreadContext::jit, ParticleThreadContext::jitlevel, ParticleThreadContext::jitoff, ParticleThreadContext::mesh, ParticleData::num, 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 460 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, 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 568 of file particle_distribute.cc.
References BLI_assert, BLI_rng_get_float(), BLI_rng_skip(), CD_MFACE, CustomData_get_layer_for_write(), ParticleThreadContext::distr, FLT_MAX, fmod(), ParticleData::foffset, ParticleData::fuv, ParticleThreadContext::index, intersect(), isect_ray_tri_v3(), 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(), 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, flag, ParticleData::flag, ParticleSettings::flag, float, ParticleSettings::from, ParticleData::fuv, ParticleSettings::grid_rand, ParticleSettings::grid_res, ParticleData::hair_index, INIT_MINMAX, int, isect_ray_tri_watertight_v3(), isect_ray_tri_watertight_v3_precalc(), 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(), sub_v3_v3v3(), ParticleSystem::totpart, MFace::v1, MFace::v2, v2, MFace::v3, MFace::v4, and zero_v3().
Referenced by psys_thread_context_init_distribute().
|
static |
Definition at line 852 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 1394 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 1343 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 1387 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, len_v3(), 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 809 of file particle_distribute.cc.
References BLI_rng_skip(), ParticleSystem::child, distribute_children_exec(), and PSYS_RND_DIST_SKIP.
Referenced by distribute_particles_on_dm().
|
static |
Definition at line 780 of file particle_distribute.cc.
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, and PSYS_RND_DIST_SKIP.
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(), double(), fmod(), 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(), jit, MEM_freeN(), MEM_mallocN, sqrtf, and x.
Referenced by psys_thread_context_init_distribute().
|
static |
Definition at line 1335 of file particle_distribute.cc.
References BLI_rng_new(), ParticleSimulationData::psys, ParticleSystem::seed, and seed.
Referenced by distribute_particles_on_dm().
|
static |
Definition at line 884 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, copy_v3_v3(), CustomData_get_layer(), CustomData_get_layer_for_write(), DAG_EVAL_RENDER, Object::data, DEG_get_mode(), ParticleSimulationData::depsgraph, ParticleThreadContext::distr, distribute_binary_search(), distribute_compare_orig_index(), distribute_grid(), distribute_invalid(), distribute_simple_children(), double(), ELEM, Mesh::fdata_legacy, float, ParticleData::foffset, ParticleData::fuv, G, G_DEBUG, hammersley_create(), ParticleThreadContext::index, init_mv_jit(), jit, ParticleThreadContext::jit, ParticleThreadContext::jitlevel, ParticleThreadContext::jitoff, LIB_ID_COPY_LOCALIZE, ParticleThreadContext::maxweight, MEM_callocN, MEM_freeN(), MEM_mallocN, mesh, ParticleThreadContext::mesh, ParticleSystemModifierData::mesh_final, ParticleSystemModifierData::mesh_original, min, nor, ParticleData::num, ParticleData::num_dmcache, ParticleSimulationData::ob, 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, ParticleSystem::totpart, ParticleThreadContext::totseam, ParticleThreadContext::tpars, ParticleThreadContext::tree, tree, ParticleSettings::use_modifier_stack, MFace::v1, MFace::v2, MFace::v3, MFace::v4, and ParticleThreadContext::weight.
Referenced by distribute_particles_on_dm().
Definition at line 380 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().