Blender V4.3
MOD_mask.cc File Reference
#include "MEM_guardedalloc.h"
#include "BLI_utildefines.h"
#include "BLI_array_utils.hh"
#include "BLI_listbase.h"
#include "BLT_translation.hh"
#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.hh"
#include "BKE_customdata.hh"
#include "BKE_deform.hh"
#include "BKE_lib_query.hh"
#include "BKE_mesh.hh"
#include "BKE_modifier.hh"
#include "UI_interface.hh"
#include "UI_resources.hh"
#include "RNA_access.hh"
#include "RNA_prototypes.hh"
#include "DEG_depsgraph_build.hh"
#include "MOD_ui_common.hh"
#include "BLI_array.hh"
#include "BLI_listbase_wrapper.hh"
#include "BLI_vector.hh"

Go to the source code of this file.

Functions

static void init_data (ModifierData *md)
 
static void required_data_mask (ModifierData *, CustomData_MeshMasks *r_cddata_masks)
 
static void foreach_ID_link (ModifierData *md, Object *ob, IDWalkFunc walk, void *user_data)
 
static void update_depsgraph (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 compute_masked_verts (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_faces (const Mesh *mesh, Span< bool > vertex_mask, Vector< int > &r_masked_face_indices, Vector< int > &r_loop_starts, uint *r_faces_masked_num, uint *r_loops_masked_num)
 
static void compute_interpolated_faces (const Mesh *mesh, Span< bool > vertex_mask, uint verts_add_num, uint loops_masked_num, Vector< int > &r_masked_face_indices, Vector< int > &r_loop_starts, uint *r_edges_add_num, uint *r_faces_add_num, uint *r_loops_add_num)
 
static void copy_masked_verts_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_faces_to_new_mesh (const Mesh &src_mesh, Mesh &dst_mesh, Span< int > vertex_map, Span< int > edge_map, Span< int > masked_face_indices, Span< int > new_loop_starts, int faces_masked_num)
 
static void add_interpolated_faces_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_face_indices, Span< int > new_loop_starts, int faces_masked_num, int edges_add_num)
 
static Meshmodify_mesh (ModifierData *md, const ModifierEvalContext *, Mesh *mesh)
 
static bool is_disabled (const Scene *, ModifierData *md, bool)
 
static void panel_draw (const bContext *, Panel *panel)
 
static void panel_register (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_faces_to_new_mesh()

static void add_interpolated_faces_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_face_indices,
Span< int > new_loop_starts,
int faces_masked_num,
int edges_add_num )
static

◆ compute_interpolated_faces()

static void compute_interpolated_faces ( const Mesh * mesh,
Span< bool > vertex_mask,
uint verts_add_num,
uint loops_masked_num,
Vector< int > & r_masked_face_indices,
Vector< int > & r_loop_starts,
uint * r_edges_add_num,
uint * r_faces_add_num,
uint * r_loops_add_num )
static

◆ compute_masked_verts()

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

◆ compute_vertex_mask__armature_mode()

◆ 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 126 of file MOD_mask.cc.

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

Referenced by modify_mesh().

◆ 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 157 of file MOD_mask.cc.

References BLI_assert, and blender::MutableSpan< T >::size().

Referenced by modify_mesh().

◆ 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 182 of file MOD_mask.cc.

References BLI_assert, blender::MutableSpan< T >::size(), and v2.

Referenced by modify_mesh().

◆ computed_masked_faces()

static void computed_masked_faces ( const Mesh * mesh,
Span< bool > vertex_mask,
Vector< int > & r_masked_face_indices,
Vector< int > & r_loop_starts,
uint * r_faces_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_faces_to_new_mesh()

static void copy_masked_faces_to_new_mesh ( const Mesh & src_mesh,
Mesh & dst_mesh,
Span< int > vertex_map,
Span< int > edge_map,
Span< int > masked_face_indices,
Span< int > new_loop_starts,
int faces_masked_num )
static

◆ copy_masked_verts_to_new_mesh()

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

◆ foreach_ID_link()

static void foreach_ID_link ( ModifierData * md,
Object * ob,
IDWalkFunc walk,
void * user_data )
static

Definition at line 70 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

◆ init_data()

static void init_data ( ModifierData * md)
static

◆ is_disabled()

static bool is_disabled ( const Scene * ,
ModifierData * md,
bool  )
static

Definition at line 748 of file MOD_mask.cc.

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

◆ modify_mesh()

◆ panel_draw()

◆ panel_register()

static void panel_register ( ARegionType * region_type)
static

Definition at line 791 of file MOD_mask.cc.

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

◆ required_data_mask()

static void required_data_mask ( ModifierData * ,
CustomData_MeshMasks * r_cddata_masks )
static

Definition at line 65 of file MOD_mask.cc.

References CD_MASK_MDEFORMVERT, and CustomData_MeshMasks::vmask.

◆ update_depsgraph()

Variable Documentation

◆ modifierType_Mask

ModifierTypeInfo modifierType_Mask

Definition at line 796 of file MOD_mask.cc.