Blender V5.0
particle_object.cc File Reference
#include <cstdlib>
#include <cstring>
#include "MEM_guardedalloc.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_modifier_types.h"
#include "DNA_scene_types.h"
#include "BLI_listbase.h"
#include "BLI_math_geom.h"
#include "BLI_math_matrix.h"
#include "BLI_math_vector.h"
#include "BLI_string_utf8.h"
#include "BLI_utildefines.h"
#include "BKE_bvhutils.hh"
#include "BKE_context.hh"
#include "BKE_customdata.hh"
#include "BKE_global.hh"
#include "BKE_layer.hh"
#include "BKE_lib_id.hh"
#include "BKE_library.hh"
#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_report.hh"
#include "DEG_depsgraph.hh"
#include "DEG_depsgraph_build.hh"
#include "DEG_depsgraph_query.hh"
#include "RNA_access.hh"
#include "RNA_define.hh"
#include "RNA_prototypes.hh"
#include "WM_api.hh"
#include "WM_types.hh"
#include "ED_object.hh"
#include "ED_particle.hh"
#include "ED_screen.hh"
#include "particle_edit_utildefines.h"
#include "physics_intern.hh"

Go to the source code of this file.

Macros

#define PSYS_FROM_FIRST
#define PSYS_FROM_NEXT(cur)

Enumerations

enum  eCopyParticlesSpace { PAR_COPY_SPACE_OBJECT = 0 , PAR_COPY_SPACE_WORLD = 1 }

Functions

static wmOperatorStatus particle_system_add_exec (bContext *C, wmOperator *)
void OBJECT_OT_particle_system_add (wmOperatorType *ot)
static wmOperatorStatus particle_system_remove_exec (bContext *C, wmOperator *)
void OBJECT_OT_particle_system_remove (wmOperatorType *ot)
static bool psys_poll (bContext *C)
static wmOperatorStatus new_particle_settings_exec (bContext *C, wmOperator *)
void PARTICLE_OT_new (wmOperatorType *ot)
static wmOperatorStatus new_particle_target_exec (bContext *C, wmOperator *)
void PARTICLE_OT_new_target (wmOperatorType *ot)
static wmOperatorStatus remove_particle_target_exec (bContext *C, wmOperator *)
void PARTICLE_OT_target_remove (wmOperatorType *ot)
static wmOperatorStatus target_move_up_exec (bContext *C, wmOperator *)
void PARTICLE_OT_target_move_up (wmOperatorType *ot)
static wmOperatorStatus target_move_down_exec (bContext *C, wmOperator *)
void PARTICLE_OT_target_move_down (wmOperatorType *ot)
static wmOperatorStatus dupliob_refresh_exec (bContext *C, wmOperator *)
void PARTICLE_OT_dupliob_refresh (wmOperatorType *ot)
static wmOperatorStatus dupliob_move_up_exec (bContext *C, wmOperator *)
void PARTICLE_OT_dupliob_move_up (wmOperatorType *ot)
static wmOperatorStatus copy_particle_dupliob_exec (bContext *C, wmOperator *)
void PARTICLE_OT_dupliob_copy (wmOperatorType *ot)
static wmOperatorStatus remove_particle_dupliob_exec (bContext *C, wmOperator *)
void PARTICLE_OT_dupliob_remove (wmOperatorType *ot)
static wmOperatorStatus dupliob_move_down_exec (bContext *C, wmOperator *)
void PARTICLE_OT_dupliob_move_down (wmOperatorType *ot)
static void disconnect_hair (Depsgraph *depsgraph, Scene *scene, Object *ob, ParticleSystem *psys)
static wmOperatorStatus disconnect_hair_exec (bContext *C, wmOperator *op)
void PARTICLE_OT_disconnect_hair (wmOperatorType *ot)
static bool remap_hair_emitter (Depsgraph *depsgraph, Scene *scene, Object *ob, ParticleSystem *psys, Object *target_ob, ParticleSystem *target_psys, PTCacheEdit *target_edit, const float from_mat[4][4], const float to_mat[4][4], bool from_global, bool to_global)
static bool connect_hair (Depsgraph *depsgraph, Scene *scene, Object *ob, ParticleSystem *psys)
static wmOperatorStatus connect_hair_exec (bContext *C, wmOperator *op)
void PARTICLE_OT_connect_hair (wmOperatorType *ot)
static void copy_particle_edit (Depsgraph *depsgraph, Scene *scene, Object *ob, ParticleSystem *psys, ParticleSystem *psys_from)
static void remove_particle_systems_from_object (Object *ob_to)
static bool copy_particle_systems_to_object (const bContext *C, Scene *scene, Object *ob_from, ParticleSystem *single_psys_from, Object *ob_to, int space, bool duplicate_settings)
static bool copy_particle_systems_poll (bContext *C)
static wmOperatorStatus copy_particle_systems_exec (bContext *C, wmOperator *op)
void PARTICLE_OT_copy_particle_systems (wmOperatorType *ot)
static bool duplicate_particle_systems_poll (bContext *C)
static wmOperatorStatus duplicate_particle_systems_exec (bContext *C, wmOperator *op)
void PARTICLE_OT_duplicate_particle_system (wmOperatorType *ot)
static bool remove_all_particle_systems_poll (bContext *C)
static wmOperatorStatus particle_system_remove_all_exec (bContext *C, wmOperator *)
void PARTICLE_OT_particle_system_remove_all (wmOperatorType *ot)

Variables

static float I [4][4]

Macro Definition Documentation

◆ PSYS_FROM_FIRST

#define PSYS_FROM_FIRST
Value:
static_cast<ParticleSystem *>( \
(single_psys_from ? single_psys_from : ob_from->particlesystem.first))

Referenced by copy_particle_systems_to_object().

◆ PSYS_FROM_NEXT

#define PSYS_FROM_NEXT ( cur)
Value:
(single_psys_from ? nullptr : (cur)->next)

Referenced by copy_particle_systems_to_object().

Enumeration Type Documentation

◆ eCopyParticlesSpace

Enumerator
PAR_COPY_SPACE_OBJECT 
PAR_COPY_SPACE_WORLD 

Definition at line 989 of file particle_object.cc.

Function Documentation

◆ connect_hair()

bool connect_hair ( Depsgraph * depsgraph,
Scene * scene,
Object * ob,
ParticleSystem * psys )
static

◆ connect_hair_exec()

◆ copy_particle_dupliob_exec()

◆ copy_particle_edit()

◆ copy_particle_systems_exec()

◆ copy_particle_systems_poll()

◆ copy_particle_systems_to_object()

◆ disconnect_hair()

◆ disconnect_hair_exec()

◆ duplicate_particle_systems_exec()

◆ duplicate_particle_systems_poll()

◆ dupliob_move_down_exec()

◆ dupliob_move_up_exec()

◆ dupliob_refresh_exec()

◆ new_particle_settings_exec()

◆ new_particle_target_exec()

◆ OBJECT_OT_particle_system_add()

void OBJECT_OT_particle_system_add ( wmOperatorType * ot)

◆ OBJECT_OT_particle_system_remove()

void OBJECT_OT_particle_system_remove ( wmOperatorType * ot)

◆ PARTICLE_OT_connect_hair()

void PARTICLE_OT_connect_hair ( wmOperatorType * ot)

Definition at line 971 of file particle_object.cc.

References connect_hair_exec(), OPTYPE_UNDO, ot, and RNA_def_boolean().

Referenced by operatortypes_particle().

◆ PARTICLE_OT_copy_particle_systems()

◆ PARTICLE_OT_disconnect_hair()

void PARTICLE_OT_disconnect_hair ( wmOperatorType * ot)

Definition at line 668 of file particle_object.cc.

References disconnect_hair_exec(), OPTYPE_UNDO, ot, and RNA_def_boolean().

Referenced by operatortypes_particle().

◆ PARTICLE_OT_duplicate_particle_system()

void PARTICLE_OT_duplicate_particle_system ( wmOperatorType * ot)

◆ PARTICLE_OT_dupliob_copy()

void PARTICLE_OT_dupliob_copy ( wmOperatorType * ot)

Definition at line 487 of file particle_object.cc.

References copy_particle_dupliob_exec(), OPTYPE_REGISTER, OPTYPE_UNDO, and ot.

Referenced by operatortypes_particle().

◆ PARTICLE_OT_dupliob_move_down()

void PARTICLE_OT_dupliob_move_down ( wmOperatorType * ot)

Definition at line 572 of file particle_object.cc.

References dupliob_move_down_exec(), OPTYPE_REGISTER, OPTYPE_UNDO, and ot.

Referenced by operatortypes_particle().

◆ PARTICLE_OT_dupliob_move_up()

void PARTICLE_OT_dupliob_move_up ( wmOperatorType * ot)

Definition at line 447 of file particle_object.cc.

References dupliob_move_up_exec(), OPTYPE_REGISTER, OPTYPE_UNDO, and ot.

Referenced by operatortypes_particle().

◆ PARTICLE_OT_dupliob_refresh()

void PARTICLE_OT_dupliob_refresh ( wmOperatorType * ot)

Definition at line 408 of file particle_object.cc.

References dupliob_refresh_exec(), OPTYPE_REGISTER, OPTYPE_UNDO, and ot.

Referenced by operatortypes_particle().

◆ PARTICLE_OT_dupliob_remove()

void PARTICLE_OT_dupliob_remove ( wmOperatorType * ot)

Definition at line 531 of file particle_object.cc.

References OPTYPE_REGISTER, OPTYPE_UNDO, ot, and remove_particle_dupliob_exec().

Referenced by operatortypes_particle().

◆ PARTICLE_OT_new()

void PARTICLE_OT_new ( wmOperatorType * ot)

◆ PARTICLE_OT_new_target()

void PARTICLE_OT_new_target ( wmOperatorType * ot)

Definition at line 248 of file particle_object.cc.

References new_particle_target_exec(), OPTYPE_REGISTER, OPTYPE_UNDO, and ot.

Referenced by operatortypes_particle().

◆ PARTICLE_OT_particle_system_remove_all()

void PARTICLE_OT_particle_system_remove_all ( wmOperatorType * ot)

◆ PARTICLE_OT_target_move_down()

void PARTICLE_OT_target_move_down ( wmOperatorType * ot)

Definition at line 378 of file particle_object.cc.

References OPTYPE_REGISTER, OPTYPE_UNDO, ot, and target_move_down_exec().

Referenced by operatortypes_particle().

◆ PARTICLE_OT_target_move_up()

void PARTICLE_OT_target_move_up ( wmOperatorType * ot)

Definition at line 339 of file particle_object.cc.

References OPTYPE_REGISTER, OPTYPE_UNDO, ot, and target_move_up_exec().

Referenced by operatortypes_particle().

◆ PARTICLE_OT_target_remove()

void PARTICLE_OT_target_remove ( wmOperatorType * ot)

Definition at line 297 of file particle_object.cc.

References OPTYPE_REGISTER, OPTYPE_UNDO, ot, and remove_particle_target_exec().

Referenced by operatortypes_particle().

◆ particle_system_add_exec()

◆ particle_system_remove_all_exec()

◆ particle_system_remove_exec()

◆ psys_poll()

bool psys_poll ( bContext * C)
static

Definition at line 153 of file particle_object.cc.

References C, CTX_data_pointer_get_type(), and ptr.

Referenced by PARTICLE_OT_new().

◆ remap_hair_emitter()

bool remap_hair_emitter ( Depsgraph * depsgraph,
Scene * scene,
Object * ob,
ParticleSystem * psys,
Object * target_ob,
ParticleSystem * target_psys,
PTCacheEdit * target_edit,
const float from_mat[4][4],
const float to_mat[4][4],
bool from_global,
bool to_global )
static

◆ remove_all_particle_systems_poll()

◆ remove_particle_dupliob_exec()

◆ remove_particle_systems_from_object()

◆ remove_particle_target_exec()

◆ target_move_down_exec()

◆ target_move_up_exec()

Variable Documentation

◆ I

float I[4][4]
static
Initial value:
= {
{1.0f, 0.0f, 0.0f, 0.0f},
{0.0f, 1.0f, 0.0f, 0.0f},
{0.0f, 0.0f, 1.0f, 0.0f},
{0.0f, 0.0f, 0.0f, 1.0f},
}

Definition at line 60 of file particle_object.cc.