Blender  V3.3
Functions | Variables
MOD_mask.cc File Reference
#include "MEM_guardedalloc.h"
#include "BLI_utildefines.h"
#include "BLI_ghash.h"
#include "BLI_listbase.h"
#include "BLI_math.h"
#include "BLT_translation.h"
#include "DNA_armature_types.h"
#include "DNA_defaults.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_modifier_types.h"
#include "DNA_object_types.h"
#include "DNA_screen_types.h"
#include "BKE_action.h"
#include "BKE_context.h"
#include "BKE_customdata.h"
#include "BKE_deform.h"
#include "BKE_lib_query.h"
#include "BKE_mesh.h"
#include "BKE_modifier.h"
#include "BKE_screen.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "RNA_access.h"
#include "RNA_prototypes.h"
#include "DEG_depsgraph_build.h"
#include "DEG_depsgraph_query.h"
#include "MOD_modifiertypes.h"
#include "MOD_ui_common.h"
#include "BLI_array.hh"
#include "BLI_listbase_wrapper.hh"
#include "BLI_vector.hh"

Go to the source code of this file.

Functions

static void initData (ModifierData *md)
 
static void requiredDataMask (Object *UNUSED(ob), ModifierData *UNUSED(md), CustomData_MeshMasks *r_cddata_masks)
 
static void foreachIDLink (ModifierData *md, Object *ob, IDWalkFunc walk, void *userData)
 
static void updateDepsgraph (ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
 
static void compute_vertex_mask__armature_mode (const MDeformVert *dvert, Mesh *mesh, Object *armature_ob, float threshold, MutableSpan< bool > r_vertex_mask)
 
static void compute_vertex_mask__vertex_group_mode (const MDeformVert *dvert, int defgrp_index, float threshold, MutableSpan< bool > r_vertex_mask)
 
static void invert_boolean_array (MutableSpan< bool > array)
 
static void compute_masked_vertices (Span< bool > vertex_mask, MutableSpan< int > r_vertex_map, uint *r_verts_masked_num)
 
static void computed_masked_edges (const Mesh *mesh, Span< bool > vertex_mask, MutableSpan< int > r_edge_map, uint *r_edges_masked_num)
 
static void computed_masked_edges_smooth (const Mesh *mesh, Span< bool > vertex_mask, MutableSpan< int > r_edge_map, uint *r_edges_masked_num, uint *r_verts_add_num)
 
static void computed_masked_polygons (const Mesh *mesh, Span< bool > vertex_mask, Vector< int > &r_masked_poly_indices, Vector< int > &r_loop_starts, uint *r_polys_masked_num, uint *r_loops_masked_num)
 
static void compute_interpolated_polygons (const Mesh *mesh, Span< bool > vertex_mask, uint verts_add_num, uint loops_masked_num, Vector< int > &r_masked_poly_indices, Vector< int > &r_loop_starts, uint *r_edges_add_num, uint *r_polys_add_num, uint *r_loops_add_num)
 
static void copy_masked_vertices_to_new_mesh (const Mesh &src_mesh, Mesh &dst_mesh, Span< int > vertex_map)
 
static float get_interp_factor_from_vgroup (const MDeformVert *dvert, int defgrp_index, float threshold, uint v1, uint v2)
 
static void add_interp_verts_copy_edges_to_new_mesh (const Mesh &src_mesh, Mesh &dst_mesh, Span< bool > vertex_mask, Span< int > vertex_map, const MDeformVert *dvert, int defgrp_index, float threshold, uint edges_masked_num, uint verts_add_num, MutableSpan< int > r_edge_map)
 
static void copy_masked_edges_to_new_mesh (const Mesh &src_mesh, Mesh &dst_mesh, Span< int > vertex_map, Span< int > edge_map)
 
static void copy_masked_polys_to_new_mesh (const Mesh &src_mesh, Mesh &dst_mesh, Span< int > vertex_map, Span< int > edge_map, Span< int > masked_poly_indices, Span< int > new_loop_starts, int polys_masked_num)
 
static void add_interpolated_polys_to_new_mesh (const Mesh &src_mesh, Mesh &dst_mesh, Span< bool > vertex_mask, Span< int > vertex_map, Span< int > edge_map, const MDeformVert *dvert, int defgrp_index, float threshold, Span< int > masked_poly_indices, Span< int > new_loop_starts, int polys_masked_num, int edges_add_num)
 
static MeshmodifyMesh (ModifierData *md, const ModifierEvalContext *UNUSED(ctx), Mesh *mesh)
 
static bool isDisabled (const struct Scene *UNUSED(scene), ModifierData *md, bool UNUSED(useRenderParams))
 
static void panel_draw (const bContext *UNUSED(C), Panel *panel)
 
static void panelRegister (ARegionType *region_type)
 

Variables

ModifierTypeInfo modifierType_Mask
 

Function Documentation

◆ add_interp_verts_copy_edges_to_new_mesh()

static void add_interp_verts_copy_edges_to_new_mesh ( const Mesh src_mesh,
Mesh dst_mesh,
Span< bool vertex_mask,
Span< int >  vertex_map,
const MDeformVert dvert,
int  defgrp_index,
float  threshold,
uint  edges_masked_num,
uint  verts_add_num,
MutableSpan< int >  r_edge_map 
)
static

◆ add_interpolated_polys_to_new_mesh()

static void add_interpolated_polys_to_new_mesh ( const Mesh src_mesh,
Mesh dst_mesh,
Span< bool vertex_mask,
Span< int >  vertex_map,
Span< int >  edge_map,
const MDeformVert dvert,
int  defgrp_index,
float  threshold,
Span< int >  masked_poly_indices,
Span< int >  new_loop_starts,
int  polys_masked_num,
int  edges_add_num 
)
static

◆ compute_interpolated_polygons()

static void compute_interpolated_polygons ( const Mesh mesh,
Span< bool vertex_mask,
uint  verts_add_num,
uint  loops_masked_num,
Vector< int > &  r_masked_poly_indices,
Vector< int > &  r_loop_starts,
uint r_edges_add_num,
uint r_polys_add_num,
uint r_loops_add_num 
)
static

◆ compute_masked_vertices()

static void compute_masked_vertices ( Span< bool vertex_mask,
MutableSpan< int >  r_vertex_map,
uint r_verts_masked_num 
)
static

◆ compute_vertex_mask__armature_mode()

static void compute_vertex_mask__armature_mode ( const MDeformVert dvert,
Mesh mesh,
Object armature_ob,
float  threshold,
MutableSpan< bool r_vertex_mask 
)
static

◆ compute_vertex_mask__vertex_group_mode()

static void compute_vertex_mask__vertex_group_mode ( const MDeformVert dvert,
int  defgrp_index,
float  threshold,
MutableSpan< bool r_vertex_mask 
)
static

Definition at line 128 of file MOD_mask.cc.

References BKE_defvert_find_weight(), blender::MutableSpan< T >::index_range(), and threshold.

Referenced by modifyMesh().

◆ computed_masked_edges()

static void computed_masked_edges ( const Mesh mesh,
Span< bool vertex_mask,
MutableSpan< int >  r_edge_map,
uint r_edges_masked_num 
)
static

Definition at line 166 of file MOD_mask.cc.

References BLI_assert, Mesh::medge, mesh, blender::MutableSpan< T >::size(), and Mesh::totedge.

Referenced by modifyMesh().

◆ computed_masked_edges_smooth()

static void computed_masked_edges_smooth ( const Mesh mesh,
Span< bool vertex_mask,
MutableSpan< int >  r_edge_map,
uint r_edges_masked_num,
uint r_verts_add_num 
)
static

Definition at line 190 of file MOD_mask.cc.

References BLI_assert, Mesh::medge, mesh, blender::MutableSpan< T >::size(), Mesh::totedge, v1, and v2.

Referenced by modifyMesh().

◆ computed_masked_polygons()

static void computed_masked_polygons ( const Mesh mesh,
Span< bool vertex_mask,
Vector< int > &  r_masked_poly_indices,
Vector< int > &  r_loop_starts,
uint r_polys_masked_num,
uint r_loops_masked_num 
)
static

◆ copy_masked_edges_to_new_mesh()

static void copy_masked_edges_to_new_mesh ( const Mesh src_mesh,
Mesh dst_mesh,
Span< int >  vertex_map,
Span< int >  edge_map 
)
static

◆ copy_masked_polys_to_new_mesh()

static void copy_masked_polys_to_new_mesh ( const Mesh src_mesh,
Mesh dst_mesh,
Span< int >  vertex_map,
Span< int >  edge_map,
Span< int >  masked_poly_indices,
Span< int >  new_loop_starts,
int  polys_masked_num 
)
static

◆ copy_masked_vertices_to_new_mesh()

static void copy_masked_vertices_to_new_mesh ( const Mesh src_mesh,
Mesh dst_mesh,
Span< int >  vertex_map 
)
static

◆ foreachIDLink()

static void foreachIDLink ( ModifierData md,
Object ob,
IDWalkFunc  walk,
void userData 
)
static

Definition at line 74 of file MOD_mask.cc.

References IDWALK_CB_NOP, and MaskModifierData::ob_arm.

◆ get_interp_factor_from_vgroup()

static float get_interp_factor_from_vgroup ( const MDeformVert dvert,
int  defgrp_index,
float  threshold,
uint  v1,
uint  v2 
)
static

◆ initData()

static void initData ( ModifierData md)
static

◆ invert_boolean_array()

static void invert_boolean_array ( MutableSpan< bool array)
static

Definition at line 139 of file MOD_mask.cc.

Referenced by modifyMesh().

◆ isDisabled()

static bool isDisabled ( const struct Scene UNUSEDscene,
ModifierData md,
bool   UNUSEDuseRenderParams 
)
static

Definition at line 756 of file MOD_mask.cc.

References MaskModifierData::ob_arm, OB_ARMATURE, and Object::type.

◆ modifyMesh()

static Mesh* modifyMesh ( ModifierData md,
const ModifierEvalContext UNUSEDctx,
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 801 of file MOD_mask.cc.

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

◆ requiredDataMask()

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

Definition at line 67 of file MOD_mask.cc.

References CD_MASK_MDEFORMVERT, and CustomData_MeshMasks::vmask.

◆ updateDepsgraph()

static void updateDepsgraph ( ModifierData md,
const ModifierUpdateDepsgraphContext ctx 
)
static

Variable Documentation

◆ modifierType_Mask

ModifierTypeInfo modifierType_Mask

Definition at line 806 of file MOD_mask.cc.