|
Blender V4.3
|
#include <algorithm>#include <cmath>#include <cstdlib>#include <cstring>#include <optional>#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_base_safe.h"#include "BLI_math_geom.h"#include "BLI_math_matrix.h"#include "BLI_math_rotation.h"#include "BLI_math_vector.h"#include "BLI_rand.h"#include "BLI_task.h"#include "BLI_threads.h"#include "BLI_utildefines.h"#include "BLT_translation.hh"#include "BKE_anim_path.h"#include "BKE_boids.h"#include "BKE_cloth.hh"#include "BKE_collection.hh"#include "BKE_colortools.hh"#include "BKE_customdata.hh"#include "BKE_deform.hh"#include "BKE_displist.h"#include "BKE_effect.h"#include "BKE_idtype.hh"#include "BKE_key.hh"#include "BKE_lattice.hh"#include "BKE_layer.hh"#include "BKE_lib_id.hh"#include "BKE_lib_query.hh"#include "BKE_material.h"#include "BKE_mesh.hh"#include "BKE_mesh_legacy_convert.hh"#include "BKE_modifier.hh"#include "BKE_object.hh"#include "BKE_particle.h"#include "BKE_pointcache.h"#include "BKE_scene.hh"#include "BKE_texture.h"#include "DEG_depsgraph.hh"#include "DEG_depsgraph_build.hh"#include "DEG_depsgraph_query.hh"#include "RE_texture.h"#include "BLO_read_write.hh"#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) |
Variables | |
| IDTypeInfo | IDType_ID_PA |
| uint | PSYS_FRAND_SEED_OFFSET [PSYS_FRAND_COUNT] |
| uint | 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) = nullptr |
| void(* | BKE_particle_batch_cache_free_cb )(ParticleSystem *psys) = nullptr |
| #define CLAMP_PARTICLE_TEXTURE_POS | ( | type, | |
| pvalue ) |
Definition at line 4222 of file particle.cc.
Referenced by get_cpa_texture(), and psys_get_texture().
| #define CLAMP_PARTICLE_TEXTURE_POSNEG | ( | type, | |
| pvalue ) |
Definition at line 4237 of file particle.cc.
Referenced by psys_get_texture().
| #define CLAMP_WARP_PARTICLE_TEXTURE_POS | ( | type, | |
| pvalue ) |
Definition at line 4228 of file particle.cc.
Referenced by get_cpa_texture(), and psys_get_texture().
| #define DNA_DEPRECATED_ALLOW |
Definition at line 10 of file particle.cc.
| #define PATH_CACHE_BUF_SIZE 1024 |
Definition at line 485 of file particle.cc.
Referenced by psys_alloc_path_cache_buffers().
| #define SET_PARTICLE_TEXTURE | ( | type, | |
| pvalue, | |||
| texfac ) |
Definition at line 4216 of file particle.cc.
Referenced by get_cpa_texture(), and psys_get_texture().
| void BKE_particle_batch_cache_dirty_tag | ( | ParticleSystem * | psys, |
| int | mode ) |
Definition at line 5295 of file particle.cc.
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 5301 of file particle.cc.
References ParticleSystem::batch_cache, and BKE_particle_batch_cache_free_cb.
Referenced by psys_free().
| void BKE_particle_init_rng | ( | void | ) |
Definition at line 415 of file particle.cc.
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 * | reader, |
| PartDeflect * | pd ) |
Definition at line 316 of file particle.cc.
Referenced by object_blend_read_data(), and particle_settings_blend_read_data().
| void BKE_particle_system_blend_read_after_liblink | ( | BlendLibReader * | reader, |
| Object * | ob, | ||
| ID * | id, | ||
| ListBase * | particles ) |
Definition at line 5441 of file particle.cc.
References BKE_modifier_free(), BKE_modifier_remove_from_list(), BLI_remlink(), ParticleSystem::clmd, ModifierData::error, ListBase::first, ListBase::last, LISTBASE_FOREACH_MUTABLE, MEM_freeN(), ClothModifierData::modifier, ParticleSystem::part, ClothModifierData::point_cache, ParticleSystem::pointcache, psys_get_modifier(), and ClothModifierData::ptcaches.
Referenced by object_blend_read_after_liblink().
| void BKE_particle_system_blend_read_data | ( | BlendDataReader * | reader, |
| ListBase * | particles ) |
Definition at line 5353 of file particle.cc.
References ParticleSystem::batch_cache, BKE_ptcache_blend_read_data(), BLI_listbase_clear(), BLO_read_struct, BLO_read_struct_array, BLO_read_struct_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, ParticleSystem::orig_psys, ParticleSystem::particles, ParticleSystem::pathcache, ParticleSystem::pathcachebufs, ParticleSystem::pdd, ClothModifierData::point_cache, ParticleSystem::pointcache, ClothSimSettings::presets, ParticleSystem::ptcaches, ClothModifierData::sim_parms, ClothModifierData::solver_result, ParticleSystem::targets, ParticleSystem::tot_fluidsprings, ParticleSystem::totchild, ParticleData::totkey, ParticleSystem::totpart, and ParticleSystem::tree.
Referenced by object_blend_read_data().
| void BKE_particle_system_blend_write | ( | BlendWriter * | writer, |
| ListBase * | particles ) |
Definition at line 5308 of file particle.cc.
References 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 4095 of file particle.cc.
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 4104 of file particle.cc.
References BKE_curvemapping_add(), BKE_curvemapping_init(), CurveMapping::cm, CurveMap::curve, CurveMapPoint::x, and CurveMapPoint::y.
| void BKE_particlesettings_rough_curve_init | ( | ParticleSettings * | part | ) |
Definition at line 4118 of file particle.cc.
References BKE_curvemapping_add(), BKE_curvemapping_init(), CurveMapping::cm, CurveMap::curve, CurveMapPoint::x, and CurveMapPoint::y.
| void BKE_particlesettings_twist_curve_init | ( | ParticleSettings * | part | ) |
Definition at line 4132 of file particle.cc.
References BKE_curvemapping_add(), BKE_curvemapping_init(), CurveMapping::cm, CurveMap::curve, CurveMapPoint::x, and CurveMapPoint::y.
|
static |
Definition at line 3215 of file particle.cc.
References angle(), axis_angle_to_quat(), ParticleCacheKey::co, copy_v3_v3(), copy_v4_v4(), cross_v3_v3v3(), dot_v3v3(), mul_qt_qtqt(), normalize_v3(), ParticleCacheKey::rot, safe_acosf(), sub_v3_v3v3(), and unit_qt().
Referenced by psys_cache_edit_paths_iter(), and psys_cache_paths().
| void copy_particle_key | ( | ParticleKey * | to, |
| ParticleKey * | from, | ||
| int | time ) |
Definition at line 3741 of file particle.cc.
Referenced by boid_body(), do_particle_interpolation(), dynamics_step(), get_pointcache_keys_for_time(), integrate_particle(), psys_get_particle_on_path(), psys_get_particle_state(), set_keyed_keys(), and sph_integrate().
| int count_particles | ( | ParticleSystem * | psys | ) |
Definition at line 446 of file particle.cc.
References 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 464 of file particle.cc.
References LOOP_SHOWN_PARTICLES, PARS_DEAD, PARS_UNBORN, ParticleSystem::part, PART_DIED, PART_UNBORN, and PARTICLE_P.
| bool do_guides | ( | Depsgraph * | depsgraph, |
| ParticleSettings * | part, | ||
| ListBase * | effectors, | ||
| ParticleKey * | state, | ||
| int | index, | ||
| float | time ) |
Definition at line 2332 of file particle.cc.
References add_v3_v3(), angle(), axis_angle_to_quat(), BKE_curvemapping_changed_all(), BKE_displist_calc_taper(), BKE_where_on_path(), CLAMP, PartDeflect::clump_fac, PartDeflect::clump_pow, ParticleKey::co, copy_v3_v3(), cross_v3_v3v3(), CU_PATH_RADIUS, data, depsgraph, do_clump(), do_kink(), dot_v3v3(), Curve::flag, PartDeflect::flag, PartDeflect::forcefield, PartDeflect::free_end, interp_v3_v3v3(), PartDeflect::kink, PartDeflect::kink_amp, PartDeflect::kink_axis, PartDeflect::kink_freq, PartDeflect::kink_shape, len_v3(), LISTBASE_FOREACH, madd_v3_v3fl(), mul_m4_v3(), mul_mat3_m4_v3(), mul_qt_v3(), mul_v3_fl(), normalize_v3(), PART_CHILD_USE_CLUMP_CURVE, PART_CHILD_USE_CLUMP_NOISE, PART_CHILD_USE_ROUGH_CURVE, PFIELD_GUIDE, PFIELD_GUIDE_PATH_ADD, PFIELD_GUIDE_PATH_WEIGHT, safe_acosf(), state, and Curve::taperobj.
Referenced by basic_integrate(), do_child_modifiers(), psys_cache_paths(), and psys_get_particle_on_path().
|
static |
Definition at line 1355 of file particle.cc.
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, ParticleInterpolationData::kkey, ListBase::last, ParticleInterpolationData::mesh, mul_v3_fl(), mvert_to_particle(), ParticleTarget::next, ParticleSystem::part, PART_PHYS_KEYED, ParticleSettings::phystype, ParticleInterpolationData::pm, ParticleTarget::prev, psys_interpolate_particle(), PSYS_KEYED_TIMING, ParticleKey::rot, ParticleSystem::targets, HairKey::time, ParticleData::time, ParticleKey::time, ParticleTarget::time, PTCacheEditKey::time, ParticleSettings::timetweak, ParticleData::totkey, and ParticleInterpolationData::vert_positions.
Referenced by psys_cache_edit_paths_iter(), psys_cache_paths(), and psys_get_particle_on_path().
|
static |
Definition at line 2499 of file particle.cc.
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(), madd_v3_v3v3fl(), mul_v3_fl(), normalize_v3(), 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_cache_paths(), and psys_thread_create_path().
|
static |
Definition at line 1335 of file particle.cc.
References ParticleKey::co, PTCacheEditKey::co, copy_v3_v3(), ParticleKey::time, PTCacheEditKey::time, ParticleKey::vel, and PTCacheEditKey::vel.
Referenced by do_particle_interpolation().
|
static |
Definition at line 3132 of file particle.cc.
References BLI_assert, ParticleSystem::child, ParticleSystem::childcache, ParticleSimulationData::psys, psys_thread_create_path(), and ParticleThreadContext::sim.
Referenced by psys_cache_child_paths().
|
static |
Definition at line 836 of file particle.cc.
References MEM_freeN().
Referenced by particle_settings_free_data().
|
static |
Definition at line 898 of file particle.cc.
References ParticleSystem::childcache, ParticleSystem::childcachebufs, 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 843 of file particle.cc.
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_SAFE_FREE, PARTICLE_P, and PTCACHE_CLEAR_ALL.
Referenced by particle_system_update(), psys_changed_type(), and psys_free().
| void free_keyed_keys | ( | ParticleSystem * | psys | ) |
Definition at line 878 of file particle.cc.
References ParticleData::keys, LOOP_PARTICLES, MEM_freeN(), 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 4538 of file particle.cc.
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 4243 of file particle.cc.
References ATTR_FALLTHROUGH, blend, MTex::blendtype, CLAMP_PARTICLE_TEXTURE_POS, CLAMP_WARP_PARTICLE_TEXTURE_POS, ParticleTexture::clump, MTex::clumpfac, ParticleKey::co, copy_v3_v3(), ParticleTexture::damp, MTex::def_var, ParticleData::dietime, ParticleTexture::effector, ELEM, ParticleTexture::exist, ParticleTexture::field, get_particle_uv(), ParticleTexture::gravity, ParticleTexture::ivel, ParticleTexture::kink_amp, ParticleTexture::kink_freq, MTex::kinkampfac, MTex::kinkfac, ParticleTexture::length, MTex::lengthfac, ParticleTexture::life, MTex::mapto, MAX_MTEX, mul_m4_v3(), 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(), 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(), ParticleData::time, ParticleTexture::time, ParticleTexture::twist, MTex::twistfac, and MTex::uvname.
Referenced by get_child_modifier_parameters(), and psys_find_parents().
|
static |
Definition at line 4150 of file particle.cc.
References CD_MFACE, CD_MTFACE, CustomData_get_layer(), CustomData_get_layer_for_write(), CustomData_get_layer_named(), DMCACHE_ISCHILD, DMCACHE_NOTFOUND, ELEM, ParticleData::num, ParticleData::num_dmcache, psys_interpolate_uvs(), 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 1193 of file particle.cc.
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, and PTCacheMem::prev.
Referenced by do_particle_interpolation(), and init_particle_interpolation().
|
static |
Definition at line 1244 of file particle.cc.
References BKE_ptcache_mem_index_find(), LISTBASE_FOREACH, LISTBASE_FOREACH_BACKWARD, PointCache::mem_cache, and ret.
Referenced by init_particle_interpolation().
|
static |
Definition at line 1343 of file particle.cc.
References HairKey::co, ParticleKey::co, copy_v3_v3(), HairKey::time, and ParticleKey::time.
Referenced by do_particle_interpolation().
|
static |
Definition at line 1286 of file particle.cc.
References ParticleInterpolationData::birthtime, ParticleInterpolationData::cache, ParticleData::dietime, ParticleInterpolationData::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, ParticleData::keys, ParticleInterpolationData::kkey, ParticleInterpolationData::mesh, ParticleSystem::particles, ParticleInterpolationData::pm, PointCache::startframe, HairKey::time, ParticleData::time, ParticleKey::time, ParticleData::totkey, and ParticleInterpolationData::vert_positions.
Referenced by psys_cache_edit_paths_iter(), psys_cache_paths(), and psys_get_particle_on_path().
|
static |
Definition at line 1122 of file particle.cc.
References CLAMP, v2, and w().
Referenced by psys_interpolate_value_from_verts().
|
static |
Definition at line 1558 of file particle.cc.
References ParticleCacheKey::co, copy_qt_qt(), interp_qt_qtqt(), interp_v3_v3v3(), mul_qt_qtqt(), ParticleCacheKey::rot, ParticleCacheKey::segments, ParticleCacheKey::time, and ParticleCacheKey::vel.
Referenced by psys_get_particle_on_path().
|
static |
Definition at line 1349 of file particle.cc.
References ParticleKey::co, copy_v3_v3(), HairKey::time, and ParticleKey::time.
Referenced by do_particle_interpolation().
|
static |
Definition at line 3921 of file particle.cc.
References BKE_modifier_new(), BKE_modifier_unique_name(), BKE_modifiers_persistent_uid_init(), BKE_object_modifier_set_active(), BKE_particlesettings_add(), BKE_ptcache_add(), BKE_scene_frame_to_ctime(), BLI_addtail(), ParticleSystem::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, OB_MESH, ParticleSystem::part, Object::particlesystem, ParticleSystem::pointcache, ParticleSystemModifierData::psys, PSYS_CURRENT, psys_unique_name(), ParticleSystem::ptcaches, STRNCPY, ParticleSystem::totpart, and Object::type.
Referenced by object_add_particle_system(), and object_copy_particle_system().
| ModifierData * object_add_particle_system | ( | Main * | bmain, |
| const Scene * | scene, | ||
| Object * | ob, | ||
| const char * | name ) |
Definition at line 3975 of file particle.cc.
References object_add_or_copy_particle_system().
| ModifierData * object_copy_particle_system | ( | Main * | bmain, |
| const Scene * | scene, | ||
| Object * | ob, | ||
| const ParticleSystem * | psys_orig ) |
Definition at line 3983 of file particle.cc.
References object_add_or_copy_particle_system().
| void object_remove_particle_system | ( | Main * | bmain, |
| Scene * | scene, | ||
| Object * | ob, | ||
| ParticleSystem * | psys ) |
Definition at line 3991 of file particle.cc.
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, Object::id, ParticleSettings::id, ID_RECALC_GEOMETRY, ID_RECALC_SYNC_TO_EVAL, id_us_min(), MOD_FLUID_TYPE_DOMAIN, MOD_FLUID_TYPE_FLOW, Object::mode, 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_modifier(), FluidDomainSettings::sndparticle_combined_export, SNDPARTICLE_COMBINED_EXPORT_OFF, FluidModifierData::type, and ParticleSettings::type.
Referenced by blender::ed::object::object_modifier_remove(), and particle_system_remove_exec().
|
static |
Definition at line 2551 of file particle.cc.
References add_v3_v3(), ParticleKey::co, copy_qt_qt(), copy_v3_v3(), flat(), 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 372 of file particle.cc.
References BLI_freelistN().
|
static |
Definition at line 320 of file particle.cc.
References BKE_curvemapping_blend_read(), BKE_effector_add_weights(), BKE_particle_partdeflect_blend_read_data(), BLO_read_struct, BLO_read_struct_list, CLAMP, LISTBASE_FOREACH, MAX_MTEX, and state.
|
static |
Definition at line 259 of file particle.cc.
References BKE_curvemapping_blend_write(), BKE_id_blend_write(), BLO_write_id_struct, BLO_write_struct, FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN, FOREACH_COLLECTION_OBJECT_RECURSIVE_END, ParticleSettings::id, LISTBASE_FOREACH, MAX_MTEX, PART_PHYS_BOIDS, PART_PHYS_FLUID, state, and write_boid_state().
|
static |
Definition at line 102 of file particle.cc.
References 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 170 of file particle.cc.
References ParticleSettings::bb_ob, BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL, BKE_LIB_FOREACHID_PROCESS_IDSUPER, BKE_lib_query_foreachid_process_flags_get(), BKE_texture_mtex_foreach_id(), ParticleSettings::boids, ParticleSettings::collision_group, eBoidRuleType_Avoid, eBoidRuleType_FollowLeader, eBoidRuleType_Goal, ParticleSettings::effector_weights, ELEM, PartDeflect::f_source, flag, EffectorWeights::group, IDWALK_CB_NOP, IDWALK_CB_USER, IDWALK_DO_DEPRECATED_POINTERS, ParticleSettings::instance_collection, ParticleSettings::instance_object, ParticleSettings::instance_weights, LISTBASE_FOREACH, MAX_MTEX, ParticleSettings::mtex, BoidRuleFollowLeader::ob, BoidRuleGoalAvoid::ob, ParticleSettings::pd, ParticleSettings::pd2, state, BoidSettings::states, and PartDeflect::tex.
|
static |
Definition at line 141 of file particle.cc.
References 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 90 of file particle.cc.
References BKE_effector_add_weights(), BKE_partdeflect_new(), BLI_assert, DNA_struct_default_get, ParticleSettings::effector_weights, MEMCMP_STRUCT_AFTER_IS_ZERO, MEMCPY_STRUCT_AFTER, ParticleSettings::pd, ParticleSettings::pd2, and PFIELD_NULL.
|
static |
Definition at line 487 of file particle.cc.
References ParticleCacheKey::segments.
Referenced by psys_thread_create_path().
| void precalc_guides | ( | ParticleSimulationData * | sim, |
| ListBase * | effectors ) |
Definition at line 2277 of file particle.cc.
References copy_v3_v3(), data, EffectorData::distance, effector_falloff(), ParticleSettings::effector_weights, ParticleSettings::from, len_v3(), LISTBASE_FOREACH, LOOP_PARTICLES, MEM_callocN, mul_m4_v3(), mul_mat3_m4_v3(), EffectorData::nor, ParticleSimulationData::ob, ParticleSystem::part, PARTICLE_P, pd_point_from_particle(), PFIELD_GUIDE, point, 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 492 of file particle.cc.
References BLI_addtail(), LinkData::data, MEM_callocN, and PATH_CACHE_BUF_SIZE.
Referenced by psys_cache_child_paths(), psys_cache_edit_paths(), and psys_cache_paths().
| void psys_apply_hair_lattice | ( | Depsgraph * | depsgraph, |
| Scene * | scene, | ||
| Object * | ob, | ||
| ParticleSystem * | psys ) |
Definition at line 5253 of file particle.cc.
References BKE_lattice_deform_data_eval_co(), HairKey::co, depsgraph, ParticleSimulationData::depsgraph, ParticleSystem::flag, ParticleSettings::from, ParticleData::hair, invert_m4_m4(), ParticleSystem::lattice_deform_data, ParticleSystem::lattice_strength, ParticleSystemModifierData::mesh_final, mul_m4_v3(), ParticleSimulationData::ob, ParticleSystem::part, ParticleSystem::particles, ParticleSimulationData::psmd, ParticleSimulationData::psys, PSYS_EDITED, psys_get_modifier(), psys_mat_hair_to_global(), psys_sim_data_free(), psys_sim_data_init(), ParticleSimulationData::scene, scene, ParticleData::totkey, and ParticleSystem::totpart.
Referenced by blender::ed::object::modifier_apply_obdata().
| void psys_cache_child_paths | ( | ParticleSimulationData * | sim, |
| float | cfra, | ||
| const bool | editupdate, | ||
| const bool | use_render_params ) |
Definition at line 3148 of file particle.cc.
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(), 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, task_pool, TASK_PRIORITY_HIGH, 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 3662 of file particle.cc.
References BLI_parallel_range_settings_defaults(), BLI_task_parallel_range(), ParticleEditSettings::brushtype, depsgraph, ParticleSimulationData::depsgraph, ParticleEditSettings::draw_step, CacheEditrPathsIterData::edit, ParticleSimulationData::ob, CacheEditrPathsIterData::object, CacheEditrPathsIterData::pa, ParticleSystem::particles, PTCacheEdit::pathcache, PTCacheEdit::pathcachebufs, PE_BRUSH_WEIGHT, PEP_EDIT_RECALC, point, PTCacheEdit::points, CacheEditrPathsIterData::psmd, ParticleSimulationData::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, PTCacheEdit::totcached, PTCacheEdit::totpoint, and CacheEditrPathsIterData::use_weight.
Referenced by blender::draw::drw_particle_update_ptcache_edit(), PE_update_object(), and PE_update_selection().
|
static |
Definition at line 3496 of file particle.cc.
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, flag, ParticleSettings::flag, ParticleSystem::flag, float, ParticleSettings::from, ParticleData::hair, ParticleInterpolationData::hkey, init_particle_interpolation(), interp_v3_v3v3(), ParticleInterpolationData::keyed, mat3_to_quat_legacy(), ParticleInterpolationData::mesh, ParticleSystemModifierData::mesh_final, mul_m4_v3(), CacheEditrPathsIterData::object, CacheEditrPathsIterData::pa, ParticleSystem::part, PART_HAIR_BSPLINE, PTCacheEdit::pathcache, PEK_SELECT, PEP_EDIT_RECALC, point, PTCacheEdit::points, CacheEditrPathsIterData::psmd, PTCacheEdit::psys, PSYS_GLOBAL_HAIR, psys_mat_hair_to_global(), result, ParticleCacheKey::rot, rot, CacheEditrPathsIterData::segments, ParticleCacheKey::segments, sub_v3_v3v3(), HairKey::time, ParticleCacheKey::time, ParticleKey::time, PTCacheEditKey::time, PTCacheEdit::totcached, ParticleData::totkey, CacheEditrPathsIterData::use_weight, ParticleCacheKey::vel, and HairKey::weight.
Referenced by psys_cache_edit_paths().
| void psys_cache_paths | ( | struct ParticleSimulationData * | sim, |
| float | cfra, | ||
| bool | use_render_params ) |
Calculates paths ready for drawing/rendering
Definition at line 3256 of file particle.cc.
References ParticleInterpolationData::birthtime, BKE_lattice_deform_data_eval_co(), BKE_mesh_tessface_ensure(), BKE_object_material_get(), ParticleInterpolationData::bspline, ParticleInterpolationData::cache, cache_key_incremental_rotation(), HairKey::co, ParticleCacheKey::co, col, ParticleCacheKey::col, copy_qt_qt(), copy_v3_v3(), ParticleSimulationData::depsgraph, ParticleInterpolationData::dietime, do_guides(), do_particle_interpolation(), do_path_effectors(), ParticleSettings::draw_col, ParticleSystem::edit, ParticleSystem::effectors, ParticleInterpolationData::epoint, ListBase::first, ParticleEditSettings::flag, ParticleSettings::flag, ParticleSystem::flag, float, ParticleSettings::from, ParticleSystem::hair_out_mesh, init_particle_interpolation(), int, ParticleInterpolationData::keyed, ParticleSystem::lattice_deform_data, ParticleSystem::lattice_strength, len_v3(), length(), ParticleTexture::length, LOOP_PARTICLES, mat3_to_quat_legacy(), PointCache::mem_cache, MEM_freeN(), ParticleInterpolationData::mesh, mul_m4_v3(), mul_v3_m4v3(), ParticleSimulationData::ob, ParticleSettings::omat, PAMAP_LENGTH, ParticleSystem::part, PART_ABS_PATH_TIME, PART_CHILD_EFFECT, PART_DRAW_COL_MAT, PART_FROM_VERT, PART_HAIR, PART_HAIR_BSPLINE, ToolSettings::particle, PARTICLE_P, PARTICLE_PSMD, ParticleSystem::pathcache, ParticleSystem::pathcachebufs, PE_DRAW_PART, ParticleSystem::pointcache, pow(), ParticleSimulationData::psys, psys_alloc_path_cache_buffers(), psys_cache_vgroup(), psys_frand(), psys_free_path_cache(), psys_get_texture(), PSYS_GLOBAL_HAIR, PSYS_HAIR_DONE, PSYS_HAIR_DYNAMICS, psys_in_edit_mode(), PSYS_KEYED, psys_mat_hair_to_global(), psys_particle_value_from_verts(), psys_sim_data_free(), psys_sim_data_init(), PSYS_VG_EFFECTOR, PSYS_VG_LENGTH, Material::r, result, ParticleCacheKey::rot, rot, ParticleSimulationData::scene, ParticleSystem::seed, ParticleCacheKey::segments, sub_v3_v3v3(), ParticleCacheKey::time, Scene::toolsettings, ParticleSystem::totcached, ParticleSystem::totchild, ParticleSystem::totpart, ParticleSettings::type, ParticleCacheKey::vel, and HairKey::world_co.
Referenced by psys_update_path_cache().
| float * psys_cache_vgroup | ( | Mesh * | mesh, |
| ParticleSystem * | psys, | ||
| int | vgroup ) |
Definition at line 2575 of file particle.cc.
References BKE_defvert_find_weight(), MEM_callocN, ParticleSystem::vg_neg, and ParticleSystem::vgroup.
Referenced by psys_cache_paths(), psys_thread_context_init_distribute(), and psys_thread_context_init_path().
| bool psys_check_edited | ( | ParticleSystem * | psys | ) |
Definition at line 732 of file particle.cc.
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 706 of file particle.cc.
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(), deform_verts(), DRW_object_is_visible_psys_in_active_context(), dynamicPaint_doStep(), blender::io::hydra::HairData::is_visible(), make_duplis_particle_system(), particle_system_update(), and pointdensity_cache_psys().
| void psys_check_group_weights | ( | ParticleSettings * | part | ) |
Definition at line 762 of file particle.cc.
References BKE_collection_has_object_recursive(), BLI_addtail(), BLI_freelinkN(), BLI_freelistN(), ParticleDupliWeight::count, ParticleDupliWeight::flag, FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN, FOREACH_COLLECTION_OBJECT_RECURSIVE_END, ParticleDupliWeight::index, LISTBASE_FOREACH, MEM_callocN, ParticleDupliWeight::next, ParticleDupliWeight::ob, PART_DRAW_GR, PART_DUPLIW_CURRENT, and psys_find_group_weights().
Referenced by dupliob_refresh_exec().
| void psys_copy_particles | ( | struct ParticleSystem * | psys_dst, |
| struct ParticleSystem * | psys_src ) |
Copy.
Definition at line 1053 of file particle.cc.
References ParticleData::boid, ParticleSystem::child, ParticleData::hair, ParticleData::keys, MEM_dupallocN, ParticleSystem::particles, psys_free_children(), psys_free_particles(), ParticleSystem::totchild, ParticleData::totkey, and ParticleSystem::totpart.
Referenced by BKE_object_copy_particlesystem(), PE_create_particle_edit(), and pe_get_current().
| void psys_disable_all | ( | Object * | ob | ) |
Definition at line 639 of file particle.cc.
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 2202 of file particle.cc.
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 required_data_mask().
| void psys_enable_all | ( | Object * | ob | ) |
Definition at line 647 of file particle.cc.
References ListBase::first, ParticleSystem::flag, ParticleSystem::next, and Object::particlesystem.
Referenced by particle_intersect_mesh().
| ParticleSystem * psys_eval_get | ( | struct Depsgraph * | depsgraph, |
| struct Object * | object, | ||
| struct ParticleSystem * | psys ) |
For a given original object and its particle system, get evaluated particle system within a given dependency graph.
Definition at line 664 of file particle.cc.
References DEG_get_evaluated_object(), depsgraph, ListBase::first, ParticleSystem::next, ParticleSystem::orig_psys, and Object::particlesystem.
Referenced by BKE_ptcache_bake(), blender::ed::object::convert_psys_to_mesh(), disconnect_hair(), PE_create_particle_edit(), and remap_hair_emitter().
|
static |
Definition at line 3810 of file particle.cc.
References BKE_mesh_orco_verts_transform(), CD_MFACE, CD_ORCO, CD_ORIGINDEX, CD_ORIGSPACE, copy_v3_v3(), CustomData_get_for_write(), CustomData_get_layer(), CustomData_get_layer_for_write(), Object::data, DMCACHE_ISCHILD, DMCACHE_NOTFOUND, ELEM, float, ParticleData::num, ParticleData::num_dmcache, 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 741 of file particle.cc.
References BKE_collection_object_cache_get(), BLI_findlink(), LISTBASE_FOREACH, and Base::object.
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 2601 of file particle.cc.
References ParticleSystem::cfra, ParticleSystem::child, DMCACHE_ISCHILD, ParticleTexture::exist, float, ChildParticle::foffset, ChildParticle::fuv, get_cpa_texture(), int, ParticleSystemModifierData::mesh_final, ChildParticle::num, ChildParticle::pa, PAMAP_CHILD, PAMAP_DENS, ChildParticle::parent, ParticleSystem::part, PART_FROM_FACE, ParticleSystem::particles, ParticleSimulationData::psmd, ParticleSimulationData::psys, psys_frand(), psys_particle_on_emitter(), ParticleSystem::totchild, ParticleSystem::totpart, and tree.
Referenced by psys_update_path_cache().
| void psys_free | ( | struct Object * | ob, |
| struct ParticleSystem * | psys ) |
Free everything.
Definition at line 975 of file particle.cc.
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, ParticleSystem::flag, ParticleSystem::fluid_springs, ParticleSystem::free_edit, free_hair(), LISTBASE_FOREACH, MEM_freeN(), 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, 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 919 of file particle.cc.
References ParticleSystem::child, free_child_path_cache(), MEM_freeN(), and ParticleSystem::totchild.
Referenced by psys_copy_particles(), psys_update_path_cache(), and update_children().
| void psys_free_particles | ( | ParticleSystem * | psys | ) |
Definition at line 929 of file particle.cc.
References ParticleData::boid, ParticleData::keys, LOOP_PARTICLES, MEM_freeN(), ParticleSystem::part, PART_HAIR, PARTICLE_P, ParticleSystem::particles, ParticleSystem::totpart, and ParticleSettings::type.
Referenced by psys_copy_particles(), psys_free(), psys_reset(), and blender::ed::curves::convert_to_particle_system::try_convert_single_object().
| void psys_free_path_cache | ( | struct ParticleSystem * | psys, |
| struct PTCacheEdit * | edit ) |
Free cache path.
Definition at line 904 of file particle.cc.
References free_child_path_cache(), ParticleSystem::pathcache, PTCacheEdit::pathcache, ParticleSystem::pathcachebufs, PTCacheEdit::pathcachebufs, psys_free_path_cache_buffers(), ParticleSystem::totcached, and PTCacheEdit::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_cache_paths(), psys_free(), psys_reset(), psys_update_path_cache(), remap_hair_emitter(), and shape_cut_exec().
|
static |
Definition at line 518 of file particle.cc.
References BLI_freelistN(), LISTBASE_FOREACH, and MEM_freeN().
Referenced by free_child_path_cache(), and psys_free_path_cache().
| void psys_free_pdd | ( | ParticleSystem * | psys | ) |
Definition at line 959 of file particle.cc.
References ParticleDrawData::cdata, MEM_SAFE_FREE, ParticleDrawData::ndata, 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 | cfra, | ||
| float * | pa_time ) |
Definition at line 4510 of file particle.cc.
References ParticleSystem::child, ChildParticle::pa, ChildParticle::parent, ParticleSystem::part, PART_CHILD_FACES, ParticleSystem::particles, psys_frand(), ParticleData::size, size(), ChildParticle::w, and w().
Referenced by make_duplis_particle_system(), and modify_mesh().
| float psys_get_child_time | ( | ParticleSystem * | psys, |
| ChildParticle * | cpa, | ||
| float | cfra, | ||
| float * | birthtime, | ||
| float * | dietime ) |
Definition at line 4478 of file particle.cc.
References ParticleSystem::child, ParticleData::lifetime, ChildParticle::pa, ChildParticle::parent, ParticleSystem::part, PART_CHILD_FACES, ParticleSystem::particles, psys_frand(), ParticleData::time, time, ChildParticle::w, and w().
Referenced by pointdensity_cache_psys(), psys_get_particle_on_path(), and psys_get_particle_state().
| ParticleSystem * psys_get_current | ( | struct Object * | ob | ) |
Get object's active particle system safely.
Definition at line 534 of file particle.cc.
References LISTBASE_FOREACH, Object::particlesystem, and PSYS_CURRENT.
Referenced by buttons_context_path_particle(), buttons_texture_users_from_context(), clear_edited_exec(), connect_hair_exec(), copy_particle_systems_exec(), blender::ed::curves::convert_from_particle_system::curves_convert_from_particle_system_exec(), disconnect_hair_exec(), duplicate_particle_systems_exec(), blender::ed::object::object_select_all_by_particle(), blender::ed::outliner::outliner_draw_mode_column_toggle(), blender::ed::outliner::outliner_set_properties_tab(), and particle_system_remove_exec().
| short psys_get_current_num | ( | Object * | ob | ) |
Definition at line 548 of file particle.cc.
References ListBase::first, ParticleSystem::flag, ParticleSystem::next, Object::particlesystem, and PSYS_CURRENT.
| float psys_get_dietime_from_cache | ( | PointCache * | cache, |
| int | index ) |
Definition at line 1271 of file particle.cc.
References BKE_ptcache_mem_index_find(), float, LISTBASE_FOREACH_BACKWARD, and PointCache::mem_cache.
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 5159 of file particle.cc.
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, len, M_PI, mul_m3_v3(), mul_qt_v3(), nor, normalize_v3(), 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 5056 of file particle.cc.
References CD_MFACE, CD_MTFACE, CustomData_get_for_write(), CustomData_get_layer_n(), CustomData_get_render_layer(), DMCACHE_ISCHILD, DMCACHE_NOTFOUND, ELEM, Mesh::fdata_legacy, ChildParticle::foffset, ParticleData::foffset, ChildParticle::fuv, ParticleData::fuv, ParticleSystemModifierData::mesh_final, 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_legacy, 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 3752 of file particle.cc.
References ParticleKey::co, copy_qt_qt(), copy_v3_v3(), ParticleKey::rot, rot, ParticleKey::time, and ParticleKey::vel.
| ParticleSystemModifierData * psys_get_modifier | ( | Object * | ob, |
| ParticleSystem * | psys ) |
Definition at line 2150 of file particle.cc.
References eModifierType_ParticleSystem, LISTBASE_FOREACH, Object::modifiers, and ParticleSystemModifierData::psys.
Referenced by BKE_particle_system_blend_read_after_liblink(), disconnect_hair(), make_duplis_particle_system(), modify_mesh(), object_remove_particle_system(), blender::draw::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_sim_data_init(), remap_hair_emitter(), remove_tagged_keys(), and blender::io::hydra::HairData::write_curves().
| void psys_get_particle_on_path | ( | struct ParticleSimulationData * | sim, |
| int | pa_num, | ||
| struct ParticleKey * | state, | ||
| bool | vel ) |
Gets hair (or keyed) particles state at the "path time" specified in state->time.
Definition at line 4599 of file particle.cc.
References BKE_lattice_deform_data_eval_co(), BKE_object_material_get(), ParticleInterpolationData::bspline, ParticleInterpolationData::cache, ParticleSystem::child, ParticleSystem::childcache, 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(), ParticleThreadContext::ma, ParticleInterpolationData::mesh, ParticleThreadContext::mesh, ParticleSystemModifierData::mesh_final, mul_m4_v3(), mul_mat3_m4_v3(), mul_v3_fl(), normalize_v3(), ChildParticle::num, ParticleData::num, ParticleData::num_dmcache, ParticleSimulationData::ob, offset_child(), 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, 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, ParticleChildModifierContext::sim, ParticleThreadContext::sim, state, sub_v3_v3v3(), ParticleChildModifierContext::thread_ctx, ParticleData::time, ParticleKey::time, ParticleSystem::totchild, ParticleSystem::totpart, unit_m4(), ParticleKey::vel, ChildParticle::w, and w().
Referenced by brush_add(), modify_mesh(), psys_get_particle_on_path(), psys_get_particle_state(), rekey_particle(), rekey_particle_to_time(), and subdivide_particle().
| bool psys_get_particle_state | ( | struct ParticleSimulationData * | sim, |
| int | p, | ||
| struct ParticleKey * | state, | ||
| bool | always ) |
Gets particle's state at a time. Must call psys_sim_data_init before this.
Definition at line 4886 of file particle.cc.
References ParticleKey::ave, BKE_lattice_deform_data_eval_co(), ParticleSystem::child, ParticleSystem::childcache, CLAMP, ParticleKey::co, copy_particle_key(), ParticleChildModifierContext::cpa, DEG_get_ctime(), ParticleSimulationData::depsgraph, ParticleData::dietime, do_child_modifiers(), ELEM, ParticleSystem::flag, RenderData::frs_sec, ChildParticle::fuv, interp_qt_qtqt(), interp_v3_v3v3(), ParticleSystem::lattice_deform_data, ParticleSystem::lattice_strength, ParticleData::lifetime, madd_v3_v3v3fl(), mul_v3_fl(), 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_PHYS_KEYED, PART_PHYS_NO, PART_UNBORN, ParticleSystem::particles, ParticleData::prev_state, ParticleSimulationData::psys, psys_frand(), psys_get_child_time(), psys_get_particle_on_path(), psys_get_timestep(), psys_interpolate_particle(), PSYS_KEYED, ParticleChildModifierContext::ptex, Scene::r, ParticleKey::rot, ParticleSimulationData::scene, ParticleChildModifierContext::sim, ParticleData::state, state, ParticleChildModifierContext::thread_ctx, ParticleData::time, ParticleKey::time, ParticleSystem::totchild, ParticleSystem::totpart, unit_m4(), and ParticleKey::vel.
Referenced by blender::io::alembic::ABCPointsWriter::do_write(), explodeMesh(), get_effector_data(), make_duplis_particle_system(), modify_mesh(), blender::draw::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 4338 of file particle.cc.
References ATTR_FALLTHROUGH, BKE_mesh_texspace_ensure(), blend, MTex::blendtype, CLAMP_PARTICLE_TEXTURE_POS, CLAMP_PARTICLE_TEXTURE_POSNEG, CLAMP_WARP_PARTICLE_TEXTURE_POS, ParticleTexture::clump, ParticleKey::co, copy_v3_v3(), ParticleTexture::damp, MTex::dampfac, Object::data, MTex::def_var, ParticleData::dietime, ParticleTexture::effector, ELEM, ParticleTexture::exist, fabsf, ParticleTexture::field, MTex::fieldfac, float, ParticleData::foffset, ParticleSettings::from, ParticleData::fuv, get_particle_uv(), ParticleTexture::gravity, MTex::gravityfac, ParticleTexture::ivel, MTex::ivelfac, ParticleTexture::kink_amp, ParticleTexture::kink_freq, ParticleTexture::length, MTex::lengthfac, ParticleTexture::life, MTex::lifefac, MTex::mapto, MAX_MTEX, ParticleSystemModifierData::mesh_final, mul_m4_v3(), ParticleData::num, ParticleData::num_dmcache, ParticleSimulationData::ob, MTex::object, MTex::padensfac, 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, MTex::sizefac, ParticleData::state, sub_v3_v3(), MTex::tex, MTex::texco, TEXCO_GLOB, TEXCO_OBJECT, TEXCO_ORCO, TEXCO_PARTICLE, TEXCO_UV, texture_value_blend(), ParticleData::time, ParticleTexture::time, MTex::timefac, ParticleSystem::totpart, ParticleTexture::twist, MTex::twistfac, and MTex::uvname.
Referenced by basic_integrate(), cached_step(), dynamics_step(), init_particle_texture(), particle_system_update(), psys_cache_paths(), psys_get_birth_coords(), and reset_particle().
| float psys_get_timestep | ( | ParticleSimulationData * | sim | ) |
Definition at line 4474 of file particle.cc.
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 688 of file particle.cc.
References BKE_view_layer_active_object_get(), BKE_view_layer_synced_ensure(), DAG_EVAL_RENDER, DEG_get_input_scene(), DEG_get_input_view_layer(), DEG_get_mode(), depsgraph, ParticleSystem::edit, PointCache::edit, OB_MODE_PARTICLE_EDIT, ParticleSystem::pointcache, and psys_orig_get().
Referenced by psys_cache_paths(), psys_get_particle_on_path(), psys_sim_data_init(), psys_thread_context_init_path(), and psys_thread_create_path().
| void psys_interpolate_face | ( | Mesh * | mesh, |
| const float(*) | vert_positions[3], | ||
| const float(*) | vert_normals[3], | ||
| const MFace * | mface, | ||
| MTFace * | tface, | ||
| const float(*) | orcodata[3], | ||
| float | w[4], | ||
| float | vec[3], | ||
| float | nor[3], | ||
| float | utan[3], | ||
| float | vtan[3], | ||
| float | orco[3] ) |
Definition at line 1594 of file particle.cc.
References BKE_mesh_orco_verts_transform(), copy_v3_v3(), MFace::flag, interp_v3_v3v3v3(), interp_v3_v3v3v3v3(), map_to_sphere(), nor, normal_quad_v3(), normal_tri_v3(), sub_v3_v3v3(), MTFace::uv, MFace::v1, MFace::v2, v2, MFace::v3, MFace::v4, and w().
Referenced by psys_particle_on_dm().
Definition at line 1745 of file particle.cc.
| void psys_interpolate_particle | ( | short | type, |
| ParticleKey | keys[4], | ||
| float | dt, | ||
| ParticleKey * | result, | ||
| bool | velocity ) |
Definition at line 1137 of file particle.cc.
References ParticleKey::co, interp_cubic_v3(), interp_v3_v3v3v3v3(), key_curve_position_weights(), sub_v3_v3v3(), and ParticleKey::vel.
Referenced by do_particle_interpolation(), psys_get_particle_state(), ptcache_cloth_interpolate(), ptcache_particle_interpolate(), and ptcache_softbody_interpolate().
Definition at line 1722 of file particle.cc.
References quad, MTFace::uv, and w().
Referenced by get_particle_uv(), and psys_get_dupli_texture().
|
static |
Definition at line 1771 of file particle.cc.
References CD_MFACE, CustomData_get_layer_for_write(), interpolate_particle_value(), 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 1944 of file particle.cc.
References CD_MFACE, CD_ORIGSPACE, copy_v4_v4(), CustomData_get_layer(), CustomData_get_layer_for_write(), DMCACHE_ISCHILD, DMCACHE_NOTFOUND, PART_FROM_VERT, psys_origspace_to_w(), 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 3907 of file particle.cc.
References mul_m4_m4m4(), and psys_mat_hair_to_object().
Referenced by brush_add(), brush_puff(), createTransParticleVerts(), disconnect_hair(), flushTransParticles(), foreach_mouse_hit_key_iter(), modify_mesh(), PE_lasso_select(), PE_minmax(), psys_apply_hair_lattice(), psys_cache_edit_paths_iter(), psys_cache_paths(), psys_get_particle_on_path(), psys_thread_create_path(), and update_world_cos().
| void psys_mat_hair_to_object | ( | Object * | ob, |
| Mesh * | mesh, | ||
| short | from, | ||
| ParticleData * | pa, | ||
| float | hairmat[4][4] ) |
Definition at line 3851 of file particle.cc.
References copy_v3_v3(), ParticleData::foffset, ParticleData::fuv, ParticleData::num, ParticleData::num_dmcache, psys_face_mat(), psys_particle_on_dm(), and unit_m4().
Referenced by deflect_emitter_iter(), hair_create_input_mesh(), psys_mat_hair_to_global(), remap_hair_emitter(), remove_doubles_exec(), and blender::ed::curves::convert_to_particle_system::try_convert_single_object().
| void psys_mat_hair_to_orco | ( | Object * | ob, |
| Mesh * | mesh, | ||
| short | from, | ||
| ParticleData * | pa, | ||
| float | hairmat[4][4] ) |
Definition at line 3877 of file particle.cc.
References copy_v3_v3(), ParticleData::foffset, ParticleData::fuv, 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 680 of file particle.cc.
References ParticleSystem::edit, and ParticleSystem::orig_psys.
Referenced by psys_thread_context_init_path(), and psys_thread_create_path().
| ParticleSystem * psys_orig_get | ( | struct ParticleSystem * | psys | ) |
For a given evaluated particle system get its original.
If this input is an original particle system already, the return value is the same as the input.
Definition at line 656 of file particle.cc.
References ParticleSystem::orig_psys.
Referenced by blender::draw::drw_particle_get_hair_source(), particle_system_update(), and psys_in_edit_mode().
|
static |
Definition at line 1801 of file particle.cc.
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 | ( | struct Mesh * | mesh_final, |
| struct 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 poly 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 face, containing all its tessfaces indices. |
Definition at line 1830 of file particle.cc.
References BKE_mesh_origindex_mface_mpoly(), BLI_assert, CD_MFACE, CD_ORIGINDEX, CD_ORIGSPACE, CustomData_get_layer(), CustomData_get_layer_for_write(), DMCACHE_NOTFOUND, ELEM, Mesh::face_data, Mesh::fdata_legacy, float, isect_point_quad_v2(), isect_point_tri_v2(), LinkNode::link, LinkNode::next, POINTER_AS_INT, printf, psys_w_to_origspace(), Mesh::runtime, Mesh::totface_legacy, and OrigSpaceFace::uv.
Referenced by brush_add_count_iter(), PE_mirror_x(), psys_calc_dmcache(), and remap_hair_emitter().
| void psys_particle_on_dm | ( | struct 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] ) |
Interprets particle data to get a point on a mesh in object space.
Definition at line 2017 of file particle.cc.
References add_v3_v3(), BKE_mesh_orco_verts_transform(), CD_MFACE, CD_MTFACE, CD_ORCO, copy_v3_v3(), CustomData_get_layer(), CustomData_get_layer_for_write(), blender::Span< T >::data(), Mesh::fdata_legacy, float, mul_v3_fl(), nor, normalize_v3(), PART_FROM_VERT, PART_FROM_VOLUME, psys_interpolate_face(), psys_map_index_on_dm(), Mesh::totface_legacy, and Mesh::vert_data.
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 2241 of file particle.cc.
References copy_v3_v3(), ParticleSettings::distr, 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 2170 of file particle.cc.
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 2136 of file particle.cc.
References ParticleData::foffset, ParticleData::fuv, ParticleData::num, ParticleData::num_dmcache, psys_interpolate_value_from_verts(), and psys_map_index_on_dm().
Referenced by psys_cache_paths(), and psys_get_birth_coords().
Definition at line 567 of file particle.cc.
References ListBase::first, ParticleSystem::flag, ParticleSystem::next, Object::particlesystem, and PSYS_CURRENT.
| void psys_sim_data_free | ( | ParticleSimulationData * | sim | ) |
Definition at line 629 of file particle.cc.
References BKE_lattice_deform_data_destroy(), ParticleSystem::lattice_deform_data, and ParticleSimulationData::psys.
Referenced by cached_step(), blender::io::alembic::ABCPointsWriter::do_write(), explodeMesh(), make_duplis_particle_system(), modify_mesh(), blender::draw::particle_batch_cache_ensure_pos(), particle_system_minmax(), pointdensity_cache_psys(), psys_apply_hair_lattice(), psys_cache_paths(), psys_thread_context_free(), save_hair(), and system_step().
| void psys_sim_data_init | ( | struct ParticleSimulationData * | sim | ) |
Initialize/free data for particle simulation evaluation.
Definition at line 588 of file particle.cc.
References BKE_curvemapping_init(), BKE_lattice_deform_data_create(), DAG_EVAL_RENDER, DEG_get_mode(), ParticleSimulationData::depsgraph, eModifierMode_Realtime, eModifierMode_Render, eModifierType_Lattice, lattice, ParticleSystem::lattice_deform_data, ParticleSystem::lattice_strength, ModifierData::mode, ModifierData::next, ParticleSimulationData::ob, LatticeModifierData::object, ParticleSystem::part, PART_CHILD_USE_CLUMP_CURVE, PART_CHILD_USE_ROUGH_CURVE, PART_CHILD_USE_TWIST_CURVE, 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(), modify_mesh(), blender::draw::particle_batch_cache_ensure_pos(), particle_system_minmax(), pointdensity_cache_psys(), psys_apply_hair_lattice(), psys_cache_paths(), psys_thread_context_init_path(), and save_hair().
|
static |
Definition at line 2783 of file particle.cc.
References BLI_rng_new(), ParticleSimulationData::psys, ParticleSystem::seed, and seed.
Referenced by psys_cache_child_paths().
|
static |
Definition at line 2676 of file particle.cc.
References ParticleThreadContext::between, BKE_curvemapping_changed_all(), BKE_curvemapping_copy(), ParticleThreadContext::cfra, ParticleThreadContext::clumpcurve, ParticleSimulationData::depsgraph, ParticleEditSettings::draw_step, ParticleSettings::draw_step, ParticleThreadContext::editupdate, ELEM, ParticleThreadContext::extra_segments, ParticleEditSettings::flag, ParticleSettings::flag, float, int, max_ii(), ParticleThreadContext::mesh, ParticleThreadContext::parent_pass, 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, PE_DRAW_PART, ParticleSimulationData::psys, psys_cache_vgroup(), psys_in_edit_mode(), psys_orig_edit_get(), psys_sim_data_init(), 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, ParticleThreadContext::roughcurve, ParticleThreadContext::segments, ParticleThreadContext::sim, ParticleSystem::totchild, ParticleThreadContext::totchild, ParticleThreadContext::totparent, ParticleThreadContext::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 2792 of file particle.cc.
References add_v3_v3(), ParticleThreadContext::between, BLI_assert, BLI_listbase_clear(), ParticleThreadContext::cfra, ParticleSystem::childcache, 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, ParticleData::flag, PTCacheEditPoint::flag, float, ChildParticle::foffset, ParticleData::foffset, ParticleSettings::from, ChildParticle::fuv, ParticleData::fuv, get_child_modifier_parameters(), 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(), ChildParticle::num, ParticleData::num, ParticleData::num_dmcache, ParticleSimulationData::ob, offset_child(), ChildParticle::pa, ChildParticle::parent, PARS_UNEXIST, ParticleSystem::part, PART_CHILD_EFFECT, PART_CHILD_LONG_HAIR, PART_FROM_FACE, ParticleSystem::particles, ParticleSystem::pathcache, PTCacheEdit::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, ParticleCacheKey::rot, rot, safe_acosf(), ParticleCacheKey::segments, ParticleThreadContext::segments, ParticleThreadContext::sim, sub_v3_v3v3(), ParticleCacheKey::time, ParticleSystem::totchildcache, Mesh::totface_legacy, ParticleThreadContext::totparent, unit_qt(), v2, ParticleCacheKey::vel, ChildParticle::w, w(), and zero_v3().
Referenced by exec_child_path_cache().
| int psys_uses_gravity | ( | ParticleSimulationData * | sim | ) |
Definition at line 826 of file particle.cc.
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 3898 of file particle.cc.
References mul_mat3_m4_v3(), psys_face_mat(), and transpose_m4().
Referenced by save_hair().
Definition at line 1794 of file particle.cc.
References w().
Referenced by psys_origspace_to_w(), and psys_particle_dm_face_lookup().
|
static |
Definition at line 3768 of file particle.cc.
References cross_v3_v3v3(), normal_tri_v3(), normalize_v3(), sub_v3_v3v3(), and v2.
Referenced by psys_face_mat().
|
static |
Definition at line 224 of file particle.cc.
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 ) = nullptr |
Definition at line 5292 of file particle.cc.
Referenced by BKE_particle_batch_cache_dirty_tag(), and DRW_engines_register().
| void(* BKE_particle_batch_cache_free_cb) (ParticleSystem *psys) | ( | ParticleSystem * | psys | ) | = nullptr |
Definition at line 5293 of file particle.cc.
Referenced by BKE_particle_batch_cache_free(), and DRW_engines_register().
| IDTypeInfo IDType_ID_PA |
Definition at line 381 of file particle.cc.
| float PSYS_FRAND_BASE[PSYS_FRAND_COUNT] |
Definition at line 413 of file particle.cc.
Referenced by BKE_particle_init_rng(), psys_frand(), and psys_frand_vec().
| uint PSYS_FRAND_SEED_MULTIPLIER[PSYS_FRAND_COUNT] |
Definition at line 412 of file particle.cc.
Referenced by BKE_particle_init_rng(), psys_frand(), and psys_frand_vec().
| uint PSYS_FRAND_SEED_OFFSET[PSYS_FRAND_COUNT] |
Definition at line 411 of file particle.cc.
Referenced by BKE_particle_init_rng(), psys_frand(), and psys_frand_vec().