Blender
V3.3
|
#include "BLI_utildefines.h"
#include "BLI_edgehash.h"
#include "BLI_kdtree.h"
#include "BLI_math.h"
#include "BLI_rand.h"
#include "BLT_translation.h"
#include "DNA_defaults.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "BKE_context.h"
#include "BKE_deform.h"
#include "BKE_lattice.h"
#include "BKE_lib_id.h"
#include "BKE_mesh.h"
#include "BKE_mesh_legacy_convert.h"
#include "BKE_modifier.h"
#include "BKE_particle.h"
#include "BKE_scene.h"
#include "BKE_screen.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "BLO_read_write.h"
#include "RNA_access.h"
#include "RNA_prototypes.h"
#include "DEG_depsgraph_query.h"
#include "MEM_guardedalloc.h"
#include "MOD_modifiertypes.h"
#include "MOD_ui_common.h"
Go to the source code of this file.
Macros | |
#define | SET_VERTS(a, b, c, d) |
#define | GET_ES(v1, v2) edgecut_get(eh, v1, v2) |
#define | INT_UV(uvf, c0, c1) mid_v2_v2v2(uvf, mf->uv[c0], mf->uv[c1]) |
Functions | |
static void | initData (ModifierData *md) |
static void | freeData (ModifierData *md) |
static void | copyData (const ModifierData *md, ModifierData *target, const int flag) |
static bool | dependsOnTime (struct Scene *UNUSED(scene), ModifierData *UNUSED(md)) |
static void | requiredDataMask (Object *UNUSED(ob), ModifierData *md, CustomData_MeshMasks *r_cddata_masks) |
static void | createFacepa (ExplodeModifierData *emd, ParticleSystemModifierData *psmd, Mesh *mesh) |
static int | edgecut_get (EdgeHash *edgehash, uint v1, uint v2) |
static MFace * | get_dface (Mesh *mesh, Mesh *split, int cur, int i, MFace *mf) |
static void | remap_faces_3_6_9_12 (Mesh *mesh, Mesh *split, MFace *mf, int *facepa, const int *vertpa, int i, EdgeHash *eh, int cur, int v1, int v2, int v3, int v4) |
static void | remap_uvs_3_6_9_12 (Mesh *mesh, Mesh *split, int layers_num, int i, int cur, int c0, int c1, int c2, int c3) |
static void | remap_faces_5_10 (Mesh *mesh, Mesh *split, MFace *mf, int *facepa, const int *vertpa, int i, EdgeHash *eh, int cur, int v1, int v2, int v3, int v4) |
static void | remap_uvs_5_10 (Mesh *mesh, Mesh *split, int layers_num, int i, int cur, int c0, int c1, int c2, int c3) |
static void | remap_faces_15 (Mesh *mesh, Mesh *split, MFace *mf, int *facepa, const int *vertpa, int i, EdgeHash *eh, int cur, int v1, int v2, int v3, int v4) |
static void | remap_uvs_15 (Mesh *mesh, Mesh *split, int layers_num, int i, int cur, int c0, int c1, int c2, int c3) |
static void | remap_faces_7_11_13_14 (Mesh *mesh, Mesh *split, MFace *mf, int *facepa, const int *vertpa, int i, EdgeHash *eh, int cur, int v1, int v2, int v3, int v4) |
static void | remap_uvs_7_11_13_14 (Mesh *mesh, Mesh *split, int layers_num, int i, int cur, int c0, int c1, int c2, int c3) |
static void | remap_faces_19_21_22 (Mesh *mesh, Mesh *split, MFace *mf, int *facepa, const int *vertpa, int i, EdgeHash *eh, int cur, int v1, int v2, int v3) |
static void | remap_uvs_19_21_22 (Mesh *mesh, Mesh *split, int layers_num, int i, int cur, int c0, int c1, int c2) |
static void | remap_faces_23 (Mesh *mesh, Mesh *split, MFace *mf, int *facepa, const int *vertpa, int i, EdgeHash *eh, int cur, int v1, int v2, int v3) |
static void | remap_uvs_23 (Mesh *mesh, Mesh *split, int layers_num, int i, int cur, int c0, int c1, int c2) |
static Mesh * | cutEdges (ExplodeModifierData *emd, Mesh *mesh) |
static Mesh * | explodeMesh (ExplodeModifierData *emd, ParticleSystemModifierData *psmd, const ModifierEvalContext *ctx, Scene *scene, Mesh *to_explode) |
static ParticleSystemModifierData * | findPrecedingParticlesystem (Object *ob, ModifierData *emd) |
static Mesh * | modifyMesh (ModifierData *md, const ModifierEvalContext *ctx, Mesh *mesh) |
static void | panel_draw (const bContext *UNUSED(C), Panel *panel) |
static void | panelRegister (ARegionType *region_type) |
static void | blendRead (BlendDataReader *UNUSED(reader), ModifierData *md) |
Variables | |
static const short | add_faces [24] |
ModifierTypeInfo | modifierType_Explode |
Definition at line 238 of file MOD_explode.c.
#define INT_UV | ( | uvf, | |
c0, | |||
c1 | |||
) | mid_v2_v2v2(uvf, mf->uv[c0], mf->uv[c1]) |
Definition at line 239 of file MOD_explode.c.
#define SET_VERTS | ( | a, | |
b, | |||
c, | |||
d | |||
) |
|
static |
Definition at line 1216 of file MOD_explode.c.
References ExplodeModifierData::facepa, and NULL.
|
static |
Definition at line 64 of file MOD_explode.c.
References BKE_modifier_copydata_generic(), ExplodeModifierData::facepa, and NULL.
|
static |
Definition at line 90 of file MOD_explode.c.
References add_v3_v3(), add_v3_v3v3(), BKE_defvert_find_weight(), BLI_rng_free(), BLI_rng_get_float(), BLI_rng_new_srandom(), CD_MDEFORMVERT, center, MVert::co, CustomData_get_layer(), eExplodeFlag_INVERT_VGROUP, ExplodeModifierData::facepa, ExplodeModifierData::flag, ParticleData::foffset, ParticleSettings::from, ParticleData::fuv, MEM_calloc_arrayN, MEM_freeN, mesh, Mesh::mface, mul_v3_fl(), Mesh::mvert, NULL, ParticleData::num, ParticleData::num_dmcache, ParticleSystem::part, ParticleSystem::particles, ExplodeModifierData::protect, ParticleSystemModifierData::psys, psys_particle_on_emitter(), ParticleSystem::seed, Mesh::totface, ParticleSystem::totpart, Mesh::totvert, tree, v1, MFace::v1, v2, MFace::v2, MFace::v3, MFace::v4, Mesh::vdata, and ExplodeModifierData::vgroup.
Referenced by modifyMesh().
|
static |
Definition at line 638 of file MOD_explode.c.
References add_faces, BKE_mesh_calc_edges_tessface(), BKE_mesh_convert_mfaces_to_mpolys(), BKE_mesh_mface_index_validate(), BKE_mesh_new_nomain_from_template(), BLI_edgehash_free(), BLI_edgehash_new(), BLI_edgehash_reinsert(), BLI_edgehashIterator_free(), BLI_edgehashIterator_getKey(), BLI_edgehashIterator_getValue(), BLI_edgehashIterator_isDone(), BLI_edgehashIterator_new(), BLI_edgehashIterator_setValue(), BLI_edgehashIterator_step(), CD_MTFACE, MVert::co, CustomData_copy_data(), CustomData_number_of_layers(), dest, ExplodeModifierData::facepa, Mesh::fdata, MFace::flag, get_dface(), ME_FACE_SEL, MEM_calloc_arrayN, MEM_freeN, mesh, Mesh::mface, mid_v3_v3v3(), Mesh::mvert, NULL, POINTER_AS_INT, POINTER_FROM_INT, remap_faces_15(), remap_faces_19_21_22(), remap_faces_23(), remap_faces_3_6_9_12(), remap_faces_5_10(), remap_faces_7_11_13_14(), remap_uvs_15(), remap_uvs_19_21_22(), remap_uvs_23(), remap_uvs_3_6_9_12(), remap_uvs_5_10(), remap_uvs_7_11_13_14(), SET_VERTS, Mesh::totface, Mesh::totvert, v, v1, MFace::v1, v2, MFace::v2, MFace::v3, MFace::v4, and Mesh::vdata.
Referenced by modifyMesh().
|
static |
Definition at line 75 of file MOD_explode.c.
Definition at line 208 of file MOD_explode.c.
References BLI_edgehash_lookup(), POINTER_AS_INT, v1, and v2.
Referenced by explodeMesh().
|
static |
Definition at line 893 of file MOD_explode.c.
References add_v3_v3(), ParticleData::alive, BKE_mesh_calc_edges_tessface(), BKE_mesh_convert_mfaces_to_mpolys(), BKE_mesh_mface_index_validate(), BKE_mesh_new_nomain_from_template(), BKE_scene_ctime_get(), BLI_edgehash_free(), BLI_edgehash_new(), BLI_edgehash_reinsert(), BLI_edgehashIterator_free(), BLI_edgehashIterator_getKey(), BLI_edgehashIterator_getValue(), BLI_edgehashIterator_isDone(), BLI_edgehashIterator_new(), BLI_edgehashIterator_setValue(), BLI_edgehashIterator_step(), CD_MTFACE, CLAMP, MVert::co, ParticleKey::co, CustomData_copy_data(), CustomData_get_layer_named(), ModifierEvalContext::depsgraph, ParticleSimulationData::depsgraph, dest, edgecut_get(), eExplodeFlag_Alive, eExplodeFlag_Dead, eExplodeFlag_PaSize, eExplodeFlag_Unborn, ExplodeModifierData::facepa, Mesh::fdata, ExplodeModifierData::flag, invert_m4_m4(), ParticleData::lifetime, mesh, Mesh::mface, mul_m4_v3(), mul_qt_v3(), mul_v3_fl(), Mesh::mvert, NULL, ParticleSimulationData::ob, ModifierEvalContext::object, Object::obmat, PARS_ALIVE, PARS_DEAD, PARS_UNBORN, ParticleSystem::particles, POINTER_AS_INT, POINTER_FROM_INT, ParticleSimulationData::psmd, ParticleSimulationData::psys, ParticleSystemModifierData::psys, psys_get_birth_coords(), psys_get_particle_state(), psys_sim_data_free(), psys_sim_data_init(), rot, ParticleKey::rot, ParticleSimulationData::scene, scene, ParticleData::size, state, sub_qt_qtqt(), sub_v3_v3(), time, ParticleData::time, Mesh::totface, ParticleSystem::totpart, Mesh::totvert, MTFace::uv, ExplodeModifierData::uvname, v, MFace::v1, MFace::v2, MFace::v3, MFace::v4, and Mesh::vdata.
Referenced by modifyMesh().
|
static |
Definition at line 1111 of file MOD_explode.c.
References eModifierType_ParticleSystem, ListBase::first, Object::modifiers, ModifierData::next, NULL, and ModifierData::type.
Referenced by modifyMesh().
|
static |
Definition at line 58 of file MOD_explode.c.
References ExplodeModifierData::facepa, and MEM_SAFE_FREE.
Definition at line 217 of file MOD_explode.c.
References CustomData_copy_data(), Mesh::fdata, mesh, and blender::io::alembic::split().
Referenced by cutEdges(), remap_faces_15(), remap_faces_19_21_22(), remap_faces_23(), remap_faces_3_6_9_12(), remap_faces_5_10(), and remap_faces_7_11_13_14().
|
static |
Definition at line 50 of file MOD_explode.c.
References BLI_assert, DNA_struct_default_get, MEMCMP_STRUCT_AFTER_IS_ZERO, and MEMCPY_STRUCT_AFTER.
|
static |
Definition at line 1123 of file MOD_explode.c.
References BKE_id_free(), BKE_mesh_tessface_ensure(), createFacepa(), cutEdges(), DEG_get_evaluated_scene(), ModifierEvalContext::depsgraph, eExplodeFlag_CalcFaces, eExplodeFlag_EdgeCut, eParticleSystemFlag_Pars, explodeMesh(), ExplodeModifierData::facepa, findPrecedingParticlesystem(), ParticleSystemModifierData::flag, ExplodeModifierData::flag, MEM_allocN_len, MEM_freeN, mesh, ParticleSystemModifierData::mesh_final, NULL, ModifierEvalContext::object, ParticleSystem::part, ParticleSystem::particles, ParticleSystemModifierData::psys, scene, Mesh::totface, and ParticleSystem::totpart.
Definition at line 1173 of file MOD_explode.c.
References col, IFACE_, Panel::layout, modifier_panel_end(), modifier_panel_get_property_pointers(), modifier_vgroup_ui(), NULL, ptr, RNA_pointer_get(), RNA_string_length(), UI_ITEM_R_FORCE_BLANK_DECORATE, UI_ITEM_R_TOGGLE, uiItemO(), uiItemPointerR(), uiItemR(), uiLayoutColumn(), uiLayoutRow(), uiLayoutRowWithHeading(), uiLayoutSetActive(), and uiLayoutSetPropSep().
Referenced by panelRegister().
|
static |
Definition at line 1211 of file MOD_explode.c.
References eModifierType_Explode, modifier_panel_register(), and panel_draw().
|
static |
Definition at line 365 of file MOD_explode.c.
References MFace::flag, get_dface(), GET_ES, ME_FACE_SEL, mesh, blender::io::alembic::split(), v1, MFace::v1, v2, MFace::v2, MFace::v3, and MFace::v4.
Referenced by cutEdges().
|
static |
Definition at line 518 of file MOD_explode.c.
References MFace::flag, get_dface(), GET_ES, ME_FACE_SEL, mesh, blender::io::alembic::split(), v1, MFace::v1, v2, MFace::v2, MFace::v3, and MFace::v4.
Referenced by cutEdges().
|
static |
Definition at line 572 of file MOD_explode.c.
References MFace::flag, get_dface(), GET_ES, ME_FACE_SEL, mesh, blender::io::alembic::split(), v1, MFace::v1, v2, MFace::v2, MFace::v3, and MFace::v4.
Referenced by cutEdges().
|
static |
Definition at line 241 of file MOD_explode.c.
References MFace::flag, get_dface(), GET_ES, ME_FACE_SEL, mesh, blender::io::alembic::split(), v1, MFace::v1, v2, MFace::v2, MFace::v3, and MFace::v4.
Referenced by cutEdges().
|
static |
Definition at line 309 of file MOD_explode.c.
References MFace::flag, get_dface(), GET_ES, ME_FACE_SEL, mesh, blender::io::alembic::split(), v1, MFace::v1, v2, MFace::v2, MFace::v3, and MFace::v4.
Referenced by cutEdges().
|
static |
Definition at line 449 of file MOD_explode.c.
References MFace::flag, get_dface(), GET_ES, ME_FACE_SEL, mesh, blender::io::alembic::split(), v1, MFace::v1, v2, MFace::v2, MFace::v3, and MFace::v4.
Referenced by cutEdges().
|
static |
Definition at line 412 of file MOD_explode.c.
References CD_MTFACE, copy_v2_v2(), CustomData_get_layer_n(), Mesh::fdata, INT_UV, l, mesh, blender::io::alembic::split(), and MTFace::uv.
Referenced by cutEdges().
|
static |
Definition at line 548 of file MOD_explode.c.
References CD_MTFACE, copy_v2_v2(), CustomData_get_layer_n(), Mesh::fdata, INT_UV, l, mesh, blender::io::alembic::split(), and MTFace::uv.
Referenced by cutEdges().
|
static |
Definition at line 610 of file MOD_explode.c.
References CD_MTFACE, copy_v2_v2(), CustomData_get_layer_n(), Mesh::fdata, INT_UV, l, mesh, blender::io::alembic::split(), and MTFace::uv.
Referenced by cutEdges().
|
static |
Definition at line 280 of file MOD_explode.c.
References CD_MTFACE, copy_v2_v2(), CustomData_get_layer_n(), Mesh::fdata, INT_UV, l, mesh, blender::io::alembic::split(), and MTFace::uv.
Referenced by cutEdges().
|
static |
Definition at line 340 of file MOD_explode.c.
References CD_MTFACE, copy_v2_v2(), CustomData_get_layer_n(), Mesh::fdata, INT_UV, l, mesh, blender::io::alembic::split(), and MTFace::uv.
Referenced by cutEdges().
|
static |
Definition at line 488 of file MOD_explode.c.
References CD_MTFACE, copy_v2_v2(), CustomData_get_layer_n(), Mesh::fdata, INT_UV, l, mesh, blender::io::alembic::split(), and MTFace::uv.
Referenced by cutEdges().
|
static |
Definition at line 79 of file MOD_explode.c.
References CD_MASK_MDEFORMVERT, ExplodeModifierData::vgroup, and CustomData_MeshMasks::vmask.
|
static |
Definition at line 213 of file MOD_explode.c.
Referenced by cutEdges().
ModifierTypeInfo modifierType_Explode |
Definition at line 1223 of file MOD_explode.c.