Blender V2.61 - r43446
|
#include <stdlib.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "DNA_meshdata_types.h"
#include "DNA_modifier_types.h"
#include "DNA_scene_types.h"
#include "BLI_math.h"
#include "BLI_listbase.h"
#include "BLI_utildefines.h"
#include "BKE_context.h"
#include "BKE_depsgraph.h"
#include "BKE_DerivedMesh.h"
#include "BKE_cdderivedmesh.h"
#include "BKE_global.h"
#include "BKE_main.h"
#include "BKE_particle.h"
#include "BKE_pointcache.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "WM_api.h"
#include "WM_types.h"
#include "ED_particle.h"
#include "ED_screen.h"
#include "ED_object.h"
#include "physics_intern.h"
Go to the source code of this file.
Definition in file particle_object.c.
static void connect_hair | ( | Scene * | scene, |
Object * | ob, | ||
ParticleSystem * | psys | ||
) | [static] |
Definition at line 623 of file particle_object.c.
References add_v3_v3(), BLI_bvhtree_find_nearest(), bvhtree_from_mesh_faces(), CD_MASK_BAREMESH, CDDM_copy(), CDDM_get_face(), CDDM_get_vert(), BVHTreeNearest::co, MVert::co, HairKey::co, co, copy_v3_v3(), DerivedMesh::deformedOnly, BVHTreeNearest::dist, ParticleSystemModifierData::dm, ParticleSystem::edit, ParticleSystem::flag, PTCacheEditKey::flag, FLT_MAX, free_bvhtree_from_mesh(), ParticleSettings::from, ParticleData::fuv, G, G_DEBUG, DerivedMesh::getNumVerts, ParticleData::hair, i, BVHTreeNearest::index, interp_weights_poly_v3(), invert_m4_m4(), PTCacheEditPoint::keys, mesh_get_derived_deform(), mul_m4_v3(), BVHTreeFromMesh::nearest_callback, NULL, ParticleData::num, ParticleData::num_dmcache, Object::obmat, ParticleSystem::part, PART_HAIR, ParticleSystem::particles, PE_update_object(), PEK_USE_WCO, PTCacheEdit::points, psys_free_path_cache(), psys_get_modifier(), PSYS_GLOBAL_HAIR, psys_mat_hair_to_global(), psys_particle_dm_face_lookup(), DerivedMesh::release, sub_v3_v3v3(), BVHTreeFromMesh::tree, ParticleSettings::type, MFace::v1, MFace::v2, MFace::v3, and MFace::v4.
Referenced by connect_hair_exec().
static int connect_hair_exec | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 720 of file particle_object.c.
References connect_hair(), CTX_data_pointer_get_type(), CTX_data_scene(), DAG_id_tag_update(), PointerRNA::data, ED_object_context(), ListBase::first, Object::id, NC_OBJECT, ND_PARTICLE, ParticleSystem::next, NULL, OB_RECALC_DATA, OPERATOR_CANCELLED, OPERATOR_FINISHED, Object::particlesystem, wmOperator::ptr, RNA_boolean_get(), RNA_ParticleSystem, and WM_event_add_notifier().
Referenced by PARTICLE_OT_connect_hair().
static int copy_particle_dupliob_exec | ( | bContext * | C, |
wmOperator * | UNUSEDop | ||
) | [static] |
Definition at line 411 of file particle_object.c.
References BLI_addhead(), CTX_data_pointer_get_type(), PointerRNA::data, ParticleSettings::dupliweights, ListBase::first, ParticleDupliWeight::flag, MEM_dupallocN(), NC_OBJECT, ND_PARTICLE, ParticleDupliWeight::next, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, ParticleSystem::part, PART_DUPLIW_CURRENT, RNA_ParticleSystem, and WM_event_add_notifier().
Referenced by PARTICLE_OT_dupliob_copy().
static void disconnect_hair | ( | Scene * | scene, |
Object * | ob, | ||
ParticleSystem * | psys | ||
) | [static] |
Definition at line 533 of file particle_object.c.
References ParticleEditSettings::brushtype, HairKey::co, ParticleSystemModifierData::dm, ParticleSystem::edit, ELEM, PTCacheEditKey::flag, ParticleSystem::flag, ParticleSettings::from, ParticleData::hair, i, PTCacheEditPoint::keys, mul_m4_v3(), NULL, ParticleSystem::part, PART_HAIR, ParticleSystem::particles, PE_BRUSH_ADD, PE_BRUSH_NONE, PE_BRUSH_PUFF, PE_settings(), PE_update_object(), PEK_USE_WCO, PTCacheEdit::points, psys_free_path_cache(), psys_get_modifier(), PSYS_GLOBAL_HAIR, psys_mat_hair_to_global(), and ParticleSettings::type.
Referenced by disconnect_hair_exec().
static int disconnect_hair_exec | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 582 of file particle_object.c.
References CTX_data_pointer_get_type(), CTX_data_scene(), DAG_id_tag_update(), PointerRNA::data, disconnect_hair(), ED_object_context(), ListBase::first, Object::id, NC_OBJECT, ND_PARTICLE, ParticleSystem::next, NULL, OB_RECALC_DATA, OPERATOR_CANCELLED, OPERATOR_FINISHED, Object::particlesystem, wmOperator::ptr, RNA_boolean_get(), RNA_ParticleSystem, and WM_event_add_notifier().
Referenced by PARTICLE_OT_disconnect_hair().
static int dupliob_move_down_exec | ( | bContext * | C, |
wmOperator * | UNUSEDop | ||
) | [static] |
Definition at line 495 of file particle_object.c.
References BLI_insertlink(), BLI_remlink(), CTX_data_pointer_get_type(), PointerRNA::data, ParticleSettings::dupliweights, ListBase::first, ParticleDupliWeight::flag, NC_OBJECT, ND_PARTICLE, ParticleDupliWeight::next, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, ParticleSystem::part, PART_DUPLIW_CURRENT, RNA_ParticleSystem, and WM_event_add_notifier().
Referenced by PARTICLE_OT_dupliob_move_down().
static int dupliob_move_up_exec | ( | bContext * | C, |
wmOperator * | UNUSEDop | ||
) | [static] |
Definition at line 373 of file particle_object.c.
References BLI_insertlink(), BLI_remlink(), CTX_data_pointer_get_type(), PointerRNA::data, ParticleSettings::dupliweights, ListBase::first, ParticleDupliWeight::flag, NC_OBJECT, ND_PARTICLE, ParticleDupliWeight::next, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, ParticleSystem::part, PART_DUPLIW_CURRENT, ParticleDupliWeight::prev, RNA_ParticleSystem, and WM_event_add_notifier().
Referenced by PARTICLE_OT_dupliob_move_up().
static int new_particle_settings_exec | ( | bContext * | C, |
wmOperator * | UNUSEDop | ||
) | [static] |
Definition at line 146 of file particle_object.c.
References CTX_data_main(), CTX_data_pointer_get_type(), CTX_data_scene(), DAG_id_tag_update(), DAG_scene_sort(), PointerRNA::data, Object::id, ParticleSettings::id, PointerRNA::id, NC_OBJECT, ND_PARTICLE, NULL, OB_RECALC_DATA, OPERATOR_FINISHED, ParticleSystem::part, psys_check_boid_data(), psys_copy_settings(), psys_new_settings(), RNA_ParticleSystem, ID::us, and WM_event_add_notifier().
Referenced by PARTICLE_OT_new().
static int new_particle_target_exec | ( | bContext * | C, |
wmOperator * | UNUSEDop | ||
) | [static] |
Definition at line 199 of file particle_object.c.
References BLI_addtail(), CTX_data_main(), CTX_data_pointer_get_type(), CTX_data_scene(), DAG_id_tag_update(), DAG_scene_sort(), PointerRNA::data, ListBase::first, ParticleTarget::flag, Object::id, PointerRNA::id, MEM_callocN(), NC_OBJECT, ND_PARTICLE, ParticleTarget::next, OB_RECALC_DATA, OPERATOR_CANCELLED, OPERATOR_FINISHED, ParticleTarget::psys, PTARGET_CURRENT, RNA_ParticleSystem, ParticleSystem::targets, and WM_event_add_notifier().
Referenced by PARTICLE_OT_new_target().
void OBJECT_OT_particle_system_add | ( | wmOperatorType * | ot | ) |
Definition at line 84 of file particle_object.c.
References wmOperatorType::description, ED_operator_object_active_editable(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, particle_system_add_exec(), and wmOperatorType::poll.
Referenced by operatortypes_particle().
void OBJECT_OT_particle_system_remove | ( | wmOperatorType * | ot | ) |
Definition at line 123 of file particle_object.c.
References wmOperatorType::description, ED_operator_object_active_editable(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, particle_system_remove_exec(), and wmOperatorType::poll.
Referenced by operatortypes_particle().
void PARTICLE_OT_connect_hair | ( | wmOperatorType * | ot | ) |
Definition at line 747 of file particle_object.c.
References connect_hair_exec(), wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, RNA_def_boolean(), and wmOperatorType::srna.
Referenced by operatortypes_particle().
void PARTICLE_OT_disconnect_hair | ( | wmOperatorType * | ot | ) |
Definition at line 609 of file particle_object.c.
References wmOperatorType::description, disconnect_hair_exec(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, RNA_def_boolean(), and wmOperatorType::srna.
Referenced by operatortypes_particle().
void PARTICLE_OT_dupliob_copy | ( | wmOperatorType * | ot | ) |
Definition at line 436 of file particle_object.c.
References copy_particle_dupliob_exec(), wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, and OPTYPE_UNDO.
Referenced by operatortypes_particle().
void PARTICLE_OT_dupliob_move_down | ( | wmOperatorType * | ot | ) |
Definition at line 519 of file particle_object.c.
References wmOperatorType::description, dupliob_move_down_exec(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, and OPTYPE_UNDO.
Referenced by operatortypes_particle().
void PARTICLE_OT_dupliob_move_up | ( | wmOperatorType * | ot | ) |
Definition at line 397 of file particle_object.c.
References wmOperatorType::description, dupliob_move_up_exec(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, and OPTYPE_UNDO.
Referenced by operatortypes_particle().
void PARTICLE_OT_dupliob_remove | ( | wmOperatorType * | ot | ) |
Definition at line 479 of file particle_object.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, and remove_particle_dupliob_exec().
Referenced by operatortypes_particle().
void PARTICLE_OT_new | ( | wmOperatorType * | ot | ) |
Definition at line 182 of file particle_object.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, new_particle_settings_exec(), OPTYPE_REGISTER, OPTYPE_UNDO, wmOperatorType::poll, and psys_poll().
Referenced by operatortypes_particle().
void PARTICLE_OT_new_target | ( | wmOperatorType * | ot | ) |
Definition at line 231 of file particle_object.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, new_particle_target_exec(), OPTYPE_REGISTER, and OPTYPE_UNDO.
Referenced by operatortypes_particle().
void PARTICLE_OT_target_move_down | ( | wmOperatorType * | ot | ) |
Definition at line 359 of file particle_object.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, and target_move_down_exec().
Referenced by operatortypes_particle().
void PARTICLE_OT_target_move_up | ( | wmOperatorType * | ot | ) |
Definition at line 321 of file particle_object.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, and target_move_up_exec().
Referenced by operatortypes_particle().
void PARTICLE_OT_target_remove | ( | wmOperatorType * | ot | ) |
Definition at line 280 of file particle_object.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, and remove_particle_target_exec().
Referenced by operatortypes_particle().
static int particle_system_add_exec | ( | bContext * | C, |
wmOperator * | UNUSEDop | ||
) | [static] |
Definition at line 68 of file particle_object.c.
References CTX_data_scene(), ED_object_context(), NC_OBJECT, ND_PARTICLE, ND_POINTCACHE, NULL, object_add_particle_system(), OPERATOR_CANCELLED, OPERATOR_FINISHED, and WM_event_add_notifier().
Referenced by OBJECT_OT_particle_system_add().
static int particle_system_remove_exec | ( | bContext * | C, |
wmOperator * | UNUSEDop | ||
) | [static] |
Definition at line 99 of file particle_object.c.
References Scene::basact, CTX_data_scene(), ED_object_context(), Object::mode, NC_OBJECT, NC_SCENE, ND_MODE, ND_PARTICLE, ND_POINTCACHE, NS_MODE_OBJECT, NULL, OB_MODE_PARTICLE_EDIT, Base::object, object_remove_particle_system(), OPERATOR_CANCELLED, OPERATOR_FINISHED, and WM_event_add_notifier().
Referenced by OBJECT_OT_particle_system_remove().
static int psys_poll | ( | bContext * | C | ) | [static] |
Definition at line 140 of file particle_object.c.
References CTX_data_pointer_get_type(), PointerRNA::data, NULL, and RNA_ParticleSystem.
Referenced by PARTICLE_OT_new().
static int remove_particle_dupliob_exec | ( | bContext * | C, |
wmOperator * | UNUSEDop | ||
) | [static] |
Definition at line 450 of file particle_object.c.
References BLI_remlink(), CTX_data_pointer_get_type(), PointerRNA::data, ParticleSettings::dupliweights, ListBase::first, ParticleDupliWeight::flag, ListBase::last, MEM_freeN(), NC_OBJECT, ND_PARTICLE, ParticleDupliWeight::next, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, ParticleSystem::part, PART_DUPLIW_CURRENT, RNA_ParticleSystem, and WM_event_add_notifier().
Referenced by PARTICLE_OT_dupliob_remove().
static int remove_particle_target_exec | ( | bContext * | C, |
wmOperator * | UNUSEDop | ||
) | [static] |
Definition at line 245 of file particle_object.c.
References BLI_remlink(), CTX_data_main(), CTX_data_pointer_get_type(), CTX_data_scene(), DAG_id_tag_update(), DAG_scene_sort(), PointerRNA::data, ListBase::first, ParticleTarget::flag, Object::id, PointerRNA::id, ListBase::last, MEM_freeN(), NC_OBJECT, ND_PARTICLE, ParticleTarget::next, OB_RECALC_DATA, OPERATOR_CANCELLED, OPERATOR_FINISHED, PTARGET_CURRENT, RNA_ParticleSystem, ParticleSystem::targets, and WM_event_add_notifier().
Referenced by PARTICLE_OT_target_remove().
static int target_move_down_exec | ( | bContext * | C, |
wmOperator * | UNUSEDop | ||
) | [static] |
Definition at line 335 of file particle_object.c.
References BLI_insertlink(), BLI_remlink(), CTX_data_pointer_get_type(), DAG_id_tag_update(), PointerRNA::data, ListBase::first, ParticleTarget::flag, Object::id, PointerRNA::id, NC_OBJECT, ND_PARTICLE, ParticleTarget::next, OB_RECALC_DATA, OPERATOR_CANCELLED, OPERATOR_FINISHED, PTARGET_CURRENT, RNA_ParticleSystem, ParticleSystem::targets, and WM_event_add_notifier().
Referenced by PARTICLE_OT_target_move_down().
static int target_move_up_exec | ( | bContext * | C, |
wmOperator * | UNUSEDop | ||
) | [static] |
Definition at line 296 of file particle_object.c.
References BLI_insertlink(), BLI_remlink(), CTX_data_pointer_get_type(), DAG_id_tag_update(), PointerRNA::data, ListBase::first, ParticleTarget::flag, Object::id, PointerRNA::id, NC_OBJECT, ND_PARTICLE, ParticleTarget::next, OB_RECALC_DATA, OPERATOR_CANCELLED, OPERATOR_FINISHED, ParticleTarget::prev, PTARGET_CURRENT, RNA_ParticleSystem, ParticleSystem::targets, and WM_event_add_notifier().
Referenced by PARTICLE_OT_target_move_up().