Blender V5.3
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.hh"
#include "BLI_lasso_2d.hh"
#include "BLI_listbase.hh"
#include "BLI_math_geom_c.hh"
#include "BLI_math_matrix_c.hh"
#include "BLI_math_vector.hh"
#include "BLI_rand_c.hh"
#include "BLI_rect.hh"
#include "BLI_task_c.hh"
#include "BLI_time.hh"
#include "BLI_utildefines.hh"
#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  blender::PEData
struct  blender::KeyIterData
struct  blender::DeflectEmitterIter
struct  blender::ApplyLengthsIterData
struct  blender::IterateLengthsIterData
struct  blender::NearestParticleData
struct  blender::BrushAddCountIterData
struct  blender::BrushAddCountIterTLSData
struct  blender::BrushEdit
struct  blender::PointInsideBVH

Namespaces

namespace  blender
 BMesh Iterators.

Functions

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

Iterators

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

Select Random Operator

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

Delete Operator

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