|
Blender
V2.93
|
#include <math.h>#include <stdlib.h>#include <string.h>#include "MEM_guardedalloc.h"#include "DNA_defaults.h"#include "DNA_cloth_types.h"#include "DNA_collection_types.h"#include "DNA_curve_types.h"#include "DNA_dynamicpaint_types.h"#include "DNA_fluid_types.h"#include "DNA_key_types.h"#include "DNA_material_types.h"#include "DNA_mesh_types.h"#include "DNA_meshdata_types.h"#include "DNA_object_force_types.h"#include "DNA_particle_types.h"#include "DNA_scene_types.h"#include "BLI_blenlib.h"#include "BLI_kdopbvh.h"#include "BLI_kdtree.h"#include "BLI_linklist.h"#include "BLI_math.h"#include "BLI_rand.h"#include "BLI_task.h"#include "BLI_threads.h"#include "BLI_utildefines.h"#include "BLT_translation.h"#include "BKE_anim_data.h"#include "BKE_anim_path.h"#include "BKE_boids.h"#include "BKE_cloth.h"#include "BKE_collection.h"#include "BKE_colortools.h"#include "BKE_deform.h"#include "BKE_displist.h"#include "BKE_effect.h"#include "BKE_idtype.h"#include "BKE_key.h"#include "BKE_lattice.h"#include "BKE_lib_id.h"#include "BKE_lib_query.h"#include "BKE_main.h"#include "BKE_material.h"#include "BKE_mesh.h"#include "BKE_modifier.h"#include "BKE_object.h"#include "BKE_particle.h"#include "BKE_pointcache.h"#include "BKE_scene.h"#include "BKE_texture.h"#include "DEG_depsgraph.h"#include "DEG_depsgraph_build.h"#include "DEG_depsgraph_query.h"#include "RE_texture.h"#include "BLO_read_write.h"#include "particle_private.h"Go to the source code of this file.
Classes | |
| struct | ParticleInterpolationData |
| struct | CacheEditrPathsIterData |
Macros | |
| #define | DNA_DEPRECATED_ALLOW |
| #define | PATH_CACHE_BUF_SIZE 1024 |
| #define | SET_PARTICLE_TEXTURE(type, pvalue, texfac) |
| #define | CLAMP_PARTICLE_TEXTURE_POS(type, pvalue) |
| #define | CLAMP_WARP_PARTICLE_TEXTURE_POS(type, pvalue) |
| #define | CLAMP_PARTICLE_TEXTURE_POSNEG(type, pvalue) |
Typedefs | |
| typedef struct ParticleInterpolationData | ParticleInterpolationData |
| typedef struct CacheEditrPathsIterData | CacheEditrPathsIterData |
Variables | |
| IDTypeInfo | IDType_ID_PA |
| unsigned int | PSYS_FRAND_SEED_OFFSET [PSYS_FRAND_COUNT] |
| unsigned int | PSYS_FRAND_SEED_MULTIPLIER [PSYS_FRAND_COUNT] |
| float | PSYS_FRAND_BASE [PSYS_FRAND_COUNT] |
| void(* | BKE_particle_batch_cache_dirty_tag_cb )(ParticleSystem *psys, int mode) = NULL |
| void(* | BKE_particle_batch_cache_free_cb )(ParticleSystem *psys) = NULL |
| #define CLAMP_PARTICLE_TEXTURE_POS | ( | type, | |
| pvalue | |||
| ) |
Definition at line 4212 of file particle.c.
| #define CLAMP_PARTICLE_TEXTURE_POSNEG | ( | type, | |
| pvalue | |||
| ) |
Definition at line 4227 of file particle.c.
| #define CLAMP_WARP_PARTICLE_TEXTURE_POS | ( | type, | |
| pvalue | |||
| ) |
Definition at line 4218 of file particle.c.
| #define DNA_DEPRECATED_ALLOW |
Definition at line 25 of file particle.c.
| #define PATH_CACHE_BUF_SIZE 1024 |
Definition at line 594 of file particle.c.
| #define SET_PARTICLE_TEXTURE | ( | type, | |
| pvalue, | |||
| texfac | |||
| ) |
Definition at line 4206 of file particle.c.
| typedef struct CacheEditrPathsIterData CacheEditrPathsIterData |
| typedef struct ParticleInterpolationData ParticleInterpolationData |
| void BKE_particle_batch_cache_dirty_tag | ( | ParticleSystem * | psys, |
| int | mode | ||
| ) |
Definition at line 5243 of file particle.c.
References ParticleSystem::batch_cache, and BKE_particle_batch_cache_dirty_tag_cb.
Referenced by BKE_object_eval_eval_base_flags(), brush_edit_apply(), clear_edited_exec(), delete_exec(), flushTransParticles(), mirror_exec(), particle_system_update(), particle_undosys_step_decode(), and shape_cut_exec().
| void BKE_particle_batch_cache_free | ( | ParticleSystem * | psys | ) |
Definition at line 5249 of file particle.c.
References ParticleSystem::batch_cache, and BKE_particle_batch_cache_free_cb.
Referenced by psys_free().
| void BKE_particle_init_rng | ( | void | ) |
Definition at line 523 of file particle.c.
References BLI_rng_free(), BLI_rng_get_float(), BLI_rng_get_int(), BLI_rng_new_srandom(), PSYS_FRAND_BASE, PSYS_FRAND_COUNT, PSYS_FRAND_SEED_MULTIPLIER, and PSYS_FRAND_SEED_OFFSET.
Referenced by main().
| void BKE_particle_partdeflect_blend_read_data | ( | BlendDataReader * | UNUSEDreader, |
| PartDeflect * | pd | ||
| ) |
Definition at line 314 of file particle.c.
References NULL, and PartDeflect::rng.
Referenced by particle_settings_blend_read_data().
| void BKE_particle_partdeflect_blend_read_lib | ( | BlendLibReader * | reader, |
| ID * | id, | ||
| PartDeflect * | pd | ||
| ) |
Definition at line 372 of file particle.c.
References BLO_read_id_address, PartDeflect::f_source, id, ID::lib, and PartDeflect::tex.
Referenced by object_blend_read_lib(), and particle_settings_blend_read_lib().
| void BKE_particle_system_blend_read_data | ( | BlendDataReader * | reader, |
| ListBase * | particles | ||
| ) |
Definition at line 5300 of file particle.c.
References Freestyle::a, ParticleSystem::batch_cache, BKE_ptcache_blend_read_data(), BLI_listbase_clear(), BLO_read_data_address, BLO_read_list(), ParticleData::boid, ParticleSystem::bvhtree, ParticleSystem::child, ParticleSystem::childcache, ParticleSystem::childcachebufs, ParticleSystem::clmd, ClothModifierData::clothObject, ClothModifierData::coll_parms, ParticleSystem::edit, ClothSimSettings::effector_weights, ParticleSystem::effectors, ParticleSystem::flag, ParticleSystem::fluid_springs, ParticleSystem::free_edit, BoidParticle::ground, ParticleData::hair, ParticleSystem::hair_in_mesh, ParticleSystem::hair_out_mesh, ClothModifierData::hairdata, ParticleData::keys, LISTBASE_FOREACH, NULL, ParticleSystem::orig_psys, ParticleSystem::particles, ParticleSystem::pathcache, ParticleSystem::pathcachebufs, ParticleSystem::pdd, ClothModifierData::point_cache, ParticleSystem::pointcache, ClothSimSettings::presets, PSYS_KEYED, ParticleSystem::ptcaches, ClothModifierData::sim_parms, ClothModifierData::solver_result, ParticleSystem::targets, ParticleData::totkey, ParticleSystem::totpart, and ParticleSystem::tree.
Referenced by object_blend_read_data().
| void BKE_particle_system_blend_read_lib | ( | BlendLibReader * | reader, |
| Object * | ob, | ||
| ID * | id, | ||
| ListBase * | particles | ||
| ) |
Definition at line 5388 of file particle.c.
References BKE_modifier_free(), BKE_modifier_remove_from_list(), BLI_remlink(), BLO_read_id_address, ParticleSystem::clmd, ClothModifierData::coll_parms, ModifierData::error, ListBase::first, ClothCollSettings::group, id, ListBase::last, ID::lib, LISTBASE_FOREACH, LISTBASE_FOREACH_MUTABLE, MEM_freeN, ClothModifierData::modifier, NULL, ParticleSystem::parent, ParticleSystem::part, ClothModifierData::point_cache, ParticleSystem::pointcache, psys_get_modifier(), ClothModifierData::ptcaches, ParticleSystem::target_ob, and ParticleSystem::targets.
Referenced by object_blend_read_lib().
| void BKE_particle_system_blend_write | ( | BlendWriter * | writer, |
| ListBase * | particles | ||
| ) |
Definition at line 5256 of file particle.c.
References Freestyle::a, BKE_ptcache_blend_write(), BLO_write_struct, BLO_write_struct_array, ParticleData::boid, ParticleSystem::child, ParticleSystem::clmd, ClothModifierData::coll_parms, SPHFluidSettings::flag, ParticleSettings::fluid, ParticleSystem::fluid_springs, ParticleData::hair, LISTBASE_FOREACH, ParticleSystem::part, PART_PHYS_BOIDS, PART_PHYS_FLUID, ParticleSystem::particles, ParticleSettings::phystype, ParticleSystem::ptcaches, ClothModifierData::sim_parms, SPH_VISCOELASTIC_SPRINGS, ParticleSystem::targets, ParticleSystem::tot_fluidsprings, ParticleSystem::totchild, ParticleData::totkey, and ParticleSystem::totpart.
Referenced by object_blend_write().
| ParticleSettings* BKE_particlesettings_add | ( | Main * | bmain, |
| const char * | name | ||
| ) |
Definition at line 4086 of file particle.c.
References BKE_id_new(), and ID_PA.
Referenced by blo_do_versions_pre250(), new_particle_settings_exec(), and object_add_or_copy_particle_system().
| void BKE_particlesettings_clump_curve_init | ( | ParticleSettings * | part | ) |
Definition at line 4095 of file particle.c.
References BKE_curvemapping_add(), BKE_curvemapping_init(), ParticleSettings::clumpcurve, CurveMapping::cm, CurveMap::curve, CurveMapPoint::x, and CurveMapPoint::y.
| void BKE_particlesettings_rough_curve_init | ( | ParticleSettings * | part | ) |
Definition at line 4109 of file particle.c.
References BKE_curvemapping_add(), BKE_curvemapping_init(), CurveMapping::cm, CurveMap::curve, ParticleSettings::roughcurve, CurveMapPoint::x, and CurveMapPoint::y.
| void BKE_particlesettings_twist_curve_init | ( | ParticleSettings * | part | ) |
Definition at line 4123 of file particle.c.
References BKE_curvemapping_add(), BKE_curvemapping_init(), CurveMapping::cm, CurveMap::curve, ParticleSettings::twistcurve, CurveMapPoint::x, and CurveMapPoint::y.
|
static |
Definition at line 3232 of file particle.c.
References angle(), axis_angle_to_quat(), ParticleCacheKey::co, copy_v3_v3(), copy_v4_v4(), cross_v3_v3v3(), dot_v3v3(), mul_qt_qtqt(), normal, normalize_v3(), ParticleCacheKey::rot, saacos(), sub_v3_v3v3(), and unit_qt().
Referenced by psys_cache_edit_paths_iter().
| void copy_particle_key | ( | ParticleKey * | to, |
| ParticleKey * | from, | ||
| int | time | ||
| ) |
Definition at line 3763 of file particle.c.
References from, time, and ParticleKey::time.
Referenced by boid_body(), do_particle_interpolation(), dynamics_step(), get_pointcache_keys_for_time(), integrate_particle(), psys_get_particle_on_path(), set_keyed_keys(), and sph_integrate().
| int count_particles | ( | ParticleSystem * | psys | ) |
Definition at line 555 of file particle.c.
References ParticleSettings::flag, LOOP_SHOWN_PARTICLES, PARS_DEAD, PARS_UNBORN, ParticleSystem::part, PART_DIED, PART_UNBORN, and PARTICLE_P.
| int count_particles_mod | ( | ParticleSystem * | psys, |
| int | totgr, | ||
| int | cur | ||
| ) |
Definition at line 573 of file particle.c.
References ParticleSettings::flag, LOOP_SHOWN_PARTICLES, PARS_DEAD, PARS_UNBORN, ParticleSystem::part, PART_DIED, PART_UNBORN, and PARTICLE_P.
| int do_guides | ( | Depsgraph * | depsgraph, |
| ParticleSettings * | part, | ||
| ListBase * | effectors, | ||
| ParticleKey * | state, | ||
| int | index, | ||
| float | time | ||
| ) |
Definition at line 2381 of file particle.c.
References add_v3_v3(), angle(), axis_angle_to_quat(), BKE_curvemapping_changed_all(), BKE_displist_calc_taper(), BKE_where_on_path(), ParticleSettings::child_flag, CLAMP, PartDeflect::clump_fac, ParticleSettings::clump_noise_size, PartDeflect::clump_pow, ParticleSettings::clumpcurve, ParticleKey::co, copy_v3_v3(), cross_v3_v3v3(), CU_PATH_RADIUS, data, Object::data, depsgraph, do_clump(), do_kink(), dot_v3v3(), ListBase::first, Curve::flag, PartDeflect::flag, PartDeflect::forcefield, PartDeflect::free_end, EffectorCache::guide_data, EffectorCache::guide_dir, EffectorCache::guide_loc, if(), interp_v3_v3v3(), PartDeflect::kink, PartDeflect::kink_amp, PartDeflect::kink_axis, PartDeflect::kink_freq, PartDeflect::kink_shape, len_v3(), madd_v3_v3fl(), mul_m4_v3(), mul_mat3_m4_v3(), mul_qt_v3(), mul_v3_fl(), EffectorCache::next, normalize_v3(), NULL, EffectorCache::ob, Object::obmat, PART_CHILD_USE_CLUMP_CURVE, PART_CHILD_USE_CLUMP_NOISE, PART_CHILD_USE_ROUGH_CURVE, EffectorCache::pd, PFIELD_GUIDE, PFIELD_GUIDE_PATH_ADD, PFIELD_GUIDE_PATH_WEIGHT, ParticleSettings::roughcurve, saacos(), EffectorCache::scene, state, Curve::taperobj, and time.
Referenced by basic_integrate(), do_child_modifiers(), and psys_get_particle_on_path().
|
static |
Definition at line 1431 of file particle.c.
References ParticleInterpolationData::bspline, ParticleInterpolationData::cache, CLAMP, copy_particle_key(), ParticleData::dietime, ParticleTarget::duration, edit_to_particle(), ParticleInterpolationData::ekey, ParticleInterpolationData::epoint, ListBase::first, ParticleSystem::flag, get_pointcache_keys_for_time(), ParticleData::hair, hair_to_particle(), ParticleInterpolationData::hkey, interp_qt_qtqt(), KEY_BSPLINE, KEY_CARDINAL, ParticleInterpolationData::keyed, PTCacheEditPoint::keys, ParticleInterpolationData::kkey, ListBase::last, ParticleInterpolationData::mesh, mul_v3_fl(), ParticleInterpolationData::mvert, mvert_to_particle(), ParticleTarget::next, NULL, ParticleSystem::part, PART_PHYS_KEYED, ParticleSettings::phystype, ParticleInterpolationData::pm, ParticleTarget::prev, psys_interpolate_particle(), PSYS_KEYED_TIMING, result, ParticleKey::rot, t, ParticleSystem::targets, PTCacheEditKey::time, HairKey::time, ParticleKey::time, ParticleTarget::time, ParticleData::time, ParticleSettings::timetweak, PTCacheEditPoint::totkey, ParticleData::totkey, and PTCacheEditKey::vel.
Referenced by psys_cache_edit_paths_iter(), and psys_get_particle_on_path().
|
static |
Definition at line 2543 of file particle.c.
References add_v3_v3(), BKE_effectors_apply(), ParticleCacheKey::co, ParticleKey::co, ParticleSimulationData::colliders, copy_qt_qt(), copy_v3_v3(), ParticleSettings::eff_hair, ParticleSettings::effector_weights, ParticleSystem::effectors, ParticleSystem::flag, len_v3(), length(), madd_v3_v3v3fl(), mul_v3_fl(), normalize_v3(), NULL, ParticleSystem::part, ParticleSystem::particles, pd_point_from_particle(), powf, ParticleSimulationData::psys, PSYS_HAIR_DYNAMICS, ParticleKey::rot, steps, sub_v3_v3v3(), and ParticleKey::vel.
Referenced by psys_thread_create_path().
|
static |
Definition at line 1411 of file particle.c.
References PTCacheEditKey::co, ParticleKey::co, copy_v3_v3(), PTCacheEditKey::time, ParticleKey::time, PTCacheEditKey::vel, and ParticleKey::vel.
Referenced by do_particle_interpolation().
|
static |
Definition at line 3149 of file particle.c.
References BLI_assert, ParticleSystem::child, ParticleSystem::childcache, ParticleSimulationData::psys, psys_thread_create_path(), ParticleThreadContext::sim, and blender::compositor::task.
Referenced by psys_cache_child_paths().
|
static |
Definition at line 915 of file particle.c.
References MEM_freeN.
Referenced by particle_settings_free_data().
|
static |
Definition at line 980 of file particle.c.
References ParticleSystem::childcache, ParticleSystem::childcachebufs, NULL, psys_free_path_cache_buffers(), and ParticleSystem::totchildcache.
Referenced by psys_cache_child_paths(), psys_free_children(), and psys_free_path_cache().
| void free_hair | ( | Object * | object, |
| ParticleSystem * | psys, | ||
| int | dynamics | ||
| ) |
Definition at line 922 of file particle.c.
References BKE_id_free(), BKE_modifier_free(), BKE_ptcache_id_clear(), BKE_ptcache_id_from_particles(), ParticleSystem::clmd, cloth_free_modifier(), ParticleSystem::flag, ParticleSystem::hair_in_mesh, ParticleSystem::hair_out_mesh, LOOP_PARTICLES, MEM_freeN, NULL, PARTICLE_P, PSYS_HAIR_DONE, and PTCACHE_CLEAR_ALL.
Referenced by particle_system_update(), psys_changed_type(), and psys_free().
| void free_keyed_keys | ( | ParticleSystem * | psys | ) |
Definition at line 960 of file particle.c.
References ParticleData::keys, LOOP_PARTICLES, MEM_freeN, NULL, ParticleSystem::part, PART_HAIR, PARTICLE_P, ParticleSystem::particles, and ParticleSettings::type.
Referenced by particle_system_update(), psys_prepare_physics(), and set_keyed_keys().
|
static |
Definition at line 4523 of file particle.c.
References ParticleSystem::cfra, ParticleSystem::child, ParticleTexture::clump, ParticleTexture::effector, ParticleTexture::exist, get_cpa_texture(), ParticleTexture::kink_freq, ParticleTexture::length, ParticleThreadContext::mesh, ChildParticle::pa, PAMAP_CHILD, PAMAP_DENS, ParticleSystem::particles, ParticleSimulationData::psys, psys_frand(), psys_interpolate_value_from_verts(), ParticleTexture::rough1, ParticleTexture::rough2, ParticleTexture::roughe, ParticleThreadContext::sim, ParticleTexture::twist, ParticleThreadContext::vg_clump, ParticleThreadContext::vg_effector, ParticleThreadContext::vg_kink, ParticleThreadContext::vg_length, ParticleThreadContext::vg_rough1, ParticleThreadContext::vg_rough2, ParticleThreadContext::vg_roughe, and ParticleThreadContext::vg_twist.
Referenced by psys_get_particle_on_path(), and psys_thread_create_path().
|
static |
Definition at line 4233 of file particle.c.
References ATTR_FALLTHROUGH, blend(), MTex::blendtype, CLAMP_PARTICLE_TEXTURE_POS, CLAMP_WARP_PARTICLE_TEXTURE_POS, ParticleSettings::clength, ParticleSettings::clength_thres, ParticleTexture::clump, MTex::clumpfac, ParticleKey::co, copy_v3_v3(), ParticleTexture::damp, MTex::def_var, ParticleData::dietime, ParticleSettings::distr, ParticleTexture::effector, ELEM, ParticleTexture::exist, ParticleTexture::field, ParticleSettings::from, get_particle_uv(), ParticleTexture::gravity, Object::imat, ParticleTexture::ivel, ParticleTexture::kink_amp, ParticleTexture::kink_freq, MTex::kinkampfac, MTex::kinkfac, ParticleTexture::length, MTex::lengthfac, ParticleTexture::life, MTex::mapto, MAX_MTEX, mesh, ParticleSettings::mtex, mul_m4_v3(), NULL, MTex::object, MTex::padensfac, PAMAP_CLUMP, PAMAP_DENS, PAMAP_KINK_AMP, PAMAP_KINK_FREQ, PAMAP_LENGTH, PAMAP_ROUGH, PAMAP_TWIST, PART_DISTR_GRID, PART_FROM_FACE, PART_FROM_VERT, PART_FROM_VOLUME, psys_frand(), ParticleSettings::randlength, RE_texture_evaluate(), ParticleTexture::rough1, ParticleTexture::rough2, ParticleTexture::roughe, MTex::roughfac, SET_PARTICLE_TEXTURE, ParticleTexture::size, ParticleData::state, MTex::tex, MTex::texco, TEXCO_GLOB, TEXCO_OBJECT, TEXCO_ORCO, TEXCO_PARTICLE, TEXCO_UV, texture_value_blend(), ParticleTexture::time, ParticleData::time, ParticleTexture::twist, MTex::twistfac, and MTex::uvname.
Referenced by get_child_modifier_parameters(), and psys_find_parents().
|
static |
Definition at line 4141 of file particle.c.
References CD_MTFACE, CustomData_get_layer_named(), DMCACHE_ISCHILD, DMCACHE_NOTFOUND, ELEM, Mesh::fdata, mesh, Mesh::mface, Mesh::mtface, NULL, ParticleData::num, ParticleData::num_dmcache, psys_interpolate_uvs(), Mesh::totface, Mesh::totvert, MFace::v1, MFace::v2, MFace::v3, and MFace::v4.
Referenced by get_cpa_texture(), and psys_get_texture().
|
static |
Assumes pointcache->mem_cache exists, so for disk cached particles call psys_make_temp_pointcache() before use. It uses ParticleInterpolationData.pm to store the current memory cache frame so it's thread safe.
Definition at line 1268 of file particle.c.
References BKE_ptcache_make_particle_key(), BKE_ptcache_mem_index_find(), copy_particle_key(), PTCacheMem::data, ListBase::first, PTCacheMem::frame, PointCache::mem_cache, PTCacheMem::next, NULL, PTCacheMem::prev, and t.
Referenced by do_particle_interpolation(), and init_particle_interpolation().
|
static |
Definition at line 1319 of file particle.c.
References BKE_ptcache_mem_index_find(), ListBase::first, PTCacheMem::frame, ListBase::last, PointCache::mem_cache, PTCacheMem::next, PTCacheMem::prev, and ret.
Referenced by init_particle_interpolation().
|
static |
Definition at line 1419 of file particle.c.
References HairKey::co, ParticleKey::co, copy_v3_v3(), HairKey::time, and ParticleKey::time.
Referenced by do_particle_interpolation().
|
static |
Definition at line 1363 of file particle.c.
References ParticleInterpolationData::birthtime, ParticleInterpolationData::cache, ParticleInterpolationData::dietime, ParticleData::dietime, ParticleInterpolationData::ekey, PointCache::endframe, ParticleInterpolationData::epoint, get_pointcache_keys_for_time(), get_pointcache_times_for_particle(), ParticleData::hair, ParticleData::hair_index, ParticleInterpolationData::hkey, ParticleInterpolationData::keyed, PTCacheEditPoint::keys, ParticleData::keys, ParticleInterpolationData::kkey, MAX2, ParticleInterpolationData::mesh, MIN2, ParticleInterpolationData::mvert, Mesh::mvert, NULL, ParticleSystem::particles, ParticleInterpolationData::pm, PointCache::startframe, PTCacheEditKey::time, time, HairKey::time, ParticleKey::time, ParticleData::time, PTCacheEditPoint::totkey, and ParticleData::totkey.
Referenced by psys_cache_edit_paths_iter(), and psys_get_particle_on_path().
|
static |
Definition at line 1197 of file particle.c.
References CLAMP, v1, v2, and w().
Referenced by psys_interpolate_value_from_verts().
|
static |
Definition at line 1634 of file particle.c.
References ParticleCacheKey::co, copy_qt_qt(), interp_qt_qtqt(), interp_v3_v3v3(), mul_qt_qtqt(), result, ParticleCacheKey::rot, ParticleCacheKey::segments, t, ParticleCacheKey::time, time, and ParticleCacheKey::vel.
Referenced by psys_get_particle_on_path().
|
static |
Definition at line 1425 of file particle.c.
References MVert::co, ParticleKey::co, copy_v3_v3(), HairKey::time, and ParticleKey::time.
Referenced by do_particle_interpolation().
|
static |
Definition at line 3922 of file particle.c.
References BKE_modifier_new(), BKE_modifier_unique_name(), BKE_object_modifier_set_active(), BKE_particlesettings_add(), BKE_ptcache_add(), BKE_scene_frame_to_ctime(), BLI_addtail(), BLI_strncpy(), ParticleSystem::cfra, CFRA, DATA_, DEG_id_tag_update(), DEG_relations_tag_update(), eModifierType_ParticleSystem, ListBase::first, ParticleSystem::flag, Object::id, ParticleSettings::id, ID_RECALC_GEOMETRY, id_us_plus(), MEM_callocN, Object::modifiers, ModifierData::name, ParticleSystem::name, ParticleSystem::next, NULL, OB_MESH, ParticleSystem::part, Object::particlesystem, ParticleSystem::pointcache, ParticleSystemModifierData::psys, PSYS_CURRENT, psys_unique_name(), ParticleSystem::ptcaches, scene, ParticleSystem::totpart, and Object::type.
Referenced by object_add_particle_system(), and object_copy_particle_system().
| ModifierData* object_add_particle_system | ( | Main * | bmain, |
| Scene * | scene, | ||
| Object * | ob, | ||
| const char * | name | ||
| ) |
Definition at line 3975 of file particle.c.
References NULL, object_add_or_copy_particle_system(), and scene.
Referenced by ED_object_modifier_add(), and particle_system_add_exec().
| ModifierData* object_copy_particle_system | ( | Main * | bmain, |
| Scene * | scene, | ||
| Object * | ob, | ||
| const ParticleSystem * | psys_orig | ||
| ) |
Definition at line 3980 of file particle.c.
References NULL, object_add_or_copy_particle_system(), and scene.
Definition at line 3988 of file particle.c.
References BKE_modifier_free(), BKE_modifier_remove_from_list(), BKE_modifiers_findby_type(), BLI_remlink(), DynamicPaintModifierData::brush, DEG_id_tag_update(), DEG_relations_tag_update(), FluidModifierData::domain, ELEM, eModifierType_DynamicPaint, eModifierType_Fluid, ListBase::first, FluidModifierData::flow, FLUID_DOMAIN_PARTICLE_BUBBLE, FLUID_DOMAIN_PARTICLE_FLIP, FLUID_DOMAIN_PARTICLE_FOAM, FLUID_DOMAIN_PARTICLE_SPRAY, FLUID_DOMAIN_PARTICLE_TRACER, Object::id, ParticleSettings::id, ID_RECALC_COPY_ON_WRITE, ID_RECALC_GEOMETRY, id_us_min(), MOD_FLUID_TYPE_DOMAIN, MOD_FLUID_TYPE_FLOW, Object::mode, NULL, OB_MODE_PARTICLE_EDIT, ParticleSystem::part, PART_FLUID_BUBBLE, PART_FLUID_FLIP, PART_FLUID_FOAM, PART_FLUID_FOAMBUBBLE, PART_FLUID_SPRAY, PART_FLUID_SPRAYBUBBLE, PART_FLUID_SPRAYFOAM, PART_FLUID_SPRAYFOAMBUBBLE, PART_FLUID_TRACER, FluidDomainSettings::particle_type, Object::particlesystem, DynamicPaintBrushSettings::psys, FluidFlowSettings::psys, PSYS_CURRENT, psys_free(), psys_get_current(), psys_get_modifier(), FluidDomainSettings::sndparticle_combined_export, SNDPARTICLE_COMBINED_EXPORT_OFF, FluidModifierData::type, and ParticleSettings::type.
|
static |
Definition at line 2595 of file particle.c.
References add_v3_v3(), ParticleKey::co, copy_qt_qt(), copy_v3_v3(), ChildParticle::fuv, mul_qt_v3(), mul_v3_fl(), ParticleKey::rot, unit_qt(), and ParticleKey::vel.
Referenced by psys_get_particle_on_path(), psys_get_particle_state(), and psys_thread_create_path().
|
static |
Definition at line 321 of file particle.c.
References Freestyle::a, ParticleSettings::adt, BKE_animdata_blend_read_data(), BKE_curvemapping_blend_read(), BKE_effector_add_weights(), BKE_particle_partdeflect_blend_read_data(), BLO_read_data_address, BLO_read_list(), ParticleSettings::boids, CLAMP, ParticleSettings::clumpcurve, ParticleSettings::effector_weights, ParticleSettings::fluid, ParticleSettings::instance_weights, LISTBASE_FOREACH, MAX_MTEX, ParticleSettings::mtex, ParticleSettings::pd, ParticleSettings::pd2, ParticleSettings::roughcurve, state, BoidSettings::states, ParticleSettings::trail_count, and ParticleSettings::twistcurve.
|
static |
Definition at line 442 of file particle.c.
References Freestyle::a, ParticleSettings::bb_ob, BLO_expand, ParticleSettings::boids, ParticleSettings::collision_group, eBoidRuleType_Avoid, eBoidRuleType_FollowLeader, ParticleSettings::effector_weights, PartDeflect::f_source, EffectorWeights::group, ParticleSettings::instance_collection, ParticleSettings::instance_object, ParticleSettings::instance_weights, LISTBASE_FOREACH, MAX_MTEX, ParticleSettings::mtex, BoidRuleGoalAvoid::ob, BoidRuleFollowLeader::ob, MTex::object, ParticleSettings::pd, ParticleSettings::pd2, state, BoidSettings::states, PartDeflect::tex, and MTex::tex.
|
static |
Definition at line 382 of file particle.c.
References Freestyle::a, ParticleSettings::bb_ob, BKE_effector_add_weights(), BKE_particle_partdeflect_blend_read_lib(), BLI_listbase_clear(), BLO_read_id_address, ParticleSettings::boids, ParticleSettings::collision_group, eBoidRuleType_Avoid, eBoidRuleType_FollowLeader, eBoidRuleType_Goal, ParticleSettings::effector_weights, ListBase::first, EffectorWeights::group, ParticleSettings::id, ParticleSettings::instance_collection, ParticleSettings::instance_object, ParticleSettings::instance_weights, ID::lib, LISTBASE_FOREACH, MAX_MTEX, ParticleSettings::mtex, BoidRuleGoalAvoid::ob, BoidRuleFollowLeader::ob, MTex::object, ParticleSettings::pd, ParticleSettings::pd2, state, BoidSettings::states, and MTex::tex.
|
static |
Definition at line 253 of file particle.c.
References Freestyle::a, ParticleSettings::adt, BKE_animdata_blend_write(), BKE_curvemapping_blend_write(), BKE_id_blend_write(), BLO_write_id_struct, BLO_write_is_undo(), BLO_write_struct, ParticleSettings::boids, ParticleSettings::clumpcurve, ParticleSettings::effector_weights, ParticleSettings::fluid, FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN, FOREACH_COLLECTION_OBJECT_RECURSIVE_END, ParticleSettings::id, ParticleSettings::instance_collection, ParticleSettings::instance_weights, LISTBASE_FOREACH, MAX_MTEX, ParticleSettings::mtex, NULL, PART_PHYS_BOIDS, PART_PHYS_FLUID, ParticleSettings::pd, ParticleSettings::pd2, ParticleSettings::phystype, ParticleSettings::roughcurve, state, BoidSettings::states, ParticleSettings::twistcurve, ID::us, and write_boid_state().
|
static |
Definition at line 106 of file particle.c.
References Freestyle::a, BKE_curvemapping_copy(), BKE_partdeflect_copy(), BLI_duplicatelist(), boid_copy_settings(), ParticleSettings::boids, ParticleSettings::clumpcurve, ParticleSettings::effector_weights, ParticleSettings::fluid, ParticleSettings::instance_weights, MAX_MTEX, MEM_dupallocN, ParticleSettings::mtex, ParticleSettings::pd, ParticleSettings::pd2, ParticleSettings::roughcurve, and ParticleSettings::twistcurve.
|
static |
Definition at line 171 of file particle.c.
References ParticleSettings::bb_ob, BKE_LIB_FOREACHID_PROCESS, BKE_texture_mtex_foreach_id(), ParticleSettings::boids, ParticleSettings::collision_group, data, eBoidRuleType_Avoid, eBoidRuleType_FollowLeader, ParticleSettings::effector_weights, PartDeflect::f_source, EffectorWeights::group, IDWALK_CB_NOP, IDWALK_CB_USER, ParticleSettings::instance_collection, ParticleSettings::instance_object, ParticleSettings::instance_weights, LISTBASE_FOREACH, MAX_MTEX, ParticleSettings::mtex, BoidRuleGoalAvoid::ob, BoidRuleFollowLeader::ob, ParticleSettings::pd, ParticleSettings::pd2, state, BoidSettings::states, and PartDeflect::tex.
|
static |
Definition at line 142 of file particle.c.
References Freestyle::a, BKE_curvemapping_free(), BKE_partdeflect_free(), BLI_freelistN(), boid_free_settings(), ParticleSettings::boids, ParticleSettings::clumpcurve, ParticleSettings::effector_weights, ParticleSettings::fluid, fluid_free_settings(), ParticleSettings::instance_weights, MAX_MTEX, MEM_SAFE_FREE, ParticleSettings::mtex, ParticleSettings::pd, ParticleSettings::pd2, ParticleSettings::roughcurve, and ParticleSettings::twistcurve.
|
static |
Definition at line 96 of file particle.c.
References BKE_effector_add_weights(), BLI_assert, DNA_struct_default_get, ParticleSettings::effector_weights, MEMCMP_STRUCT_AFTER_IS_ZERO, MEMCPY_STRUCT_AFTER, and NULL.
|
static |
Definition at line 596 of file particle.c.
References ParticleCacheKey::segments.
Referenced by psys_thread_create_path().
| void precalc_guides | ( | ParticleSimulationData * | sim, |
| ListBase * | effectors | ||
| ) |
Definition at line 2325 of file particle.c.
References copy_v3_v3(), data, EffectorData::distance, effector_falloff(), ParticleSettings::effector_weights, ListBase::first, PartDeflect::forcefield, ParticleSettings::from, EffectorCache::guide_data, EffectorCache::guide_dir, EffectorCache::guide_loc, len_v3(), LOOP_PARTICLES, MEM_callocN, mul_m4_v3(), mul_mat3_m4_v3(), EffectorCache::next, EffectorData::nor, ParticleSimulationData::ob, Object::obmat, ParticleSystem::part, PARTICLE_P, EffectorCache::pd, pd_point_from_particle(), PFIELD_GUIDE, ParticleSimulationData::psmd, ParticleSimulationData::psys, psys_particle_on_emitter(), state, sub_v3_v3v3(), ParticleSystem::totpart, and EffectorData::vec_to_point.
Referenced by psys_update_effectors().
|
static |
Definition at line 601 of file particle.c.
References BLI_addtail(), LinkData::data, MAX2, MEM_callocN, MIN2, and PATH_CACHE_BUF_SIZE.
Referenced by psys_cache_child_paths(), and psys_cache_edit_paths().
| void psys_apply_hair_lattice | ( | Depsgraph * | depsgraph, |
| Scene * | scene, | ||
| Object * | ob, | ||
| ParticleSystem * | psys | ||
| ) |
Definition at line 5201 of file particle.c.
References BKE_lattice_deform_data_destroy(), BKE_lattice_deform_data_eval_co(), HairKey::co, ParticleSimulationData::depsgraph, depsgraph, ParticleSystem::flag, ParticleSettings::from, ParticleData::hair, invert_m4_m4(), ParticleSystem::lattice_deform_data, ParticleSystem::lattice_strength, ParticleSystemModifierData::mesh_final, mul_m4_v3(), NULL, ParticleSimulationData::ob, ParticleSystem::part, ParticleSystem::particles, ParticleSimulationData::psmd, ParticleSimulationData::psys, psys_create_lattice_deform_data(), PSYS_EDITED, psys_get_modifier(), psys_mat_hair_to_global(), ParticleSimulationData::scene, scene, ParticleData::totkey, and ParticleSystem::totpart.
| void psys_cache_child_paths | ( | ParticleSimulationData * | sim, |
| float | cfra, | ||
| const bool | editupdate, | ||
| const bool | use_render_params | ||
| ) |
Definition at line 3165 of file particle.c.
References BLI_task_pool_create(), BLI_task_pool_free(), BLI_task_pool_push(), BLI_task_pool_work_and_wait(), ParticleSystem::childcache, ParticleSystem::childcachebufs, exec_child_path_cache(), ParticleThreadContext::extra_segments, ParticleSystem::flag, free_child_path_cache(), NULL, ParticleThreadContext::parent_pass, ParticleSimulationData::psys, psys_alloc_path_cache_buffers(), PSYS_GLOBAL_HAIR, psys_task_init_path(), psys_tasks_create(), psys_tasks_free(), psys_thread_context_free(), psys_thread_context_init_path(), ParticleSimulationData::scene, ParticleThreadContext::segments, blender::compositor::task, task_pool, TASK_PRIORITY_LOW, ParticleThreadContext::totchild, ParticleSystem::totchildcache, and ParticleThreadContext::totparent.
Referenced by psys_cache_edit_paths(), and psys_update_path_cache().
| void psys_cache_edit_paths | ( | Depsgraph * | depsgraph, |
| Scene * | scene, | ||
| Object * | ob, | ||
| PTCacheEdit * | edit, | ||
| float | cfra, | ||
| const bool | use_render_params | ||
| ) |
Definition at line 3686 of file particle.c.
References BLI_parallel_range_settings_defaults(), BLI_task_parallel_range(), ParticleEditSettings::brushtype, ParticleSimulationData::depsgraph, depsgraph, ParticleEditSettings::draw_step, CacheEditrPathsIterData::edit, PTCacheEditPoint::flag, MAX2, NULL, ParticleSimulationData::ob, CacheEditrPathsIterData::object, CacheEditrPathsIterData::pa, ToolSettings::particle, ParticleSystem::particles, PTCacheEdit::pathcache, PTCacheEdit::pathcachebufs, PE_BRUSH_WEIGHT, PEP_EDIT_RECALC, PTCacheEdit::points, ParticleSimulationData::psmd, CacheEditrPathsIterData::psmd, PTCacheEdit::psmd_eval, ParticleSimulationData::psys, PTCacheEdit::psys, psys_alloc_path_cache_buffers(), psys_cache_child_paths(), psys_cache_edit_paths_iter(), psys_free_path_cache(), ParticleSimulationData::scene, scene, CacheEditrPathsIterData::segments, Scene::toolsettings, PTCacheEdit::totcached, PTCacheEdit::totpoint, and CacheEditrPathsIterData::use_weight.
Referenced by drw_particle_update_ptcache_edit(), PE_update_object(), and PE_update_selection().
|
static |
Definition at line 3520 of file particle.c.
References ParticleInterpolationData::birthtime, BKE_defvert_weight_to_rgb(), ParticleInterpolationData::bspline, ParticleInterpolationData::cache, cache_key_incremental_rotation(), ParticleCacheKey::co, ParticleCacheKey::col, copy_qt_qt(), copy_v3_v3(), ParticleInterpolationData::dietime, do_particle_interpolation(), CacheEditrPathsIterData::edit, ParticleInterpolationData::ekey, ParticleInterpolationData::epoint, PTCacheEditPoint::flag, ParticleSettings::flag, ParticleSystem::flag, float(), ParticleSettings::from, ParticleData::hair, ParticleInterpolationData::hkey, init_particle_interpolation(), interp_v3_v3v3(), ParticleInterpolationData::keyed, PTCacheEditPoint::keys, mat3_to_quat_is_ok(), ParticleInterpolationData::mesh, ParticleSystemModifierData::mesh_final, mul_m4_v3(), NULL, CacheEditrPathsIterData::object, CacheEditrPathsIterData::pa, ParticleSystem::part, PART_HAIR_BSPLINE, PTCacheEdit::pathcache, PEK_SELECT, PEP_EDIT_RECALC, PTCacheEdit::points, CacheEditrPathsIterData::psmd, PTCacheEdit::psys, PSYS_GLOBAL_HAIR, psys_mat_hair_to_global(), result, rot, ParticleCacheKey::rot, ParticleCacheKey::segments, CacheEditrPathsIterData::segments, sub_v3_v3v3(), t, ParticleCacheKey::time, PTCacheEditKey::time, time, HairKey::time, PTCacheEdit::totcached, PTCacheEditPoint::totkey, ParticleData::totkey, CacheEditrPathsIterData::use_weight, ParticleCacheKey::vel, and HairKey::weight.
Referenced by psys_cache_edit_paths().
| void psys_cache_paths | ( | ParticleSimulationData * | sim, |
| float | cfra, | ||
| const bool | use_render_params | ||
| ) |
Calculates paths ready for drawing/rendering
Definition at line 3278 of file particle.c.
References col, ParticleSystem::flag, ParticleSystem::hair_out_mesh, NULL, ParticleSystem::part, PART_HAIR, ToolSettings::particle, PARTICLE_P, PARTICLE_PSMD, ParticleSimulationData::psys, PSYS_HAIR_DYNAMICS, result, ParticleSimulationData::scene, t, time, Scene::toolsettings, and ParticleSettings::type.
Referenced by psys_update_path_cache().
| float* psys_cache_vgroup | ( | Mesh * | mesh, |
| ParticleSystem * | psys, | ||
| int | vgroup | ||
| ) |
Definition at line 2619 of file particle.c.
References BKE_defvert_find_weight(), Mesh::dvert, MEM_callocN, mesh, Mesh::totvert, ParticleSystem::vg_neg, and ParticleSystem::vgroup.
Referenced by psys_thread_context_init_distribute(), and psys_thread_context_init_path().
| bool psys_check_edited | ( | ParticleSystem * | psys | ) |
Definition at line 815 of file particle.c.
References ParticleSystem::edit, PointCache::edit, PTCacheEdit::edited, ParticleSystem::flag, ParticleSystem::part, PART_HAIR, ParticleSystem::pointcache, PSYS_EDITED, and ParticleSettings::type.
| bool psys_check_enabled | ( | Object * | ob, |
| ParticleSystem * | psys, | ||
| const bool | use_render_params | ||
| ) |
Definition at line 789 of file particle.c.
References eModifierMode_Realtime, eModifierMode_Render, ParticleSystem::flag, ModifierData::mode, ParticleSystemModifierData::modifier, ParticleSystem::part, PSYS_DELETE, PSYS_DISABLED, and psys_get_modifier().
Referenced by BKE_effector_relations_create(), BKE_object_handle_data_update(), deformVerts(), DRW_object_is_visible_psys_in_active_context(), dynamicPaint_doStep(), make_duplis_particle_system(), particle_system_update(), and pointdensity_cache_psys().
| void psys_check_group_weights | ( | ParticleSettings * | part | ) |
Definition at line 845 of file particle.c.
References BKE_collection_has_object_recursive(), BLI_addtail(), BLI_freelinkN(), BLI_freelistN(), ParticleDupliWeight::count, ListBase::first, ParticleDupliWeight::flag, FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN, FOREACH_COLLECTION_OBJECT_RECURSIVE_END, ParticleDupliWeight::index, ParticleSettings::instance_collection, ParticleSettings::instance_weights, MEM_callocN, ParticleDupliWeight::next, NULL, ParticleDupliWeight::ob, ParticleSystem::part, PART_DRAW_GR, PART_DUPLIW_CURRENT, psys_find_group_weights(), and ParticleSettings::ren_as.
Referenced by dupliob_refresh_exec().
| void psys_copy_particles | ( | ParticleSystem * | psys_dst, |
| ParticleSystem * | psys_src | ||
| ) |
Definition at line 1149 of file particle.c.
References ParticleData::boid, ParticleSystem::child, ParticleData::hair, ParticleData::keys, MEM_dupallocN, NULL, ParticleSystem::part, PART_HAIR, ParticleSystem::particles, psys_free_children(), psys_free_particles(), ParticleSystem::totchild, ParticleData::totkey, ParticleSystem::totpart, and ParticleSettings::type.
Referenced by BKE_object_copy_particlesystem(), PE_create_particle_edit(), and pe_get_current().
| struct LatticeDeformData* psys_create_lattice_deform_data | ( | ParticleSimulationData * | sim | ) |
Definition at line 696 of file particle.c.
References BKE_lattice_deform_data_create(), DAG_EVAL_RENDER, DEG_get_mode(), ParticleSimulationData::depsgraph, eModifierMode_Realtime, eModifierMode_Render, eModifierType_Lattice, lattice, ParticleSystem::lattice_strength, ModifierData::mode, ModifierData::next, NULL, ParticleSimulationData::ob, LatticeModifierData::object, ParticleSimulationData::psys, psys_get_modifier(), psys_in_edit_mode(), LatticeModifierData::strength, and ModifierData::type.
Referenced by cached_step(), blender::io::alembic::ABCPointsWriter::do_write(), explodeMesh(), make_duplis_particle_system(), modifyMesh(), particle_batch_cache_ensure_pos(), particle_system_minmax(), pointdensity_cache_psys(), psys_apply_hair_lattice(), psys_thread_context_init_path(), and save_hair().
| void psys_disable_all | ( | Object * | ob | ) |
Definition at line 724 of file particle.c.
References ListBase::first, ParticleSystem::flag, ParticleSystem::next, Object::particlesystem, and PSYS_DISABLED.
Referenced by particle_intersect_mesh().
| void psys_emitter_customdata_mask | ( | ParticleSystem * | psys, |
| CustomData_MeshMasks * | r_cddata_masks | ||
| ) |
Definition at line 2251 of file particle.c.
References CD_MASK_MDEFORMVERT, CD_MASK_MTFACE, CD_MASK_ORCO, CD_MASK_ORIGINDEX, CD_MASK_ORIGSPACE_MLOOP, CustomData_MeshMasks::emask, CustomData_MeshMasks::fmask, CustomData_MeshMasks::lmask, MTex::mapto, MAX_MTEX, ParticleSettings::mtex, ParticleSystem::part, CustomData_MeshMasks::pmask, PSYS_TOT_VG, ParticleSettings::tanfac, MTex::texco, TEXCO_UV, ParticleSystem::vgroup, and CustomData_MeshMasks::vmask.
Referenced by copy_particle_systems_to_object(), and requiredDataMask().
| void psys_enable_all | ( | Object * | ob | ) |
Definition at line 732 of file particle.c.
References ListBase::first, ParticleSystem::flag, ParticleSystem::next, Object::particlesystem, and PSYS_DISABLED.
Referenced by particle_intersect_mesh().
| struct ParticleSystem* psys_eval_get | ( | Depsgraph * | depsgraph, |
| Object * | object, | ||
| ParticleSystem * | psys | ||
| ) |
Definition at line 749 of file particle.c.
References DEG_get_evaluated_object(), depsgraph, ListBase::first, ParticleSystem::next, NULL, ParticleSystem::orig_psys, and Object::particlesystem.
Referenced by disconnect_hair(), ED_object_modifier_convert(), PE_create_particle_edit(), and remap_hair_emitter().
|
static |
Definition at line 3832 of file particle.c.
References BKE_mesh_orco_verts_transform(), CD_ORCO, CD_ORIGINDEX, CD_ORIGSPACE, MVert::co, copy_v3_v3(), CustomData_get(), CustomData_get_layer(), Object::data, DMCACHE_ISCHILD, DMCACHE_NOTFOUND, ELEM, Mesh::fdata, float(), if(), mesh, Mesh::mface, Mesh::mvert, NULL, ParticleData::num, ParticleData::num_dmcache, Mesh::totface, triatomat(), unit_m4(), OrigSpaceFace::uv, v, MFace::v1, MFace::v2, and MFace::v3.
Referenced by psys_mat_hair_to_object(), psys_mat_hair_to_orco(), and psys_vec_rot_to_face().
| void psys_find_group_weights | ( | ParticleSettings * | part | ) |
Definition at line 824 of file particle.c.
References BKE_collection_object_cache_get(), BLI_findlink(), ParticleSettings::instance_collection, ParticleSettings::instance_weights, LISTBASE_FOREACH, NULL, Base::object, and ParticleSystem::part.
Referenced by make_duplis_particle_system(), and psys_check_group_weights().
| void psys_find_parents | ( | ParticleSimulationData * | sim, |
| const bool | use_render_params | ||
| ) |
Definition at line 2645 of file particle.c.
References ParticleSystem::cfra, ParticleSystem::child, ParticleSettings::child_nbr, DMCACHE_ISCHILD, ParticleTexture::exist, float(), ChildParticle::foffset, from, ChildParticle::fuv, get_cpa_texture(), ParticleSystemModifierData::mesh_final, NULL, ChildParticle::num, ChildParticle::pa, PAMAP_CHILD, PAMAP_DENS, ChildParticle::parent, ParticleSettings::parents, ParticleSystem::part, PART_FROM_FACE, ParticleSystem::particles, ParticleSimulationData::psmd, ParticleSimulationData::psys, psys_frand(), psys_particle_on_emitter(), ParticleSettings::ren_child_nbr, ParticleSystem::totchild, ParticleSystem::totpart, and tree.
Referenced by psys_update_path_cache().
| void psys_free | ( | Object * | ob, |
| ParticleSystem * | psys | ||
| ) |
Definition at line 1070 of file particle.c.
References BKE_effectors_free(), BKE_modifier_free(), BKE_particle_batch_cache_free(), BKE_ptcache_free_list(), BLI_bvhtree_free(), BLI_freelistN(), ParticleSystem::bvhtree, ParticleSystem::child, ParticleSystem::clmd, ParticleSystem::edit, ParticleSystem::effectors, ELEM, ListBase::first, ParticleSystem::flag, ParticleSystem::fluid_springs, ParticleSystem::free_edit, free_hair(), MEM_freeN, ParticleSystem::next, NULL, OB_DUPLIPARTS, ParticleSystem::part, PART_DRAW_GR, PART_DRAW_OB, Object::particlesystem, ParticleSystem::pdd, ParticleSystem::pointcache, psys_free_particles(), psys_free_path_cache(), psys_free_pdd(), PSYS_SHARED_CACHES, ParticleSystem::ptcaches, ParticleSettings::ren_as, ParticleSystem::targets, ParticleSystem::totchild, Object::transflag, and ParticleSystem::tree.
Referenced by BKE_object_free_particlesystems(), BKE_object_handle_data_update(), and object_remove_particle_system().
| void psys_free_children | ( | ParticleSystem * | psys | ) |
Definition at line 1001 of file particle.c.
References ParticleSystem::child, free_child_path_cache(), MEM_freeN, NULL, and ParticleSystem::totchild.
Referenced by psys_copy_particles(), psys_update_path_cache(), and update_children().
| void psys_free_particles | ( | ParticleSystem * | psys | ) |
Definition at line 1011 of file particle.c.
References ParticleData::boid, ParticleData::keys, LOOP_PARTICLES, MEM_freeN, NULL, ParticleSystem::part, PART_HAIR, PARTICLE_P, ParticleSystem::particles, ParticleSystem::totpart, and ParticleSettings::type.
Referenced by psys_copy_particles(), psys_free(), and psys_reset().
| void psys_free_path_cache | ( | ParticleSystem * | psys, |
| PTCacheEdit * | edit | ||
| ) |
Definition at line 986 of file particle.c.
References ParticleSystem::edit, free_child_path_cache(), NULL, PTCacheEdit::pathcache, ParticleSystem::pathcache, PTCacheEdit::pathcachebufs, ParticleSystem::pathcachebufs, psys_free_path_cache_buffers(), PTCacheEdit::totcached, and ParticleSystem::totcached.
Referenced by BKE_object_free_caches(), brush_edit_apply(), disconnect_hair(), mirror_exec(), particle_system_update(), particle_undosys_step_decode(), PE_free_ptcache_edit(), psys_cache_edit_paths(), psys_free(), psys_reset(), psys_update_path_cache(), remap_hair_emitter(), and shape_cut_exec().
|
static |
Definition at line 627 of file particle.c.
References BLI_freelistN(), LinkData::data, ListBase::first, MEM_freeN, and LinkData::next.
Referenced by free_child_path_cache(), and psys_free_path_cache().
| void psys_free_pdd | ( | ParticleSystem * | psys | ) |
Definition at line 1041 of file particle.c.
References ParticleDrawData::cdata, MEM_freeN, ParticleDrawData::ndata, NULL, ParticleDrawData::partsize, ParticleSystem::pdd, ParticleDrawData::totpart, ParticleDrawData::totpoint, ParticleDrawData::vdata, and ParticleDrawData::vedata.
Referenced by psys_free(), and realloc_particles().
| float psys_get_child_size | ( | ParticleSystem * | psys, |
| ChildParticle * | cpa, | ||
| float | UNUSEDcfra, | ||
| float * | UNUSEDpa_time | ||
| ) |
Definition at line 4495 of file particle.c.
References ParticleSystem::child, ParticleSettings::childrandsize, ParticleSettings::childsize, ParticleSettings::childtype, ChildParticle::pa, ChildParticle::parent, ParticleSystem::part, PART_CHILD_FACES, ParticleSystem::particles, psys_frand(), size(), ParticleData::size, w(), and ChildParticle::w.
| float psys_get_child_time | ( | ParticleSystem * | psys, |
| ChildParticle * | cpa, | ||
| float | cfra, | ||
| float * | birthtime, | ||
| float * | dietime | ||
| ) |
Definition at line 4463 of file particle.c.
References ParticleSystem::child, ParticleSettings::childtype, ParticleData::lifetime, ParticleSettings::lifetime, ChildParticle::pa, ChildParticle::parent, ParticleSystem::part, PART_CHILD_FACES, ParticleSystem::particles, psys_frand(), ParticleSettings::randlife, time, ParticleData::time, w(), and ChildParticle::w.
Referenced by pointdensity_cache_psys(), psys_get_particle_on_path(), and psys_get_particle_state().
| ParticleSystem* psys_get_current | ( | Object * | ob | ) |
Definition at line 645 of file particle.c.
References ListBase::first, ParticleSystem::flag, ParticleSystem::next, NULL, Object::particlesystem, and PSYS_CURRENT.
Referenced by buttons_context_path_particle(), buttons_texture_users_from_context(), clear_edited_exec(), connect_hair_exec(), disconnect_hair_exec(), duplicate_particle_systems_exec(), object_remove_particle_system(), object_select_all_by_particle(), outliner_draw_mode_column_toggle(), and outliner_set_properties_tab().
| short psys_get_current_num | ( | Object * | ob | ) |
Definition at line 660 of file particle.c.
References ListBase::first, ParticleSystem::flag, ParticleSystem::next, NULL, Object::particlesystem, and PSYS_CURRENT.
| float psys_get_dietime_from_cache | ( | PointCache * | cache, |
| int | index | ||
| ) |
Definition at line 1347 of file particle.c.
References BKE_ptcache_mem_index_find(), PTCacheMem::frame, ListBase::last, PointCache::mem_cache, and PTCacheMem::prev.
Referenced by reset_particle().
| void psys_get_dupli_path_transform | ( | ParticleSimulationData * | sim, |
| ParticleData * | pa, | ||
| ChildParticle * | cpa, | ||
| ParticleCacheKey * | cache, | ||
| float | mat[4][4], | ||
| float * | scale | ||
| ) |
Definition at line 5107 of file particle.c.
References axis_angle_to_quat(), ParticleSettings::childflat, ParticleCacheKey::co, copy_v3_v3(), cross_v3_v3v3(), DMCACHE_ISCHILD, dot_v3v3(), fabsf, ChildParticle::foffset, ParticleData::foffset, ParticleSettings::from, ChildParticle::fuv, ParticleData::fuv, Object::imat, len, M_PI, mul_m3_v3(), mul_qt_v3(), nor, normalize_v3(), NULL, ChildParticle::num, ParticleData::num, ParticleData::num_dmcache, ParticleSimulationData::ob, ChildParticle::pa, ParticleSystem::part, PART_CHILD_FACES, PART_FROM_FACE, PART_ROT_VEL, ParticleSystem::particles, ParticleSettings::phasefac, ParticleSimulationData::psmd, ParticleSimulationData::psys, psys_frand(), psys_particle_on_emitter(), quat_to_mat4(), ParticleSettings::randphasefac, ParticleKey::rot, ParticleSettings::rotmode, ParticleCacheKey::segments, ParticleData::state, sub_v3_v3v3(), transpose_m3_m4(), and unit_m4().
Referenced by make_duplis_particle_system().
| void psys_get_dupli_texture | ( | ParticleSystem * | psys, |
| ParticleSettings * | part, | ||
| ParticleSystemModifierData * | psmd, | ||
| ParticleData * | pa, | ||
| ChildParticle * | cpa, | ||
| float | uv[2], | ||
| float | orco[3] | ||
| ) |
Definition at line 5019 of file particle.c.
References CD_MFACE, CD_MTFACE, ParticleSettings::childtype, CustomData_get(), CustomData_get_layer_n(), CustomData_get_render_layer(), ParticleSettings::distr, DMCACHE_ISCHILD, DMCACHE_NOTFOUND, ELEM, Mesh::fdata, ChildParticle::foffset, ParticleData::foffset, ParticleSettings::from, ChildParticle::fuv, ParticleData::fuv, ParticleSystemModifierData::mesh_final, NULL, ChildParticle::num, ParticleData::num, ParticleData::num_dmcache, ChildParticle::pa, PART_CHILD_FACES, PART_DISTR_GRID, PART_FROM_FACE, PART_FROM_VERT, ParticleSystem::particles, psys_interpolate_uvs(), psys_particle_on_emitter(), Mesh::totface, and MFace::v4.
Referenced by make_duplis_particle_system().
| void psys_get_from_key | ( | ParticleKey * | key, |
| float | loc[3], | ||
| float | vel[3], | ||
| float | rot[4], | ||
| float * | time | ||
| ) |
Definition at line 3774 of file particle.c.
References ParticleKey::co, copy_qt_qt(), copy_v3_v3(), rot, ParticleKey::rot, time, ParticleKey::time, and ParticleKey::vel.
| ParticleSystemModifierData* psys_get_modifier | ( | Object * | ob, |
| ParticleSystem * | psys | ||
| ) |
Definition at line 2201 of file particle.c.
References eModifierType_ParticleSystem, ListBase::first, Object::modifiers, ModifierData::next, NULL, ParticleSystemModifierData::psys, and ModifierData::type.
Referenced by BKE_particle_system_blend_read_lib(), disconnect_hair(), make_duplis_particle_system(), modifyMesh(), object_remove_particle_system(), particle_batch_cache_ensure_pos(), particle_system_minmax(), particle_system_update(), PE_create_particle_edit(), pointdensity_cache_psys(), psys_apply_hair_lattice(), psys_check_enabled(), psys_create_lattice_deform_data(), remap_hair_emitter(), and remove_tagged_keys().
| void psys_get_particle_on_path | ( | ParticleSimulationData * | sim, |
| int | p, | ||
| ParticleKey * | state, | ||
| const bool | vel | ||
| ) |
Definition at line 4585 of file particle.c.
References BKE_lattice_deform_data_eval_co(), BKE_object_material_get(), ParticleInterpolationData::bspline, ParticleInterpolationData::cache, ParticleSystem::child, ParticleSystem::childcache, ParticleSettings::childflat, ParticleSettings::childrad, ParticleSettings::childtype, CLAMP, ParticleKey::co, copy_particle_key(), copy_qt_qt(), copy_v3_v3(), ParticleChildModifierContext::cpa, ParticleSimulationData::depsgraph, DMCACHE_ISCHILD, do_child_modifiers(), do_guides(), do_particle_interpolation(), ParticleSystem::effectors, ParticleInterpolationData::epoint, ParticleData::flag, ParticleSettings::flag, ParticleSystem::flag, ChildParticle::foffset, ParticleData::foffset, ParticleSettings::from, ChildParticle::fuv, ParticleData::fuv, get_child_modifier_parameters(), ParticleSystem::hair_out_mesh, init_particle_interpolation(), interpolate_pathcache(), ParticleInterpolationData::keyed, ParticleSystem::lattice_deform_data, ParticleSystem::lattice_strength, len_v3(), length(), ParticleThreadContext::ma, ParticleThreadContext::mesh, ParticleInterpolationData::mesh, ParticleSystemModifierData::mesh_final, mul_m4_v3(), mul_mat3_m4_v3(), mul_v3_fl(), normalize_v3(), NULL, ChildParticle::num, ParticleData::num, ParticleData::num_dmcache, ParticleSimulationData::ob, Object::obmat, offset_child(), ParticleSettings::omat, ParticleChildModifierContext::orco, ChildParticle::pa, ParticleChildModifierContext::par_co, ParticleChildModifierContext::par_orco, ParticleChildModifierContext::par_rot, ParticleChildModifierContext::par_vel, ChildParticle::parent, ParticleChildModifierContext::parent_keys, PARS_REKEY, ParticleSystem::part, PART_CHILD_FACES, PART_CHILD_GUIDE, PART_FROM_FACE, PART_HAIR, PART_HAIR_BSPLINE, PART_PHYS_KEYED, PARTICLE_PSMD, ParticleSystem::particles, ParticleSystem::pathcache, ParticleSettings::phystype, ParticleSystem::pointcache, ParticleSimulationData::psmd, ParticleSimulationData::psys, psys_get_child_time(), psys_get_particle_on_path(), PSYS_GLOBAL_HAIR, psys_in_edit_mode(), PSYS_KEYED, psys_mat_hair_to_global(), psys_particle_on_emitter(), ParticleChildModifierContext::ptex, result, ParticleKey::rot, ParticleThreadContext::sim, ParticleChildModifierContext::sim, state, sub_v3_v3v3(), t, ParticleChildModifierContext::thread_ctx, ParticleKey::time, ParticleData::time, ParticleSystem::totchild, ParticleSystem::totpart, ParticleSettings::type, unit_m4(), ParticleKey::vel, w(), and ChildParticle::w.
Referenced by brush_add(), modifyMesh(), psys_get_particle_on_path(), psys_get_particle_state(), rekey_particle(), rekey_particle_to_time(), and subdivide_particle().
| int psys_get_particle_state | ( | ParticleSimulationData * | sim, |
| int | p, | ||
| ParticleKey * | state, | ||
| int | always | ||
| ) |
Definition at line 4854 of file particle.c.
References BKE_lattice_deform_data_eval_co(), ParticleSystem::child, ParticleSystem::childcache, ParticleSettings::childflat, ParticleSettings::childrad, ParticleSettings::childtype, CLAMP, ParticleChildModifierContext::cpa, DEG_get_ctime(), ParticleSimulationData::depsgraph, ParticleData::dietime, do_child_modifiers(), ParticleSettings::end, ParticleSettings::flag, ParticleSystem::flag, ChildParticle::fuv, ParticleSystem::lattice_deform_data, ParticleSystem::lattice_strength, ParticleData::lifetime, ParticleSettings::lifetime, MIN2, NULL, offset_child(), ParticleChildModifierContext::orco, ParticleChildModifierContext::par_co, ParticleChildModifierContext::par_orco, ParticleChildModifierContext::par_rot, ParticleChildModifierContext::par_vel, ChildParticle::parent, ParticleChildModifierContext::parent_keys, ParticleSystem::part, PART_CHILD_FACES, PART_DIED, PART_UNBORN, ParticleSystem::particles, ParticleSimulationData::psys, psys_frand(), psys_get_child_time(), psys_get_particle_on_path(), psys_get_timestep(), PSYS_KEYED, ParticleChildModifierContext::ptex, ParticleChildModifierContext::sim, ParticleSettings::sta, ParticleData::state, state, t, ParticleChildModifierContext::thread_ctx, time, ParticleData::time, ParticleSystem::totchild, ParticleSystem::totpart, and unit_m4().
Referenced by blender::io::alembic::ABCPointsWriter::do_write(), explodeMesh(), get_effector_data(), make_duplis_particle_system(), modifyMesh(), particle_batch_cache_ensure_pos(), particle_system_minmax(), pointdensity_cache_psys(), and set_keyed_keys().
| void psys_get_texture | ( | ParticleSimulationData * | sim, |
| ParticleData * | pa, | ||
| ParticleTexture * | ptex, | ||
| int | event, | ||
| float | cfra | ||
| ) |
Definition at line 4326 of file particle.c.
References ATTR_FALLTHROUGH, BKE_mesh_texspace_ensure(), blend(), CLAMP_PARTICLE_TEXTURE_POS, CLAMP_PARTICLE_TEXTURE_POSNEG, CLAMP_WARP_PARTICLE_TEXTURE_POS, ParticleTexture::clump, ParticleKey::co, copy_v3_v3(), ParticleTexture::damp, Object::data, ParticleData::dietime, ParticleTexture::effector, ELEM, ParticleTexture::exist, fabsf, ParticleTexture::field, float(), ParticleData::foffset, ParticleSettings::from, ParticleData::fuv, get_particle_uv(), ParticleTexture::gravity, ParticleTexture::ivel, ParticleTexture::kink_amp, ParticleTexture::kink_freq, ParticleTexture::length, ParticleTexture::life, Mesh::loc, MAP_PA_TIME, MAX_MTEX, ParticleSystemModifierData::mesh_final, mul_m4_v3(), NULL, ParticleData::num, ParticleData::num_dmcache, ParticleSimulationData::ob, PAMAP_DAMP, PAMAP_DENS, PAMAP_FIELD, PAMAP_GRAVITY, PAMAP_IVEL, PAMAP_LENGTH, PAMAP_LIFE, PAMAP_SIZE, PAMAP_TIME, PAMAP_TWIST, ParticleSystem::part, PART_DISTR_GRID, PART_FROM_FACE, PART_FROM_VERT, PART_FROM_VOLUME, ParticleSystem::particles, ParticleSimulationData::psmd, ParticleSimulationData::psys, psys_particle_on_emitter(), RE_texture_evaluate(), ParticleTexture::rough1, ParticleTexture::rough2, ParticleTexture::roughe, SET_PARTICLE_TEXTURE, ParticleTexture::size, Mesh::size, ParticleData::state, sub_v3_v3(), TEXCO_GLOB, TEXCO_OBJECT, TEXCO_ORCO, TEXCO_PARTICLE, TEXCO_UV, texture_value_blend(), ParticleTexture::time, ParticleData::time, ParticleSystem::totpart, and ParticleTexture::twist.
Referenced by basic_integrate(), cached_step(), dynamics_step(), init_particle_texture(), psys_get_birth_coords(), and reset_particle().
| float psys_get_timestep | ( | ParticleSimulationData * | sim | ) |
Definition at line 4459 of file particle.c.
References ParticleSystem::part, ParticleSimulationData::psys, and ParticleSettings::timetweak.
Referenced by basic_integrate(), brush_add(), collision_check(), dynamics_step(), pd_point_from_particle(), psys_get_particle_state(), and sph_integrate().
| bool psys_in_edit_mode | ( | Depsgraph * | depsgraph, |
| const ParticleSystem * | psys | ||
| ) |
Definition at line 773 of file particle.c.
References ViewLayer::basact, DAG_EVAL_RENDER, DEG_get_input_view_layer(), DEG_get_mode(), depsgraph, ParticleSystem::edit, PointCache::edit, Object::mode, NULL, OB_MODE_PARTICLE_EDIT, Base::object, ParticleSystem::pointcache, and psys_orig_get().
Referenced by psys_create_lattice_deform_data(), psys_get_particle_on_path(), psys_thread_context_init_path(), and psys_thread_create_path().
| void psys_interpolate_face | ( | MVert * | mvert, |
| MFace * | mface, | ||
| MTFace * | tface, | ||
| float(*) | orcodata[3], | ||
| float | w[4], | ||
| float | vec[3], | ||
| float | nor[3], | ||
| float | utan[3], | ||
| float | vtan[3], | ||
| float | orco[3] | ||
| ) |
Definition at line 1670 of file particle.c.
References MVert::co, copy_v3_v3(), MFace::flag, interp_v3_v3v3v3(), interp_v3_v3v3v3v3(), map_to_sphere(), ME_SMOOTH, MVert::no, nor, normal_quad_v3(), normal_short_to_float_v3(), normal_tri_v3(), sub_v3_v3v3(), MTFace::uv, v1, MFace::v1, v2, MFace::v2, MFace::v3, MFace::v4, and w().
Referenced by distribute_from_volume_exec(), and psys_particle_on_dm().
Definition at line 1818 of file particle.c.
| void psys_interpolate_particle | ( | short | type, |
| ParticleKey | keys[4], | ||
| float | dt, | ||
| ParticleKey * | result, | ||
| bool | velocity | ||
| ) |
Definition at line 1212 of file particle.c.
References ParticleKey::co, interp_cubic_v3(), interp_v3_v3v3v3v3(), key_curve_position_weights(), result, sub_v3_v3v3(), t, type, and ParticleKey::vel.
Referenced by do_particle_interpolation(), ptcache_cloth_interpolate(), ptcache_particle_interpolate(), ptcache_rigidbody_interpolate(), and ptcache_softbody_interpolate().
Definition at line 1795 of file particle.c.
References quad, MTFace::uv, and w().
Referenced by get_particle_uv(), and psys_get_dupli_texture().
|
static |
Definition at line 1844 of file particle.c.
References from, interpolate_particle_value(), mesh, Mesh::mface, PART_FROM_FACE, PART_FROM_VERT, PART_FROM_VOLUME, MFace::v1, MFace::v2, MFace::v3, and MFace::v4.
Referenced by get_child_modifier_parameters(), and psys_particle_value_from_verts().
|
static |
Definition at line 2020 of file particle.c.
References CD_ORIGSPACE, copy_v4_v4(), CustomData_get_layer(), Mesh_Runtime::deformed_only, DMCACHE_ISCHILD, DMCACHE_NOTFOUND, Mesh::fdata, from, mesh, Mesh::mface, NULL, PART_FROM_VERT, psys_origspace_to_w(), Mesh::runtime, Mesh::totface, Mesh::totvert, and MFace::v4.
Referenced by psys_particle_on_dm(), and psys_particle_value_from_verts().
| void psys_mat_hair_to_global | ( | Object * | ob, |
| Mesh * | mesh, | ||
| short | from, | ||
| ParticleData * | pa, | ||
| float | hairmat[4][4] | ||
| ) |
Definition at line 3909 of file particle.c.
References from, mesh, mul_m4_m4m4(), Object::obmat, and psys_mat_hair_to_object().
Referenced by brush_add(), brush_puff(), createTransParticleVerts(), disconnect_hair(), flushTransParticles(), foreach_mouse_hit_key_iter(), modifyMesh(), PE_lasso_select(), PE_minmax(), psys_apply_hair_lattice(), psys_cache_edit_paths_iter(), psys_get_particle_on_path(), psys_thread_create_path(), and update_world_cos().
| void psys_mat_hair_to_object | ( | Object * | UNUSEDob, |
| Mesh * | mesh, | ||
| short | from, | ||
| ParticleData * | pa, | ||
| float | hairmat[4][4] | ||
| ) |
Definition at line 3868 of file particle.c.
References copy_v3_v3(), ParticleData::foffset, from, ParticleData::fuv, mesh, ParticleData::num, ParticleData::num_dmcache, psys_face_mat(), psys_particle_on_dm(), and unit_m4().
Referenced by psys_mat_hair_to_global().
| void psys_mat_hair_to_orco | ( | Object * | ob, |
| Mesh * | mesh, | ||
| short | from, | ||
| ParticleData * | pa, | ||
| float | hairmat[4][4] | ||
| ) |
Definition at line 3884 of file particle.c.
References BKE_mesh_orco_verts_transform(), CD_ORIGINDEX, copy_v3_v3(), CustomData_get_layer(), Object::data, ParticleData::foffset, from, ParticleData::fuv, mesh, ParticleData::num, ParticleData::num_dmcache, psys_face_mat(), and psys_particle_on_dm().
Referenced by PE_mirror_particle(), and PE_update_mirror_cache().
|
static |
Definition at line 765 of file particle.c.
References ParticleSystem::edit, NULL, and ParticleSystem::orig_psys.
Referenced by psys_thread_context_init_path(), and psys_thread_create_path().
| ParticleSystem* psys_orig_get | ( | ParticleSystem * | psys | ) |
Definition at line 741 of file particle.c.
References NULL, and ParticleSystem::orig_psys.
Referenced by drw_particle_get_hair_source(), particle_system_update(), and psys_in_edit_mode().
|
static |
Definition at line 1872 of file particle.c.
References interp_weights_poly_v3(), psys_w_to_origspace(), quad, OrigSpaceFace::uv, v, and w().
Referenced by psys_map_index_on_dm().
| int psys_particle_dm_face_lookup | ( | Mesh * | mesh_final, |
| Mesh * | mesh_original, | ||
| int | findex_orig, | ||
| const float | fw[4], | ||
| struct LinkNode ** | poly_nodes | ||
| ) |
Find the final derived mesh tessface for a particle, from its original tessface index. This is slow and can be optimized but only for many lookups.
| mesh_final | Final mesh, it may not have the same topology as original mesh. |
| mesh_original | Original mesh, use for accessing MPoly to MFace mapping. |
| findex_orig | The input tessface index. |
| fw | Face weights (position of the particle inside the findex_orig tessface). |
| poly_nodes | May be NULL, otherwise an array of linked list, one for each final mesh_final polygon, containing all its tessfaces indices. |
Definition at line 1913 of file particle.c.
References BKE_mesh_origindex_mface_mpoly(), BLI_assert, CD_ORIGINDEX, CD_ORIGSPACE, CustomData_get_layer(), Mesh_Runtime::deformed_only, DMCACHE_NOTFOUND, ELEM, Mesh::fdata, isect_point_quad_v2(), isect_point_tri_v2(), LinkNode::link, Mesh::mface, LinkNode::next, NULL, POINTER_AS_INT, psys_w_to_origspace(), Mesh::runtime, Mesh::totface, and OrigSpaceFace::uv.
Referenced by brush_add_count_iter(), PE_mirror_x(), psys_calc_dmcache(), and remap_hair_emitter().
| void psys_particle_on_dm | ( | Mesh * | mesh_final, |
| int | from, | ||
| int | index, | ||
| int | index_dmcache, | ||
| const float | fw[4], | ||
| float | foffset, | ||
| float | vec[3], | ||
| float | nor[3], | ||
| float | utan[3], | ||
| float | vtan[3], | ||
| float | orco[3] | ||
| ) |
Definition at line 2095 of file particle.c.
References add_v3_v3(), CD_ORCO, MVert::co, copy_v3_v3(), CustomData_get_layer(), float(), from, Mesh::mface, Mesh::mtface, mul_v3_fl(), Mesh::mvert, MVert::no, nor, normal_short_to_float_v3(), normalize_v3(), PART_FROM_VERT, PART_FROM_VOLUME, psys_interpolate_face(), and psys_map_index_on_dm().
Referenced by brush_add(), distribute_children_exec(), distribute_from_verts_exec(), psys_mat_hair_to_object(), psys_mat_hair_to_orco(), psys_particle_on_emitter(), and psys_thread_context_init_distribute().
| void psys_particle_on_emitter | ( | ParticleSystemModifierData * | psmd, |
| int | from, | ||
| int | index, | ||
| int | index_dmcache, | ||
| float | fuv[4], | ||
| float | foffset, | ||
| float | vec[3], | ||
| float | nor[3], | ||
| float | utan[3], | ||
| float | vtan[3], | ||
| float | orco[3] | ||
| ) |
Definition at line 2290 of file particle.c.
References copy_v3_v3(), ParticleSettings::distr, from, ParticleSettings::from, ParticleSystemModifierData::mesh_final, nor, ParticleSystem::part, PART_DISTR_GRID, PART_FROM_VERT, ParticleSystemModifierData::psys, psys_particle_on_dm(), and psys_particle_on_shape().
Referenced by createFacepa(), precalc_guides(), psys_find_parents(), psys_get_birth_coords(), psys_get_dupli_path_transform(), psys_get_dupli_texture(), psys_get_particle_on_path(), psys_get_texture(), and psys_thread_create_path().
|
static |
Definition at line 2220 of file particle.c.
References copy_v3_v3(), and nor.
Referenced by psys_particle_on_emitter().
| float psys_particle_value_from_verts | ( | Mesh * | mesh, |
| short | from, | ||
| ParticleData * | pa, | ||
| float * | values | ||
| ) |
Definition at line 2188 of file particle.c.
References ParticleData::foffset, from, ParticleData::fuv, mesh, ParticleData::num, ParticleData::num_dmcache, psys_interpolate_value_from_verts(), and psys_map_index_on_dm().
Referenced by psys_get_birth_coords().
| void psys_set_current_num | ( | Object * | ob, |
| int | index | ||
| ) |
Definition at line 677 of file particle.c.
References ListBase::first, ParticleSystem::flag, ParticleSystem::next, NULL, Object::particlesystem, and PSYS_CURRENT.
|
static |
Definition at line 2808 of file particle.c.
References BLI_rng_new(), ParticleSimulationData::psys, seed, ParticleSystem::seed, and blender::compositor::task.
Referenced by psys_cache_child_paths().
|
static |
Definition at line 2702 of file particle.c.
References ParticleThreadContext::between, BKE_curvemapping_changed_all(), BKE_curvemapping_copy(), ParticleThreadContext::cfra, ParticleSettings::child_flag, ParticleSettings::child_nbr, ParticleSettings::childtype, ParticleThreadContext::clumpcurve, ParticleSettings::clumpcurve, ParticleSimulationData::depsgraph, ParticleSettings::disp, ParticleSettings::draw_step, ParticleEditSettings::draw_step, ParticleThreadContext::editupdate, ELEM, ParticleThreadContext::extra_segments, ParticleSettings::flag, ParticleEditSettings::flag, float(), ParticleSettings::kink, ParticleSettings::kink_extra_steps, ParticleSystem::lattice_deform_data, max_ii(), ParticleThreadContext::mesh, MIN2, NULL, ParticleThreadContext::parent_pass, ParticleSettings::parents, ParticleSystem::part, PART_CHILD_EFFECT, PART_CHILD_FACES, PART_CHILD_USE_CLUMP_CURVE, PART_CHILD_USE_ROUGH_CURVE, PART_CHILD_USE_TWIST_CURVE, PART_KINK_SPIRAL, ToolSettings::particle, PE_DRAW_PART, ParticleSimulationData::psys, psys_cache_vgroup(), psys_create_lattice_deform_data(), psys_in_edit_mode(), psys_orig_edit_get(), psys_thread_context_init(), PSYS_VG_CLUMP, PSYS_VG_EFFECTOR, PSYS_VG_KINK, PSYS_VG_LENGTH, PSYS_VG_ROUGH1, PSYS_VG_ROUGH2, PSYS_VG_ROUGHE, PSYS_VG_TWIST, ParticleSettings::ren_child_nbr, ParticleSettings::ren_step, ParticleThreadContext::roughcurve, ParticleSettings::roughcurve, scene, ParticleThreadContext::segments, ParticleThreadContext::sim, Scene::toolsettings, ParticleThreadContext::totchild, ParticleSystem::totchild, ParticleThreadContext::totparent, ParticleThreadContext::twistcurve, ParticleSettings::twistcurve, ParticleThreadContext::vg_clump, ParticleThreadContext::vg_effector, ParticleThreadContext::vg_kink, ParticleThreadContext::vg_length, ParticleThreadContext::vg_rough1, ParticleThreadContext::vg_rough2, ParticleThreadContext::vg_roughe, and ParticleThreadContext::vg_twist.
Referenced by psys_cache_child_paths().
|
static |
Definition at line 2817 of file particle.c.
References add_v3_v3(), ParticleThreadContext::between, BLI_assert, BLI_listbase_clear(), ParticleThreadContext::cfra, ParticleSystem::childcache, ParticleSettings::childflat, ParticleSettings::childrad, CLAMP, ParticleCacheKey::co, copy_qt_qt(), copy_v3_v3(), ParticleSimulationData::depsgraph, DMCACHE_ISCHILD, DMCACHE_NOTFOUND, do_path_effectors(), dot_v3v3(), ParticleThreadContext::editupdate, ParticleTexture::effector, ELEM, ParticleTexture::exist, PTCacheEditPoint::flag, ParticleData::flag, ParticleSettings::flag, float(), ChildParticle::foffset, ParticleData::foffset, ParticleSettings::from, ChildParticle::fuv, ParticleData::fuv, get_child_modifier_parameters(), if(), interp_v3_v3v3v3v3(), interp_v4_v4v4(), len_v3(), len_v3v3(), madd_v3_v3fl(), ParticleSystemModifierData::mesh_final, mul_m4_v3(), mul_qt_qtqt(), mul_qt_v3(), normalize_v3(), NULL, ChildParticle::num, ParticleData::num, ParticleData::num_dmcache, ParticleSimulationData::ob, Object::obmat, offset_child(), ChildParticle::pa, ChildParticle::parent, ParticleSettings::parents, PARS_UNEXIST, ParticleSystem::part, PART_CHILD_EFFECT, PART_CHILD_LONG_HAIR, PART_FROM_FACE, ParticleSystem::particles, ParticleSettings::parting_fac, ParticleSettings::parting_max, ParticleSettings::parting_min, PTCacheEdit::pathcache, ParticleSystem::pathcache, pcache_key_segment_endpoint_safe(), PEP_EDIT_RECALC, PTCacheEdit::points, project_v3_v3v3(), ParticleSimulationData::psmd, ParticleSimulationData::psys, psys_apply_child_modifiers(), psys_frand(), psys_in_edit_mode(), psys_mat_hair_to_global(), psys_orig_edit_get(), psys_particle_on_emitter(), RAD2DEGF, rot, ParticleCacheKey::rot, saacos(), ParticleCacheKey::segments, ParticleThreadContext::segments, ParticleThreadContext::sim, sub_v3_v3v3(), blender::compositor::task, ParticleCacheKey::time, ParticleSystem::totchildcache, Mesh::totface, ParticleThreadContext::totparent, unit_qt(), v1, v2, ParticleCacheKey::vel, w(), ChildParticle::w, and zero_v3().
Referenced by exec_child_path_cache().
| int psys_uses_gravity | ( | ParticleSimulationData * | sim | ) |
Definition at line 907 of file particle.c.
References ParticleSettings::effector_weights, PhysicsSettings::flag, EffectorWeights::global_gravity, ParticleSystem::part, PHYS_GLOBAL_GRAVITY, Scene::physics_settings, ParticleSimulationData::psys, and ParticleSimulationData::scene.
Referenced by basic_integrate(), boid_body(), psys_sph_init(), and rule_average_speed().
| void psys_vec_rot_to_face | ( | Mesh * | mesh, |
| ParticleData * | pa, | ||
| float | vec[3] | ||
| ) |
Definition at line 3900 of file particle.c.
References mesh, mul_mat3_m4_v3(), psys_face_mat(), and transpose_m4().
Referenced by save_hair().
Definition at line 1865 of file particle.c.
References w().
Referenced by psys_origspace_to_w(), and psys_particle_dm_face_lookup().
|
static |
Definition at line 3790 of file particle.c.
References cross_v3_v3v3(), normal_tri_v3(), normalize_v3(), sub_v3_v3v3(), v1, and v2.
Referenced by psys_face_mat().
|
static |
Definition at line 218 of file particle.c.
References BLO_write_struct, eBoidRuleType_AverageSpeed, eBoidRuleType_Avoid, eBoidRuleType_AvoidCollision, eBoidRuleType_Fight, eBoidRuleType_FollowLeader, eBoidRuleType_Goal, LISTBASE_FOREACH, and state.
Referenced by particle_settings_blend_write().
| void(* BKE_particle_batch_cache_dirty_tag_cb) (ParticleSystem *psys, int mode) | ( | ParticleSystem * | psys, |
| int | mode | ||
| ) | = NULL |
Definition at line 5240 of file particle.c.
Referenced by BKE_particle_batch_cache_dirty_tag(), and DRW_engines_register().
| void(* BKE_particle_batch_cache_free_cb) (ParticleSystem *psys) | ( | ParticleSystem * | psys | ) | = NULL |
Definition at line 5241 of file particle.c.
Referenced by BKE_particle_batch_cache_free(), and DRW_engines_register().
| IDTypeInfo IDType_ID_PA |
Definition at line 491 of file particle.c.
| float PSYS_FRAND_BASE[PSYS_FRAND_COUNT] |
Definition at line 521 of file particle.c.
Referenced by BKE_particle_init_rng(), psys_frand(), and psys_frand_vec().
| unsigned int PSYS_FRAND_SEED_MULTIPLIER[PSYS_FRAND_COUNT] |
Definition at line 520 of file particle.c.
Referenced by BKE_particle_init_rng(), psys_frand(), and psys_frand_vec().
| unsigned int PSYS_FRAND_SEED_OFFSET[PSYS_FRAND_COUNT] |
Definition at line 519 of file particle.c.
Referenced by BKE_particle_init_rng(), psys_frand(), and psys_frand_vec().