Blender V5.0
particle_edit.cc File Reference
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include "MEM_guardedalloc.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
#include "DNA_view3d_types.h"
#include "BLI_kdtree.h"
#include "BLI_lasso_2d.hh"
#include "BLI_listbase.h"
#include "BLI_math_geom.h"
#include "BLI_math_matrix.h"
#include "BLI_math_vector.hh"
#include "BLI_rand.h"
#include "BLI_rect.h"
#include "BLI_task.h"
#include "BLI_time.h"
#include "BLI_utildefines.h"
#include "BLT_translation.hh"
#include "BKE_bvhutils.hh"
#include "BKE_context.hh"
#include "BKE_customdata.hh"
#include "BKE_global.hh"
#include "BKE_layer.hh"
#include "BKE_library.hh"
#include "BKE_main.hh"
#include "BKE_mesh.hh"
#include "BKE_mesh_legacy_convert.hh"
#include "BKE_mesh_runtime.hh"
#include "BKE_modifier.hh"
#include "BKE_object.hh"
#include "BKE_particle.h"
#include "BKE_pointcache.h"
#include "BKE_report.hh"
#include "BKE_scene.hh"
#include "DEG_depsgraph.hh"
#include "ED_mesh.hh"
#include "ED_object.hh"
#include "ED_particle.hh"
#include "ED_physics.hh"
#include "ED_screen.hh"
#include "ED_select_utils.hh"
#include "ED_view3d.hh"
#include "GPU_immediate.hh"
#include "GPU_immediate_util.hh"
#include "GPU_state.hh"
#include "WM_api.hh"
#include "WM_message.hh"
#include "WM_toolsystem.hh"
#include "WM_types.hh"
#include "RNA_access.hh"
#include "RNA_define.hh"
#include "DEG_depsgraph_query.hh"
#include "physics_intern.hh"
#include "particle_edit_utildefines.h"

Go to the source code of this file.

Classes

struct  PEData
struct  KeyIterData
struct  DeflectEmitterIter
struct  ApplyLengthsIterData
struct  IterateLengthsIterData
struct  NearestParticleData
struct  BrushAddCountIterData
struct  BrushAddCountIterTLSData
struct  BrushEdit
struct  PointInsideBVH

Functions

Public Utilities
bool PE_poll (bContext *C)
bool PE_hair_poll (bContext *C)
bool PE_poll_view3d (bContext *C)
void PE_free_ptcache_edit (PTCacheEdit *edit)
int PE_minmax (Depsgraph *depsgraph, Scene *scene, ViewLayer *view_layer, blender::float3 &min, blender::float3 &max)
Edit Mode Helpers
int PE_start_edit (PTCacheEdit *edit)
ParticleEditSettingsPE_settings (Scene *scene)
static float pe_brush_size_get (const Scene *, ParticleBrushData *brush)
PTCacheEditPE_get_current_from_psys (ParticleSystem *psys)
static void pe_update_hair_particle_edit_pointers (PTCacheEdit *edit)
static PTCacheEditpe_get_current (Depsgraph *depsgraph, Scene *scene, Object *ob, bool create)
PTCacheEditPE_get_current (Depsgraph *depsgraph, Scene *scene, Object *ob)
PTCacheEditPE_create_current (Depsgraph *depsgraph, Scene *scene, Object *ob)
void PE_current_changed (Depsgraph *depsgraph, Scene *scene, Object *ob)
void PE_hide_keys_time (Scene *scene, PTCacheEdit *edit, float cfra)
static int pe_x_mirror (Object *ob)
Common Struct Passed to Callbacks
static void PE_set_data (bContext *C, PEData *data)
static void PE_set_view3d_data (bContext *C, PEData *data)
static bool PE_create_shape_tree (PEData *data, Object *shapeob)
static void PE_free_shape_tree (PEData *data)
static void PE_create_random_generator (PEData *data)
static void PE_free_random_generator (PEData *data)
static void PE_data_free (PEData *data)
Selection Utilities
static bool key_test_depth (const PEData *data, const float co[3], const int screen_co[2])
static bool key_inside_circle (const PEData *data, float rad, const float co[3], float *distance)
static bool key_inside_rect (PEData *data, const float co[3])
static bool key_inside_test (PEData *data, const float co[3])
static bool point_is_selected (PTCacheEditPoint *point)
Particle Edit Mirroring
static void PE_update_mirror_cache (Object *ob, ParticleSystem *psys)
static void PE_mirror_particle (Object *ob, Mesh *mesh, ParticleSystem *psys, ParticleData *pa, ParticleData *mpa)
static void PE_apply_mirror (Object *ob, ParticleSystem *psys)
Edit Calculation
static void deflect_emitter_iter (void *__restrict iter_data_v, const int iter, const TaskParallelTLS *__restrict)
static void pe_deflect_emitter (Scene *scene, Object *ob, PTCacheEdit *edit)
static void apply_lengths_iter (void *__restrict iter_data_v, const int iter, const TaskParallelTLS *__restrict)
static void PE_apply_lengths (Scene *scene, PTCacheEdit *edit)
static void iterate_lengths_iter (void *__restrict iter_data_v, const int iter, const TaskParallelTLS *__restrict)
static void pe_iterate_lengths (Scene *scene, PTCacheEdit *edit)
void recalc_lengths (PTCacheEdit *edit)
void recalc_emitter_field (Depsgraph *, Object *, ParticleSystem *psys)
static void PE_update_selection (Depsgraph *depsgraph, Scene *scene, Object *ob, int useflag)
void update_world_cos (Object *ob, PTCacheEdit *edit)
static void update_velocities (PTCacheEdit *edit)
void PE_update_object (Depsgraph *depsgraph, Scene *scene, Object *ob, int useflag)
Edit Selections
static void select_key (PEData *data, int point_index, int key_index, bool)
static void select_key_op (PEData *data, int point_index, int key_index, bool is_inside)
static void select_keys (PEData *data, int point_index, int, bool)
De-Select All Operator
static bool select_action_apply (PTCacheEditPoint *point, PTCacheEditKey *key, int action)
static wmOperatorStatus pe_select_all_exec (bContext *C, wmOperator *op)
void PARTICLE_OT_select_all (wmOperatorType *ot)
Pick Select Operator
static void nearest_key_fn (PEData *data, int point_index, int key_index, bool)
static bool pe_nearest_point_and_key (bContext *C, const int mval[2], PTCacheEditPoint **r_point, PTCacheEditKey **r_key)
bool PE_mouse_particles (bContext *C, const int mval[2], const SelectPick_Params &params)
Select Root Operator
static void select_root (PEData *data, int point_index)
static wmOperatorStatus select_roots_exec (bContext *C, wmOperator *op)
void PARTICLE_OT_select_roots (wmOperatorType *ot)
Select Tip Operator
static void select_tip (PEData *data, int point_index)
static wmOperatorStatus select_tips_exec (bContext *C, wmOperator *op)
void PARTICLE_OT_select_tips (wmOperatorType *ot)
Select Linked operator
static wmOperatorStatus select_linked_exec (bContext *C, wmOperator *)
void PARTICLE_OT_select_linked (wmOperatorType *ot)
static wmOperatorStatus select_linked_pick_exec (bContext *C, wmOperator *op)
static wmOperatorStatus select_linked_pick_invoke (bContext *C, wmOperator *op, const wmEvent *event)
void PARTICLE_OT_select_linked_pick (wmOperatorType *ot)
Box Select Operator
bool PE_deselect_all_visible_ex (PTCacheEdit *edit)
bool PE_deselect_all_visible (bContext *C)
bool PE_box_select (bContext *C, const rcti *rect, const int sel_op)
Circle Select Operator
static void pe_select_cache_free_generic_userdata (void *data)
static void pe_select_cache_init_with_generic_userdata (bContext *C, wmGenericUserData *wm_userdata)
bool PE_circle_select (bContext *C, wmGenericUserData *wm_userdata, const int sel_op, const int mval[2], float rad)
Lasso Select Operator
int PE_lasso_select (bContext *C, const int mcoords[][2], const int mcoords_len, const int sel_op)
Hide Operator
static wmOperatorStatus hide_exec (bContext *C, wmOperator *op)
void PARTICLE_OT_hide (wmOperatorType *ot)
Reveal Operator
static wmOperatorStatus reveal_exec (bContext *C, wmOperator *op)
void PARTICLE_OT_reveal (wmOperatorType *ot)
Select Less Operator
static void select_less_keys (PEData *data, int point_index)
static wmOperatorStatus select_less_exec (bContext *C, wmOperator *)
void PARTICLE_OT_select_less (wmOperatorType *ot)
Select More Operator
static void select_more_keys (PEData *data, int point_index)
static wmOperatorStatus select_more_exec (bContext *C, wmOperator *)
void PARTICLE_OT_select_more (wmOperatorType *ot)
Re-Key Operator
static void rekey_particle (PEData *data, int pa_index)
static wmOperatorStatus rekey_exec (bContext *C, wmOperator *op)
void PARTICLE_OT_rekey (wmOperatorType *ot)
static void rekey_particle_to_time (const bContext *C, Scene *scene, Object *ob, int pa_index, float path_time)
Internal Utilities
static int remove_tagged_particles (Object *ob, ParticleSystem *psys, int mirror)
static void remove_tagged_keys (Depsgraph *depsgraph, Object *ob, ParticleSystem *psys)
Subdivide Operator
static void subdivide_particle (PEData *data, int pa_index)
static wmOperatorStatus subdivide_exec (bContext *C, wmOperator *)
void PARTICLE_OT_subdivide (wmOperatorType *ot)
Remove Doubles Operator
static wmOperatorStatus remove_doubles_exec (bContext *C, wmOperator *op)
void PARTICLE_OT_remove_doubles (wmOperatorType *ot)
static wmOperatorStatus weight_set_exec (bContext *C, wmOperator *op)
void PARTICLE_OT_weight_set (wmOperatorType *ot)
Cursor Drawing
static void brush_drawcursor (bContext *C, const blender::int2 &xy, const blender::float2 &, void *)
static void toggle_particle_cursor (Scene *scene, bool enable)
Mirror Operator
static void PE_mirror_x (Depsgraph *depsgraph, Scene *scene, Object *ob, int tagged)
static wmOperatorStatus mirror_exec (bContext *C, wmOperator *)
static bool mirror_poll (bContext *C)
void PARTICLE_OT_mirror (wmOperatorType *ot)
Brush Edit Callbacks
static void brush_comb (PEData *data, float[4][4], float imat[4][4], int point_index, int key_index, PTCacheEditKey *key, float mouse_distance)
static void brush_cut (PEData *data, int pa_index)
static void brush_length (PEData *data, int point_index, float)
static void brush_puff (PEData *data, int point_index, float mouse_distance)
static void BKE_brush_weight_get (PEData *data, float[4][4], float[4][4], int point_index, int key_index, PTCacheEditKey *, float)
static void brush_smooth_get (PEData *data, float mat[4][4], float[4][4], int, int key_index, PTCacheEditKey *key, float)
static void brush_smooth_do (PEData *data, float[4][4], float imat[4][4], int point_index, int key_index, PTCacheEditKey *key, float)
static void intersect_dm_quad_weights (const float v1[3], const float v2[3], const float v3[3], const float v4[3], float w[4])
static int particle_intersect_mesh (Depsgraph *depsgraph, Scene *, Object *ob, Mesh *mesh, float *vert_cos, const float co1[3], const float co2[3], float *min_d, int *min_face, float *min_w, float *face_minmax, float *pa_minmax, float radius, float *ipoint)
static void brush_add_count_iter (void *__restrict iter_data_v, const int iter, const TaskParallelTLS *__restrict tls_v)
static void brush_add_count_iter_reduce (const void *__restrict, void *__restrict join_v, void *__restrict chunk_v)
static void brush_add_count_iter_free (const void *__restrict, void *__restrict chunk_v)
static int brush_add (const bContext *C, PEData *data, short number)
Brush Edit Operator
static int brush_edit_init (bContext *C, wmOperator *op)
static void brush_edit_apply (bContext *C, wmOperator *op, PointerRNA *itemptr)
static void brush_edit_exit (wmOperator *op)
static wmOperatorStatus brush_edit_exec (bContext *C, wmOperator *op)
static void brush_edit_apply_event (bContext *C, wmOperator *op, const wmEvent *event)
static wmOperatorStatus brush_edit_invoke (bContext *C, wmOperator *op, const wmEvent *event)
static wmOperatorStatus brush_edit_modal (bContext *C, wmOperator *op, const wmEvent *event)
static void brush_edit_cancel (bContext *, wmOperator *op)
static bool brush_edit_poll (bContext *C)
void PARTICLE_OT_brush_edit (wmOperatorType *ot)
Cut Shape
static bool shape_cut_poll (bContext *C)
static void point_inside_bvh_cb (void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit)
static bool shape_cut_test_point (PEData *data, ParticleEditSettings *pset, ParticleCacheKey *key)
static void shape_cut (PEData *data, int pa_index)
static wmOperatorStatus shape_cut_exec (bContext *C, wmOperator *)
void PARTICLE_OT_shape_cut (wmOperatorType *ot)
Particle Edit Toggle Operator
void PE_create_particle_edit (Depsgraph *depsgraph, Scene *scene, Object *ob, PointCache *cache, ParticleSystem *psys)
static bool particle_edit_toggle_poll (bContext *C)
static void free_all_psys_edit (Object *object)
bool ED_object_particle_edit_mode_supported (const Object *ob)
void ED_object_particle_edit_mode_enter_ex (Depsgraph *depsgraph, Scene *scene, Object *ob)
void ED_object_particle_edit_mode_enter (bContext *C)
void ED_object_particle_edit_mode_exit_ex (Scene *scene, Object *ob)
void ED_object_particle_edit_mode_exit (bContext *C)
static wmOperatorStatus particle_edit_toggle_exec (bContext *C, wmOperator *op)
void PARTICLE_OT_particle_edit_toggle (wmOperatorType *ot)
Set Editable Operator
static wmOperatorStatus clear_edited_exec (bContext *C, wmOperator *)
void PARTICLE_OT_edited_clear (wmOperatorType *ot)
Unify length operator
static float calculate_point_length (PTCacheEditPoint *point)
static float calculate_average_length (PTCacheEdit *edit)
static void scale_point_factor (PTCacheEditPoint *point, float factor)
static void scale_point_to_length (PTCacheEditPoint *point, float length)
static void scale_points_to_length (PTCacheEdit *edit, float length)
static wmOperatorStatus unify_length_exec (bContext *C, wmOperator *)
void PARTICLE_OT_unify_length (wmOperatorType *ot)

Iterators

enum  eParticleSelectFlag { PSEL_NEAREST = (1 << 0) , PSEL_ALL_KEYS = (1 << 1) }
using ForPointFunc = void (*)(PEData *data, int point_index)
using ForHitPointFunc = void (*)(PEData *data, int point_index, float mouse_distance)
using ForKeyFunc = void (*)(PEData *data, int point_index, int key_index, bool is_inside)
using ForKeyMatFunc
using ForHitKeyMatFunc
static void for_mouse_hit_keys (PEData *data, ForKeyFunc func, const enum eParticleSelectFlag flag)
static void foreach_mouse_hit_point (PEData *data, ForHitPointFunc func, int selected)
static void foreach_mouse_hit_key_iter (void *__restrict iter_data_v, const int iter, const TaskParallelTLS *__restrict)
static void foreach_mouse_hit_key (PEData *data, ForHitKeyMatFunc func, int selected)
static void foreach_selected_point (PEData *data, ForPointFunc func)
static void foreach_selected_key (PEData *data, ForKeyFunc func)
static void foreach_point (PEData *data, ForPointFunc func)
static int count_selected_keys (Scene *scene, PTCacheEdit *edit)

Select Random Operator

enum  { RAN_HAIR , RAN_POINTS }
static const EnumPropertyItem select_random_type_items []
static wmOperatorStatus select_random_exec (bContext *C, wmOperator *op)
void PARTICLE_OT_select_random (wmOperatorType *ot)

Delete Operator

enum  { DEL_PARTICLE , DEL_KEY }
static const EnumPropertyItem delete_type_items []
static void set_delete_particle (PEData *data, int pa_index)
static void set_delete_particle_key (PEData *data, int pa_index, int key_index, bool)
static wmOperatorStatus delete_exec (bContext *C, wmOperator *op)
void PARTICLE_OT_delete (wmOperatorType *ot)

Typedef Documentation

◆ ForHitKeyMatFunc

Initial value:
void (*)(PEData *data,
float mat[4][4],
float imat[4][4],
int point_index,
int key_index,
float mouse_distance)
BMesh const char void * data

Definition at line 717 of file particle_edit.cc.

◆ ForHitPointFunc

using ForHitPointFunc = void (*)(PEData *data, int point_index, float mouse_distance)

Definition at line 707 of file particle_edit.cc.

◆ ForKeyFunc

using ForKeyFunc = void (*)(PEData *data, int point_index, int key_index, bool is_inside)

Definition at line 709 of file particle_edit.cc.

◆ ForKeyMatFunc

Initial value:
void (*)(PEData *data,
const float mat[4][4],
const float imat[4][4],
int point_index,
int key_index,

Definition at line 711 of file particle_edit.cc.

◆ ForPointFunc

using ForPointFunc = void (*)(PEData *data, int point_index)

Definition at line 706 of file particle_edit.cc.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
RAN_HAIR 
RAN_POINTS 

Definition at line 2101 of file particle_edit.cc.

◆ anonymous enum

anonymous enum
Enumerator
DEL_PARTICLE 
DEL_KEY 

Definition at line 3452 of file particle_edit.cc.

◆ eParticleSelectFlag

Enumerator
PSEL_NEAREST 
PSEL_ALL_KEYS 

Definition at line 725 of file particle_edit.cc.

Function Documentation

◆ apply_lengths_iter()

void apply_lengths_iter ( void *__restrict iter_data_v,
const int iter,
const TaskParallelTLS * __restrict )
static

◆ BKE_brush_weight_get()

void BKE_brush_weight_get ( PEData * data,
float [4][4],
float [4][4],
int point_index,
int key_index,
PTCacheEditKey * ,
float  )
static

◆ brush_add()

int brush_add ( const bContext * C,
PEData * data,
short number )
static

Definition at line 4423 of file particle_edit.cc.

References BrushAddCountIterData::add_pars, add_v3_v3(), add_v3_v3v3(), BLI_assert, BLI_parallel_range_settings_defaults(), BLI_rng_free(), BLI_rng_new_srandom(), BLI_task_parallel_range(), ParticleEditSettings::brush, brush_add_count_iter(), brush_add_count_iter_free(), brush_add_count_iter_reduce(), C, HairKey::co, ParticleKey::co, PTCacheEditKey::co, copy_m4_m4(), CTX_data_depsgraph_pointer(), BrushAddCountIterData::data, data, BrushAddCountIterData::depsgraph, depsgraph, ParticleSimulationData::depsgraph, DMCACHE_NOTFOUND, ParticleEditSettings::flag, ParticleSystem::flag, PTCacheEditKey::flag, PTCacheEditPoint::flag, float, ParticleData::foffset, ParticleSettings::from, TaskParallelSettings::func_free, TaskParallelSettings::func_reduce, ParticleData::fuv, ParticleData::hair, i, BrushAddCountIterData::imat, init_particle(), invert_m4_m4(), PTCacheEditPoint::keys, ParticleData::lifetime, madd_v3_v3v3fl(), MEM_calloc_arrayN(), MEM_freeN(), MEM_SAFE_FREE, BrushAddCountIterData::mesh, ParticleSystemModifierData::mesh_final, ParticleSystemModifierData::mesh_original, PTCacheEdit::mirror_cache, mul_m4_v3(), mul_v3_fl(), num, ParticleData::num, BrushAddCountIterTLSData::num_added, ParticleData::num_dmcache, BrushAddCountIterData::number, ParticleSimulationData::ob, BrushAddCountIterData::object, ParticleSystem::part, ParticleSystem::particles, PE_BRUSH_ADD, PE_INTERPOLATE_ADDED, PE_settings(), pe_x_mirror(), PEK_USE_WCO, PEP_EDIT_RECALC, PEP_TAG, PTCacheEdit::points, pow, ParticleSimulationData::psmd, PTCacheEdit::psmd_eval, ParticleSimulationData::psys, PTCacheEdit::psys, psys_get_particle_on_path(), psys_get_timestep(), PSYS_GLOBAL_HAIR, psys_mat_hair_to_global(), psys_particle_on_dm(), reset_particle(), Mesh::runtime, BrushAddCountIterData::scene, ParticleSimulationData::scene, ParticleSystem::seed, BrushAddCountIterData::size, ParticleBrushData::size, ParticleData::size, size(), ParticleData::state, sub_v3_v3v3(), HairKey::time, ParticleData::time, ParticleKey::time, PTCacheEditKey::time, ParticleEditSettings::totaddkey, ParticleData::totkey, PTCacheEditPoint::totkey, ParticleSystem::totpart, PTCacheEdit::totpoint, tree, ParticleSettings::use_modifier_stack, TaskParallelSettings::userdata_chunk, TaskParallelSettings::userdata_chunk_size, ParticleKey::vel, w(), and HairKey::weight.

Referenced by brush_edit_apply().

◆ brush_add_count_iter()

◆ brush_add_count_iter_free()

void brush_add_count_iter_free ( const void * __restrict,
void *__restrict chunk_v )
static

Definition at line 4414 of file particle_edit.cc.

References BLI_rng_free(), and BrushAddCountIterTLSData::rng.

Referenced by brush_add().

◆ brush_add_count_iter_reduce()

void brush_add_count_iter_reduce ( const void * __restrict,
void *__restrict join_v,
void *__restrict chunk_v )
static

Definition at line 4405 of file particle_edit.cc.

References BrushAddCountIterTLSData::num_added.

Referenced by brush_add().

◆ brush_comb()

void brush_comb ( PEData * data,
float [4][4],
float imat[4][4],
int point_index,
int key_index,
PTCacheEditKey * key,
float mouse_distance )
static

◆ brush_cut()

◆ brush_drawcursor()

◆ brush_edit_apply()

void brush_edit_apply ( bContext * C,
wmOperator * op,
PointerRNA * itemptr )
static

Definition at line 4748 of file particle_edit.cc.

References BKE_brush_weight_get(), BKE_particle_batch_cache_dirty_tag(), BKE_PARTICLE_BATCH_DIRTY_ALL, ParticleEditSettings::brush, brush_add(), brush_comb(), brush_cut(), brush_length(), brush_puff(), brush_smooth_do(), brush_smooth_get(), ParticleEditSettings::brushtype, C, ParticleBrushData::count, count_selected_keys(), CTX_data_depsgraph_pointer(), CTX_wm_region(), wmOperator::customdata, BrushEdit::data, data, DEG_id_tag_update(), depsgraph, ED_view3d_win_to_delta(), BrushEdit::edit, ELEM, fabsf, BrushEdit::first, ParticleEditSettings::flag, ParticleSystem::flag, float, foreach_mouse_hit_key(), foreach_mouse_hit_point(), foreach_point(), foreach_selected_point(), ParticleSettings::from, Object::id, ID_RECALC_GEOMETRY, ID_RECALC_PSYS_REDO, ParticleBrushData::invert, invert_m4_m4(), BrushEdit::lastmouse, max_ff(), ParticleSystemModifierData::mesh_final, mul_v3_fl(), NA_EDITED, NC_OBJECT, ND_MODIFIER, ND_PARTICLE, BrushEdit::ob, ParticleSystem::part, PART_FROM_FACE, PTCacheEdit::pathcache, PE_BRUSH_ADD, PE_BRUSH_COMB, PE_BRUSH_CUT, PE_BRUSH_LENGTH, PE_BRUSH_PUFF, pe_brush_size_get(), PE_BRUSH_SMOOTH, PE_BRUSH_WEIGHT, PE_KEEP_LENGTHS, PE_LOCK_FIRST, PE_mirror_x(), PE_settings(), PE_start_edit(), PE_update_object(), pe_x_mirror(), PTCacheEdit::psmd_eval, PTCacheEdit::psys, psys_free_path_cache(), PSYS_GLOBAL_HAIR, wmOperator::ptr, recalc_lengths(), remove_tagged_particles(), RNA_boolean_get(), RNA_float_get_array(), Object::runtime, BrushEdit::scene, sqrtf, ParticleBrushData::step, step, ParticleBrushData::strength, update_world_cos(), view3d_operator_needs_gpu(), WM_event_add_notifier(), and BrushEdit::zfac.

Referenced by brush_edit_apply_event(), and brush_edit_exec().

◆ brush_edit_apply_event()

void brush_edit_apply_event ( bContext * C,
wmOperator * op,
const wmEvent * event )
static

◆ brush_edit_cancel()

void brush_edit_cancel ( bContext * ,
wmOperator * op )
static

Definition at line 5061 of file particle_edit.cc.

References brush_edit_exit().

Referenced by PARTICLE_OT_brush_edit().

◆ brush_edit_exec()

◆ brush_edit_exit()

void brush_edit_exit ( wmOperator * op)
static

◆ brush_edit_init()

◆ brush_edit_invoke()

◆ brush_edit_modal()

◆ brush_edit_poll()

bool brush_edit_poll ( bContext * C)
static

Definition at line 5066 of file particle_edit.cc.

References C, PE_poll_view3d(), and WM_toolsystem_active_tool_is_brush().

Referenced by PARTICLE_OT_brush_edit().

◆ brush_length()

void brush_length ( PEData * data,
int point_index,
float  )
static

◆ brush_puff()

◆ brush_smooth_do()

void brush_smooth_do ( PEData * data,
float [4][4],
float imat[4][4],
int point_index,
int key_index,
PTCacheEditKey * key,
float  )
static

◆ brush_smooth_get()

void brush_smooth_get ( PEData * data,
float mat[4][4],
float [4][4],
int ,
int key_index,
PTCacheEditKey * key,
float  )
static

Definition at line 4093 of file particle_edit.cc.

References add_v3_v3(), PTCacheEditKey::co, data, mul_mat3_m4_v3(), and sub_v3_v3v3().

Referenced by brush_edit_apply().

◆ calculate_average_length()

float calculate_average_length ( PTCacheEdit * edit)
static

Definition at line 5646 of file particle_edit.cc.

References calculate_point_length(), LOOP_SELECTED_POINTS, and POINT_P.

Referenced by unify_length_exec().

◆ calculate_point_length()

float calculate_point_length ( PTCacheEditPoint * point)
static

Definition at line 5634 of file particle_edit.cc.

References KEY_K, len_v3v3(), length(), and LOOP_KEYS.

Referenced by calculate_average_length(), and scale_point_to_length().

◆ clear_edited_exec()

◆ count_selected_keys()

int count_selected_keys ( Scene * scene,
PTCacheEdit * edit )
static

◆ deflect_emitter_iter()

◆ delete_exec()

◆ ED_object_particle_edit_mode_enter()

void ED_object_particle_edit_mode_enter ( bContext * C)

◆ ED_object_particle_edit_mode_enter_ex()

◆ ED_object_particle_edit_mode_exit()

void ED_object_particle_edit_mode_exit ( bContext * C)

◆ ED_object_particle_edit_mode_exit_ex()

◆ ED_object_particle_edit_mode_supported()

bool ED_object_particle_edit_mode_supported ( const Object * ob)

◆ for_mouse_hit_keys()

◆ foreach_mouse_hit_key()

◆ foreach_mouse_hit_key_iter()

◆ foreach_mouse_hit_point()

void foreach_mouse_hit_point ( PEData * data,
ForHitPointFunc func,
int selected )
static

◆ foreach_point()

void foreach_point ( PEData * data,
ForPointFunc func )
static

◆ foreach_selected_key()

void foreach_selected_key ( PEData * data,
ForKeyFunc func )
static

Definition at line 928 of file particle_edit.cc.

References data, KEY_K, LOOP_SELECTED_KEYS, LOOP_VISIBLE_POINTS, and POINT_P.

Referenced by delete_exec(), and select_linked_exec().

◆ foreach_selected_point()

void foreach_selected_point ( PEData * data,
ForPointFunc func )
static

Definition at line 918 of file particle_edit.cc.

References data, LOOP_SELECTED_POINTS, and POINT_P.

Referenced by brush_edit_apply(), delete_exec(), rekey_exec(), and shape_cut_exec().

◆ free_all_psys_edit()

void free_all_psys_edit ( Object * object)
static

◆ hide_exec()

◆ intersect_dm_quad_weights()

void intersect_dm_quad_weights ( const float v1[3],
const float v2[3],
const float v3[3],
const float v4[3],
float w[4] )
static

Definition at line 4137 of file particle_edit.cc.

References copy_v3_v3(), interp_weights_poly_v3(), v2, and w().

Referenced by particle_intersect_mesh().

◆ iterate_lengths_iter()

◆ key_inside_circle()

bool key_inside_circle ( const PEData * data,
float rad,
const float co[3],
float * distance )
static

◆ key_inside_rect()

bool key_inside_rect ( PEData * data,
const float co[3] )
static

◆ key_inside_test()

bool key_inside_test ( PEData * data,
const float co[3] )
static

Definition at line 677 of file particle_edit.cc.

References data, key_inside_circle(), and key_inside_rect().

Referenced by for_mouse_hit_keys().

◆ key_test_depth()

◆ mirror_exec()

◆ mirror_poll()

◆ nearest_key_fn()

void nearest_key_fn ( PEData * data,
int point_index,
int key_index,
bool  )
static

◆ particle_edit_toggle_exec()

◆ particle_edit_toggle_poll()

◆ particle_intersect_mesh()

int particle_intersect_mesh ( Depsgraph * depsgraph,
Scene * ,
Object * ob,
Mesh * mesh,
float * vert_cos,
const float co1[3],
const float co2[3],
float * min_d,
int * min_face,
float * min_w,
float * face_minmax,
float * pa_minmax,
float radius,
float * ipoint )
static

◆ PARTICLE_OT_brush_edit()

◆ PARTICLE_OT_delete()

◆ PARTICLE_OT_edited_clear()

void PARTICLE_OT_edited_clear ( wmOperatorType * ot)

◆ PARTICLE_OT_hide()

void PARTICLE_OT_hide ( wmOperatorType * ot)

Definition at line 2548 of file particle_edit.cc.

References hide_exec(), OPTYPE_REGISTER, OPTYPE_UNDO, ot, PE_poll(), and RNA_def_boolean().

Referenced by operatortypes_particle().

◆ PARTICLE_OT_mirror()

void PARTICLE_OT_mirror ( wmOperatorType * ot)

◆ PARTICLE_OT_particle_edit_toggle()

void PARTICLE_OT_particle_edit_toggle ( wmOperatorType * ot)

◆ PARTICLE_OT_rekey()

void PARTICLE_OT_rekey ( wmOperatorType * ot)

◆ PARTICLE_OT_remove_doubles()

void PARTICLE_OT_remove_doubles ( wmOperatorType * ot)

◆ PARTICLE_OT_reveal()

void PARTICLE_OT_reveal ( wmOperatorType * ot)

Definition at line 2600 of file particle_edit.cc.

References OPTYPE_REGISTER, OPTYPE_UNDO, ot, PE_poll(), reveal_exec(), and RNA_def_boolean().

Referenced by operatortypes_particle().

◆ PARTICLE_OT_select_all()

void PARTICLE_OT_select_all ( wmOperatorType * ot)

◆ PARTICLE_OT_select_less()

void PARTICLE_OT_select_less ( wmOperatorType * ot)

Definition at line 2670 of file particle_edit.cc.

References OPTYPE_REGISTER, OPTYPE_UNDO, ot, PE_poll(), and select_less_exec().

Referenced by operatortypes_particle().

◆ PARTICLE_OT_select_linked()

void PARTICLE_OT_select_linked ( wmOperatorType * ot)

Definition at line 2206 of file particle_edit.cc.

References OPTYPE_REGISTER, OPTYPE_UNDO, ot, PE_poll(), and select_linked_exec().

Referenced by operatortypes_particle().

◆ PARTICLE_OT_select_linked_pick()

◆ PARTICLE_OT_select_more()

void PARTICLE_OT_select_more ( wmOperatorType * ot)

Definition at line 2742 of file particle_edit.cc.

References OPTYPE_REGISTER, OPTYPE_UNDO, ot, PE_poll(), and select_more_exec().

Referenced by operatortypes_particle().

◆ PARTICLE_OT_select_random()

◆ PARTICLE_OT_select_roots()

void PARTICLE_OT_select_roots ( wmOperatorType * ot)

◆ PARTICLE_OT_select_tips()

void PARTICLE_OT_select_tips ( wmOperatorType * ot)

◆ PARTICLE_OT_shape_cut()

void PARTICLE_OT_shape_cut ( wmOperatorType * ot)

Definition at line 5292 of file particle_edit.cc.

References OPTYPE_REGISTER, OPTYPE_UNDO, ot, shape_cut_exec(), and shape_cut_poll().

Referenced by operatortypes_particle().

◆ PARTICLE_OT_subdivide()

void PARTICLE_OT_subdivide ( wmOperatorType * ot)

Definition at line 3210 of file particle_edit.cc.

References OPTYPE_REGISTER, OPTYPE_UNDO, ot, PE_hair_poll(), and subdivide_exec().

Referenced by operatortypes_particle().

◆ PARTICLE_OT_unify_length()

void PARTICLE_OT_unify_length ( wmOperatorType * ot)

Definition at line 5730 of file particle_edit.cc.

References OPTYPE_REGISTER, OPTYPE_UNDO, ot, PE_poll_view3d(), and unify_length_exec().

Referenced by operatortypes_particle().

◆ PARTICLE_OT_weight_set()

void PARTICLE_OT_weight_set ( wmOperatorType * ot)

◆ PE_apply_lengths()

◆ PE_apply_mirror()

◆ PE_box_select()

◆ pe_brush_size_get()

float pe_brush_size_get ( const Scene * ,
ParticleBrushData * brush )
static

◆ PE_circle_select()

◆ PE_create_current()

◆ PE_create_particle_edit()

◆ PE_create_random_generator()

void PE_create_random_generator ( PEData * data)
static

Definition at line 553 of file particle_edit.cc.

References BLI_rng_new(), BLI_time_now_seconds_i(), data, POINTER_AS_UINT, and UINT_MAX.

Referenced by brush_edit_init().

◆ PE_create_shape_tree()

bool PE_create_shape_tree ( PEData * data,
Object * shapeob )
static

Definition at line 535 of file particle_edit.cc.

References BKE_object_get_evaluated_mesh(), data, and DEG_get_evaluated().

Referenced by shape_cut_exec().

◆ PE_current_changed()

void PE_current_changed ( Depsgraph * depsgraph,
Scene * scene,
Object * ob )

Definition at line 412 of file particle_edit.cc.

References depsgraph, Object::mode, OB_MODE_PARTICLE_EDIT, and PE_create_current().

◆ PE_data_free()

◆ pe_deflect_emitter()

◆ PE_deselect_all_visible()

◆ PE_deselect_all_visible_ex()

◆ PE_free_ptcache_edit()

◆ PE_free_random_generator()

void PE_free_random_generator ( PEData * data)
static

Definition at line 561 of file particle_edit.cc.

References BLI_rng_free(), and data.

Referenced by PE_data_free().

◆ PE_free_shape_tree()

void PE_free_shape_tree ( PEData * data)
static

Definition at line 548 of file particle_edit.cc.

References data.

Referenced by PE_data_free(), and shape_cut_exec().

◆ PE_get_current()

◆ pe_get_current()

◆ PE_get_current_from_psys()

◆ PE_hair_poll()

◆ PE_hide_keys_time()

◆ pe_iterate_lengths()

◆ PE_lasso_select()

◆ PE_minmax()

◆ PE_mirror_particle()

◆ PE_mirror_x()

◆ PE_mouse_particles()

◆ pe_nearest_point_and_key()

bool pe_nearest_point_and_key ( bContext * C,
const int mval[2],
PTCacheEditPoint ** r_point,
PTCacheEditKey ** r_key )
static

◆ PE_poll()

◆ PE_poll_view3d()

◆ pe_select_all_exec()

◆ pe_select_cache_free_generic_userdata()

void pe_select_cache_free_generic_userdata ( void * data)
static

Definition at line 2354 of file particle_edit.cc.

References data, MEM_freeN(), and PE_data_free().

Referenced by pe_select_cache_init_with_generic_userdata().

◆ pe_select_cache_init_with_generic_userdata()

void pe_select_cache_init_with_generic_userdata ( bContext * C,
wmGenericUserData * wm_userdata )
static

◆ PE_set_data()

◆ PE_set_view3d_data()

◆ PE_settings()

◆ PE_start_edit()

◆ pe_update_hair_particle_edit_pointers()

◆ PE_update_mirror_cache()

◆ PE_update_object()

◆ PE_update_selection()

◆ pe_x_mirror()

int pe_x_mirror ( Object * ob)
static

◆ point_inside_bvh_cb()

void point_inside_bvh_cb ( void * userdata,
int index,
const BVHTreeRay * ray,
BVHTreeRayHit * hit )
static

Definition at line 5122 of file particle_edit.cc.

References data, and BVHTreeRayHit::index.

Referenced by shape_cut_test_point().

◆ point_is_selected()

bool point_is_selected ( PTCacheEditPoint * point)
static

Definition at line 685 of file particle_edit.cc.

References PTCacheEditPoint::flag, KEY_K, LOOP_SELECTED_KEYS, and PEP_HIDE.

Referenced by find_fcurve_segment(), and PE_mirror_x().

◆ recalc_emitter_field()

◆ recalc_lengths()

void recalc_lengths ( PTCacheEdit * edit)

Set current distances to be kept between neighboring keys.

Definition at line 1424 of file particle_edit.cc.

References KEY_K, len_v3v3(), LOOP_EDITED_POINTS, and POINT_P.

Referenced by brush_edit_apply(), copy_particle_edit(), delete_exec(), PE_create_particle_edit(), rekey_exec(), scale_points_to_length(), shape_cut_exec(), and subdivide_exec().

◆ rekey_exec()

◆ rekey_particle()

◆ rekey_particle_to_time()

◆ remove_doubles_exec()

◆ remove_tagged_keys()

◆ remove_tagged_particles()

◆ reveal_exec()

◆ scale_point_factor()

void scale_point_factor ( PTCacheEditPoint * point,
float factor )
static

◆ scale_point_to_length()

void scale_point_to_length ( PTCacheEditPoint * point,
float length )
static

Definition at line 5686 of file particle_edit.cc.

References calculate_point_length(), length(), and scale_point_factor().

Referenced by scale_points_to_length().

◆ scale_points_to_length()

void scale_points_to_length ( PTCacheEdit * edit,
float length )
static

◆ select_action_apply()

bool select_action_apply ( PTCacheEditPoint * point,
PTCacheEditKey * key,
int action )
static

◆ select_key()

void select_key ( PEData * data,
int point_index,
int key_index,
bool  )
static

◆ select_key_op()

void select_key_op ( PEData * data,
int point_index,
int key_index,
bool is_inside )
static

◆ select_keys()

void select_keys ( PEData * data,
int point_index,
int ,
bool  )
static

◆ select_less_exec()

◆ select_less_keys()

void select_less_keys ( PEData * data,
int point_index )
static

◆ select_linked_exec()

◆ select_linked_pick_exec()

◆ select_linked_pick_invoke()

wmOperatorStatus select_linked_pick_invoke ( bContext * C,
wmOperator * op,
const wmEvent * event )
static

◆ select_more_exec()

◆ select_more_keys()

void select_more_keys ( PEData * data,
int point_index )
static

◆ select_random_exec()

◆ select_root()

void select_root ( PEData * data,
int point_index )
static

◆ select_roots_exec()

◆ select_tip()

void select_tip ( PEData * data,
int point_index )
static

◆ select_tips_exec()

◆ set_delete_particle()

void set_delete_particle ( PEData * data,
int pa_index )
static

Definition at line 3460 of file particle_edit.cc.

References data, PTCacheEditPoint::flag, PEP_TAG, and PTCacheEdit::points.

Referenced by delete_exec().

◆ set_delete_particle_key()

void set_delete_particle_key ( PEData * data,
int pa_index,
int key_index,
bool  )
static

Definition at line 3467 of file particle_edit.cc.

References data, PTCacheEditKey::flag, PTCacheEditPoint::keys, PEK_TAG, and PTCacheEdit::points.

Referenced by delete_exec().

◆ shape_cut()

◆ shape_cut_exec()

◆ shape_cut_poll()

bool shape_cut_poll ( bContext * C)
static

◆ shape_cut_test_point()

◆ subdivide_exec()

◆ subdivide_particle()

◆ toggle_particle_cursor()

◆ unify_length_exec()

◆ update_velocities()

◆ update_world_cos()

◆ weight_set_exec()

Variable Documentation

◆ delete_type_items

const EnumPropertyItem delete_type_items[]
static
Initial value:
= {
{DEL_PARTICLE, "PARTICLE", 0, "Particle", ""},
{DEL_KEY, "KEY", 0, "Key", ""},
{0, nullptr, 0, nullptr, nullptr},
}
@ DEL_KEY
@ DEL_PARTICLE

Definition at line 3454 of file particle_edit.cc.

◆ select_random_type_items

const EnumPropertyItem select_random_type_items[]
static
Initial value:
= {
{RAN_HAIR, "HAIR", 0, "Hair", ""},
{RAN_POINTS, "POINTS", 0, "Points", ""},
{0, nullptr, 0, nullptr, nullptr},
}
@ RAN_HAIR
@ RAN_POINTS

Definition at line 2103 of file particle_edit.cc.

Referenced by PARTICLE_OT_select_random().