Blender V4.3
bmo_dupe.cc File Reference
#include "MEM_guardedalloc.h"
#include "BLI_alloca.h"
#include "BLI_math_matrix.h"
#include "BLI_math_rotation.h"
#include "BLI_math_vector.h"
#include "bmesh.hh"
#include "intern/bmesh_operators_private.hh"

Go to the source code of this file.

Macros

#define DUPE_INPUT   1 /* input from operator */
 
#define DUPE_NEW   2
 
#define DUPE_DONE   4
 
#define SPLIT_INPUT   1
 
#define DEL_INPUT   1
 

Functions

static BMVertbmo_vert_copy (BMOperator *op, BMOpSlot *slot_vertmap_out, BMesh *bm_dst, const std::optional< BMCustomDataCopyMap > &cd_vert_map, BMVert *v_src, GHash *vhash)
 
static BMEdgebmo_edge_copy (BMOperator *op, BMOpSlot *slot_edgemap_out, BMOpSlot *slot_boundarymap_out, BMesh *bm_dst, BMesh *bm_src, const std::optional< BMCustomDataCopyMap > &cd_edge_map, BMEdge *e_src, GHash *vhash, GHash *ehash, const bool use_edge_flip_from_face)
 
static BMFacebmo_face_copy (BMOperator *op, BMOpSlot *slot_facemap_out, BMesh *bm_dst, const std::optional< BMCustomDataCopyMap > &cd_face_map, const std::optional< BMCustomDataCopyMap > &cd_loop_map, BMFace *f_src, GHash *vhash, GHash *ehash)
 
static void bmo_mesh_copy (BMOperator *op, BMesh *bm_dst, BMesh *bm_src)
 
void bmo_duplicate_exec (BMesh *bm, BMOperator *op)
 
void bmo_split_exec (BMesh *bm, BMOperator *op)
 
void bmo_delete_exec (BMesh *bm, BMOperator *op)
 
void bmo_spin_exec (BMesh *bm, BMOperator *op)
 

Detailed Description

Duplicate, Split, Split operators.

Definition in file bmo_dupe.cc.

Macro Definition Documentation

◆ DEL_INPUT

#define DEL_INPUT   1

Referenced by bmo_delete_exec().

◆ DUPE_DONE

#define DUPE_DONE   4

Definition at line 25 of file bmo_dupe.cc.

Referenced by bmo_mesh_copy().

◆ DUPE_INPUT

#define DUPE_INPUT   1 /* input from operator */

Definition at line 23 of file bmo_dupe.cc.

Referenced by bmo_duplicate_exec(), bmo_edge_copy(), and bmo_mesh_copy().

◆ DUPE_NEW

#define DUPE_NEW   2

Definition at line 24 of file bmo_dupe.cc.

Referenced by bmo_duplicate_exec(), bmo_edge_copy(), bmo_face_copy(), and bmo_vert_copy().

◆ SPLIT_INPUT

#define SPLIT_INPUT   1

Referenced by bmo_split_exec().

Function Documentation

◆ bmo_delete_exec()

◆ bmo_duplicate_exec()

void bmo_duplicate_exec ( BMesh * bm,
BMOperator * op )

Duplicate Operator

Duplicates verts, edges and faces of a mesh.

INPUT SLOTS:

BMOP_DUPE_VINPUT: Buffer containing pointers to mesh vertices to be duplicated BMOP_DUPE_EINPUT: Buffer containing pointers to mesh edges to be duplicated BMOP_DUPE_FINPUT: Buffer containing pointers to mesh faces to be duplicated

OUTPUT SLOTS:

BMOP_DUPE_VORIGINAL: Buffer containing pointers to the original mesh vertices BMOP_DUPE_EORIGINAL: Buffer containing pointers to the original mesh edges BMOP_DUPE_FORIGINAL: Buffer containing pointers to the original mesh faces BMOP_DUPE_VNEW: Buffer containing pointers to the new mesh vertices BMOP_DUPE_ENEW: Buffer containing pointers to the new mesh edges BMOP_DUPE_FNEW: Buffer containing pointers to the new mesh faces

Definition at line 373 of file bmo_dupe.cc.

References bm, BM_ALL_NOLOOP, bmo_mesh_copy(), BMO_slot_buffer_flag_enable(), BMO_slot_buffer_from_enabled_flag(), BMO_slot_copy, BMO_slot_ptr_get(), DUPE_INPUT, DUPE_NEW, BMOperator::slots_in, and BMOperator::slots_out.

◆ bmo_edge_copy()

static BMEdge * bmo_edge_copy ( BMOperator * op,
BMOpSlot * slot_edgemap_out,
BMOpSlot * slot_boundarymap_out,
BMesh * bm_dst,
BMesh * bm_src,
const std::optional< BMCustomDataCopyMap > & cd_edge_map,
BMEdge * e_src,
GHash * vhash,
GHash * ehash,
const bool use_edge_flip_from_face )
static

◆ bmo_face_copy()

static BMFace * bmo_face_copy ( BMOperator * op,
BMOpSlot * slot_facemap_out,
BMesh * bm_dst,
const std::optional< BMCustomDataCopyMap > & cd_face_map,
const std::optional< BMCustomDataCopyMap > & cd_loop_map,
BMFace * f_src,
GHash * vhash,
GHash * ehash )
static

◆ bmo_mesh_copy()

◆ bmo_spin_exec()

◆ bmo_split_exec()

void bmo_split_exec ( BMesh * bm,
BMOperator * op )

Split Operator

Duplicates verts, edges and faces of a mesh but also deletes the originals.

INPUT SLOTS:

BMOP_DUPE_VINPUT: Buffer containing pointers to mesh vertices to be split BMOP_DUPE_EINPUT: Buffer containing pointers to mesh edges to be split BMOP_DUPE_FINPUT: Buffer containing pointers to mesh faces to be split

OUTPUT SLOTS:

BMOP_DUPE_VOUTPUT: Buffer containing pointers to the split mesh vertices BMOP_DUPE_EOUTPUT: Buffer containing pointers to the split mesh edges BMOP_DUPE_FOUTPUT: Buffer containing pointers to the split mesh faces

Note
Lower level uses of this operator may want to use BM_mesh_separate_faces Since it's faster for the 'use_only_faces' case.

Definition at line 436 of file bmo_dupe.cc.

References bm, BM_ALL_NOLOOP, BM_EDGES_OF_MESH, BM_EDGES_OF_VERT, BM_FACES_OF_EDGE, BM_ITER_ELEM, BM_ITER_MESH, BM_VERTS_OF_MESH, BMO_edge_flag_enable, BMO_edge_flag_test, BMO_face_flag_test, BMO_mesh_delete_oflag_context(), BMO_op_exec(), BMO_op_finish(), BMO_op_init(), BMO_slot_bool_get(), BMO_slot_buffer_flag_enable(), BMO_slot_copy, BMO_vert_flag_enable, DEL_FACES, e, BMOperator::flag, BMOperator::slots_in, SPLIT_INPUT, and v.

◆ bmo_vert_copy()

static BMVert * bmo_vert_copy ( BMOperator * op,
BMOpSlot * slot_vertmap_out,
BMesh * bm_dst,
const std::optional< BMCustomDataCopyMap > & cd_vert_map,
BMVert * v_src,
GHash * vhash )
static

COPY VERTEX

Copy an existing vertex from one bmesh to another.

Definition at line 33 of file bmo_dupe.cc.

References BLI_ghash_insert(), BM_CREATE_SKIP_CD, BM_elem_attrs_copy(), BM_vert_create(), BMO_slot_map_elem_insert(), BMO_vert_flag_enable, BMVert::co, and DUPE_NEW.

Referenced by bmo_mesh_copy().