Blender  V3.3
Macros | Functions | Variables
MOD_explode.c File Reference
#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 MFaceget_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 MeshcutEdges (ExplodeModifierData *emd, Mesh *mesh)
 
static MeshexplodeMesh (ExplodeModifierData *emd, ParticleSystemModifierData *psmd, const ModifierEvalContext *ctx, Scene *scene, Mesh *to_explode)
 
static ParticleSystemModifierDatafindPrecedingParticlesystem (Object *ob, ModifierData *emd)
 
static MeshmodifyMesh (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
 

Macro Definition Documentation

◆ GET_ES

#define GET_ES (   v1,
  v2 
)    edgecut_get(eh, v1, v2)

Definition at line 238 of file MOD_explode.c.

◆ INT_UV

#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.

◆ SET_VERTS

#define SET_VERTS (   a,
  b,
  c,
 
)
Value:
{ \
v[0] = mf->v##a; \
uv[0] = a - 1; \
v[1] = mf->v##b; \
uv[1] = b - 1; \
v[2] = mf->v##c; \
uv[2] = c - 1; \
v[3] = mf->v##d; \
uv[3] = d - 1; \
} \
(void)0
SyclQueue void void size_t num_bytes void
static unsigned c
Definition: RandGen.cpp:83
static unsigned a[3]
Definition: RandGen.cpp:78
static const pxr::TfToken b("b", pxr::TfToken::Immortal)

Definition at line 225 of file MOD_explode.c.

Function Documentation

◆ blendRead()

static void blendRead ( BlendDataReader UNUSEDreader,
ModifierData md 
)
static

Definition at line 1216 of file MOD_explode.c.

References ExplodeModifierData::facepa, and NULL.

◆ copyData()

static void copyData ( const ModifierData md,
ModifierData target,
const int  flag 
)
static

Definition at line 64 of file MOD_explode.c.

References BKE_modifier_copydata_generic(), ExplodeModifierData::facepa, and NULL.

◆ createFacepa()

static void createFacepa ( ExplodeModifierData emd,
ParticleSystemModifierData psmd,
Mesh mesh 
)
static

◆ cutEdges()

static Mesh* cutEdges ( ExplodeModifierData emd,
Mesh mesh 
)
static

◆ dependsOnTime()

static bool dependsOnTime ( struct Scene UNUSEDscene,
ModifierData UNUSEDmd 
)
static

Definition at line 75 of file MOD_explode.c.

◆ edgecut_get()

static int edgecut_get ( EdgeHash edgehash,
uint  v1,
uint  v2 
)
static

Definition at line 208 of file MOD_explode.c.

References BLI_edgehash_lookup(), POINTER_AS_INT, v1, and v2.

Referenced by explodeMesh().

◆ explodeMesh()

static Mesh* explodeMesh ( ExplodeModifierData emd,
ParticleSystemModifierData psmd,
const ModifierEvalContext ctx,
Scene scene,
Mesh to_explode 
)
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().

◆ findPrecedingParticlesystem()

static ParticleSystemModifierData* findPrecedingParticlesystem ( Object ob,
ModifierData emd 
)
static

◆ freeData()

static void freeData ( ModifierData md)
static

Definition at line 58 of file MOD_explode.c.

References ExplodeModifierData::facepa, and MEM_SAFE_FREE.

◆ get_dface()

static MFace* get_dface ( Mesh mesh,
Mesh split,
int  cur,
int  i,
MFace mf 
)
static

◆ initData()

static void initData ( ModifierData md)
static

◆ modifyMesh()

static Mesh* modifyMesh ( ModifierData md,
const ModifierEvalContext ctx,
Mesh mesh 
)
static

◆ panel_draw()

static void panel_draw ( const bContext UNUSEDC,
Panel panel 
)
static

◆ panelRegister()

static void panelRegister ( ARegionType region_type)
static

Definition at line 1211 of file MOD_explode.c.

References eModifierType_Explode, modifier_panel_register(), and panel_draw().

◆ remap_faces_15()

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

◆ remap_faces_19_21_22()

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

◆ remap_faces_23()

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

◆ remap_faces_3_6_9_12()

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

◆ remap_faces_5_10()

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

◆ remap_faces_7_11_13_14()

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

◆ remap_uvs_15()

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

◆ remap_uvs_19_21_22()

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

◆ remap_uvs_23()

static void remap_uvs_23 ( Mesh mesh,
Mesh split,
int  layers_num,
int  i,
int  cur,
int  c0,
int  c1,
int  c2 
)
static

◆ remap_uvs_3_6_9_12()

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

◆ remap_uvs_5_10()

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

◆ remap_uvs_7_11_13_14()

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

◆ requiredDataMask()

static void requiredDataMask ( Object UNUSEDob,
ModifierData md,
CustomData_MeshMasks r_cddata_masks 
)
static

Variable Documentation

◆ add_faces

const short add_faces[24]
static
Initial value:
= {
0, 0, 0, 2, 0, 1, 2, 2, 0, 2, 1, 2, 2, 2, 2, 3, 0, 0, 0, 1, 0, 1, 1, 2,
}

Definition at line 213 of file MOD_explode.c.

Referenced by cutEdges().

◆ modifierType_Explode

ModifierTypeInfo modifierType_Explode

Definition at line 1223 of file MOD_explode.c.