Blender V5.0
bmesh_operators.cc File Reference
#include "MEM_guardedalloc.h"
#include "BLI_listbase.h"
#include "BLI_math_matrix.h"
#include "BLI_math_vector.h"
#include "BLI_memarena.h"
#include "BLI_mempool.h"
#include "BLI_string.h"
#include "BLI_utildefines.h"
#include "bmesh.hh"
#include "intern/bmesh_private.hh"

Go to the source code of this file.

Classes

struct  BMOpError

Macros

#define NEXT_CHAR(fmt)
#define GOTO_ERROR(reason)

Functions

static void bmo_flag_layer_alloc (BMesh *bm)
 ALLOC/FREE FLAG LAYER.
static void bmo_flag_layer_free (BMesh *bm)
static void bmo_flag_layer_clear (BMesh *bm)
static int bmo_name_to_slotcode (const BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *identifier)
static int bmo_name_to_slotcode_check (const BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *identifier)
void BMO_op_flag_enable (BMesh *, BMOperator *op, const int op_flag)
void BMO_op_flag_disable (BMesh *, BMOperator *op, const int op_flag)
void BMO_push (BMesh *bm, BMOperator *)
 BMESH OPSTACK PUSH.
void BMO_pop (BMesh *bm)
 BMESH OPSTACK POP.
static void bmo_op_slots_init (const BMOSlotType *slot_types, BMOpSlot *slot_args)
static void bmo_op_slots_free (const BMOSlotType *slot_types, BMOpSlot *slot_args)
void BMO_op_init (BMesh *bm, BMOperator *op, const int flag, const char *opname)
 BMESH OPSTACK INIT OP.
void BMO_op_exec (BMesh *bm, BMOperator *op)
 BMESH OPSTACK EXEC OP.
void BMO_op_finish (BMesh *bm, BMOperator *op)
 BMESH OPSTACK FINISH OP.
bool BMO_slot_exists (BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *identifier)
 BMESH OPSTACK HAS SLOT.
BMOpSlotBMO_slot_get (BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *identifier)
 BMESH OPSTACK GET SLOT.
void _bmo_slot_copy (BMOpSlot slot_args_src[BMO_OP_MAX_SLOTS], const char *slot_name_src, BMOpSlot slot_args_dst[BMO_OP_MAX_SLOTS], const char *slot_name_dst, MemArena *arena_dst)
 BMESH OPSTACK COPY SLOT.
void BMO_slot_float_set (BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const float f)
void BMO_slot_int_set (BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const int i)
void BMO_slot_bool_set (BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const bool i)
void BMO_slot_mat_set (BMOperator *op, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const float *mat, int size)
void BMO_slot_mat4_get (BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, float r_mat[4][4])
void BMO_slot_mat3_get (BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, float r_mat[3][3])
void BMO_slot_ptr_set (BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, void *p)
void BMO_slot_vec_set (BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const float vec[3])
float BMO_slot_float_get (BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name)
int BMO_slot_int_get (BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name)
bool BMO_slot_bool_get (BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name)
void * BMO_slot_as_arrayN (BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, int *len)
void * BMO_slot_ptr_get (BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name)
void BMO_slot_vec_get (BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, float r_vec[3])
static int bmo_mesh_flag_count (BMesh *bm, const char htype, const short oflag, const bool test_for_enabled)
int BMO_mesh_enabled_flag_count (BMesh *bm, const char htype, const short oflag)
int BMO_mesh_disabled_flag_count (BMesh *bm, const char htype, const short oflag)
void BMO_mesh_flag_disable_all (BMesh *bm, BMOperator *, const char htype, const short oflag)
void BMO_mesh_selected_remap (BMesh *bm, BMOpSlot *slot_vert_map, BMOpSlot *slot_edge_map, BMOpSlot *slot_face_map, const bool check_select)
int BMO_slot_buffer_len (BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name)
int BMO_slot_map_len (BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name)
void BMO_slot_map_insert (BMOperator *op, BMOpSlot *slot, const void *element, const void *data)
void BMO_slot_map_to_flag (BMesh *bm, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const char htype, const short oflag)
void * BMO_slot_buffer_alloc (BMOperator *op, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const int len)
void BMO_slot_buffer_from_all (BMesh *bm, BMOperator *op, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const char htype)
 BMO_ALL_TO_SLOT.
static void bmo_slot_buffer_from_hflag (BMesh *bm, BMOperator *op, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const char htype, const char hflag, const bool test_for_enabled)
 BMO_HEADERFLAG_TO_SLOT.
void BMO_slot_buffer_from_enabled_hflag (BMesh *bm, BMOperator *op, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const char htype, const char hflag)
void BMO_slot_buffer_from_disabled_hflag (BMesh *bm, BMOperator *op, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const char htype, const char hflag)
void BMO_slot_buffer_from_single (BMOperator *op, BMOpSlot *slot, BMHeader *ele)
void BMO_slot_buffer_from_array (BMOperator *op, BMOpSlot *slot, BMHeader **ele_buffer, int ele_buffer_len)
void * BMO_slot_buffer_get_single (BMOpSlot *slot)
void _bmo_slot_buffer_append (BMOpSlot slot_args_dst[BMO_OP_MAX_SLOTS], const char *slot_name_dst, BMOpSlot slot_args_src[BMO_OP_MAX_SLOTS], const char *slot_name_src, MemArena *arena_dst)
static void bmo_slot_buffer_from_flag (BMesh *bm, BMOperator *op, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const char htype, const short oflag, const bool test_for_enabled)
 BMO_FLAG_TO_SLOT.
void BMO_slot_buffer_from_enabled_flag (BMesh *bm, BMOperator *op, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const char htype, const short oflag)
void BMO_slot_buffer_from_disabled_flag (BMesh *bm, BMOperator *op, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const char htype, const short oflag)
void BMO_slot_buffer_hflag_enable (BMesh *bm, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const char htype, const char hflag, const bool do_flush)
 BMO_FLAG_BUFFER.
void BMO_slot_buffer_hflag_disable (BMesh *bm, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const char htype, const char hflag, const bool do_flush)
 BMO_FLAG_BUFFER.
void BMO_slot_buffer_flag_enable (BMesh *bm, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const char htype, const short oflag)
 BMO_FLAG_BUFFER.
void BMO_slot_buffer_flag_disable (BMesh *bm, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const char htype, const short oflag)
 BMO_FLAG_BUFFER.
void * BMO_slot_buffer_get_first (BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name)
void * BMO_iter_new (BMOIter *iter, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const char restrictmask)
 New Iterator.
void * BMO_iter_step (BMOIter *iter)
void ** BMO_iter_map_value_p (BMOIter *iter)
void * BMO_iter_map_value_ptr (BMOIter *iter)
float BMO_iter_map_value_float (BMOIter *iter)
int BMO_iter_map_value_int (BMOIter *iter)
bool BMO_iter_map_value_bool (BMOIter *iter)
void BMO_error_clear (BMesh *bm)
void BMO_error_raise (BMesh *bm, BMOperator *owner, eBMOpErrorLevel level, const char *msg)
bool BMO_error_occurred_at_level (BMesh *bm, eBMOpErrorLevel level)
bool BMO_error_get (BMesh *bm, const char **r_msg, BMOperator **r_op, eBMOpErrorLevel *r_level)
bool BMO_error_get_at_level (BMesh *bm, eBMOpErrorLevel level, const char **r_msg, BMOperator **r_op)
bool BMO_error_pop (BMesh *bm, const char **r_msg, BMOperator **r_op, eBMOpErrorLevel *r_level)
int BMO_opcode_from_opname (const char *opname)
static int BMO_opcode_from_opname_check (const char *opname)
bool BMO_op_vinitf (BMesh *bm, BMOperator *op, const int flag, const char *_fmt, va_list vlist)
bool BMO_op_initf (BMesh *bm, BMOperator *op, const int flag, const char *fmt,...)
bool BMO_op_callf (BMesh *bm, const int flag, const char *fmt,...)

Variables

const int BMO_OPSLOT_TYPEINFO [BMO_OP_SLOT_TOTAL_TYPES]

Detailed Description

BMesh operator access.

Definition in file bmesh_operators.cc.

Macro Definition Documentation

◆ GOTO_ERROR

#define GOTO_ERROR ( reason)
Value:
{ \
err_reason = reason; \
lineno = __LINE__; \
goto error; \
} \
(void)0
static void error(const char *str)

Referenced by BMO_op_vinitf().

◆ NEXT_CHAR

#define NEXT_CHAR ( fmt)
Value:
((fmt)[0] != 0 ? (fmt)[1] : 0)

Definition at line 1549 of file bmesh_operators.cc.

Referenced by BMO_op_vinitf(), console_move_exec(), move_cursor(), and text_move_cursor().

Function Documentation

◆ _bmo_slot_buffer_append()

void _bmo_slot_buffer_append ( BMOpSlot slot_args_dst[BMO_OP_MAX_SLOTS],
const char * slot_name_dst,
BMOpSlot slot_args_src[BMO_OP_MAX_SLOTS],
const char * slot_name_src,
struct MemArena * arena_dst )

Copies the values from another slot to the end of the output slot.

Definition at line 931 of file bmesh_operators.cc.

References _bmo_slot_copy(), BLI_assert, BLI_memarena_alloc(), BMO_OP_MAX_SLOTS, BMO_OP_SLOT_ELEMENT_BUF, BMO_OPSLOT_TYPEINFO, BMO_slot_get(), BMOpSlot::buf, BMOpSlot::data, BMOpSlot::len, and BMOpSlot::slot_type.

◆ _bmo_slot_copy()

void _bmo_slot_copy ( BMOpSlot slot_args_src[BMO_OP_MAX_SLOTS],
const char * slot_name_src,
BMOpSlot slot_args_dst[BMO_OP_MAX_SLOTS],
const char * slot_name_dst,
struct MemArena * arena_dst )

◆ BMO_error_clear()

void BMO_error_clear ( BMesh * bm)

Definition at line 1465 of file bmesh_operators.cc.

References bm, and BMO_error_pop().

Referenced by BM_mesh_data_free(), bpy_bm_op_as_py_error(), and BPy_BMO_call().

◆ BMO_error_get()

bool BMO_error_get ( BMesh * bm,
const char ** r_msg,
BMOperator ** r_op,
eBMOpErrorLevel * r_level )

Gets the topmost error from the stack. returns error code or 0 if no error.

Definition at line 1495 of file bmesh_operators.cc.

References bm, BMOpError::level, BMOpError::msg, and BMOpError::op.

Referenced by BMO_error_pop(), and bpy_bm_op_as_py_error().

◆ BMO_error_get_at_level()

bool BMO_error_get_at_level ( BMesh * bm,
eBMOpErrorLevel level,
const char ** r_msg,
BMOperator ** r_op )

Definition at line 1515 of file bmesh_operators.cc.

References bm, and LISTBASE_FOREACH.

◆ BMO_error_occurred_at_level()

bool BMO_error_occurred_at_level ( BMesh * bm,
eBMOpErrorLevel level )

◆ BMO_error_pop()

bool BMO_error_pop ( BMesh * bm,
const char ** r_msg,
BMOperator ** r_op,
eBMOpErrorLevel * r_level )

Definition at line 1535 of file bmesh_operators.cc.

References BLI_remlink(), bm, BMO_error_get(), MEM_freeN(), and result.

Referenced by BMO_error_clear(), and EDBM_op_finish().

◆ BMO_error_raise()

void BMO_error_raise ( BMesh * bm,
BMOperator * owner,
eBMOpErrorLevel level,
const char * msg )

◆ bmo_flag_layer_alloc()

void bmo_flag_layer_alloc ( BMesh * bm)
static

ALLOC/FREE FLAG LAYER.

Used by operator stack to free/allocate private flag data. This is allocated using a mempool so the allocation/frees should be quite fast.

BMESH_TODO: Investigate not freeing flag layers until all operators have been executed. This would save a lot of realloc potentially.

Definition at line 1180 of file bmesh_operators.cc.

References BMEdge_OFlag::base, BMFace_OFlag::base, BMVert_OFlag::base, BLI_mempool_calloc(), BLI_mempool_create(), BLI_mempool_destroy(), BLI_MEMPOOL_NOP, bm, BM_EDGE, BM_EDGES_OF_MESH, BM_ELEM_API_FLAG_CLEAR, BM_elem_index_set, BM_FACE, BM_FACES_OF_MESH, BM_ITER_MESH_INDEX, BM_VERT, BM_VERTS_OF_MESH, i, BMEdge_OFlag::oflags, BMFace_OFlag::oflags, and BMVert_OFlag::oflags.

Referenced by BMO_push().

◆ bmo_flag_layer_clear()

◆ bmo_flag_layer_free()

◆ BMO_iter_map_value_bool()

bool BMO_iter_map_value_bool ( BMOIter * iter)

◆ BMO_iter_map_value_float()

◆ BMO_iter_map_value_int()

int BMO_iter_map_value_int ( BMOIter * iter)

◆ BMO_iter_map_value_p()

void ** BMO_iter_map_value_p ( BMOIter * iter)

Returns a pointer to the key-value when iterating over mappings. remember for pointer maps this will be a pointer to a pointer.

Definition at line 1426 of file bmesh_operators.cc.

References BMOIter::val.

◆ BMO_iter_map_value_ptr()

◆ BMO_iter_new()

void * BMO_iter_new ( BMOIter * iter,
BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
const char * slot_name,
char restrictmask )

◆ BMO_iter_step()

◆ BMO_mesh_disabled_flag_count()

int BMO_mesh_disabled_flag_count ( BMesh * bm,
char htype,
short oflag )

Count the number of elements with the specified flag disabled. type can be a bit-mask of BM_FACE, BM_EDGE, or BM_FACE.

Definition at line 550 of file bmesh_operators.cc.

References bm, bmo_mesh_flag_count(), and oflag.

Referenced by bmo_slot_buffer_from_flag().

◆ BMO_mesh_enabled_flag_count()

int BMO_mesh_enabled_flag_count ( BMesh * bm,
char htype,
short oflag )

Count the number of elements with the specified flag enabled. type can be a bit-mask of BM_FACE, BM_EDGE, or BM_FACE.

Definition at line 545 of file bmesh_operators.cc.

References bm, bmo_mesh_flag_count(), and oflag.

Referenced by bmo_slot_buffer_from_flag().

◆ bmo_mesh_flag_count()

int bmo_mesh_flag_count ( BMesh * bm,
const char htype,
const short oflag,
const bool test_for_enabled )
static

◆ BMO_mesh_flag_disable_all()

void BMO_mesh_flag_disable_all ( BMesh * bm,
BMOperator * op,
const char htype,
const short oflag )

◆ BMO_mesh_selected_remap()

void BMO_mesh_selected_remap ( BMesh * bm,
BMOpSlot * slot_vert_map,
BMOpSlot * slot_edge_map,
BMOpSlot * slot_face_map,
const bool check_select )

◆ bmo_name_to_slotcode()

int bmo_name_to_slotcode ( const BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
const char * identifier )
static

Definition at line 1551 of file bmesh_operators.cc.

References BMO_OP_MAX_SLOTS, i, MAX_SLOTNAME, and STREQLEN.

Referenced by bmo_name_to_slotcode_check(), and BMO_slot_exists().

◆ bmo_name_to_slotcode_check()

int bmo_name_to_slotcode_check ( const BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
const char * identifier )
static

Definition at line 1566 of file bmesh_operators.cc.

References bmo_name_to_slotcode(), BMO_OP_MAX_SLOTS, and i.

Referenced by BMO_op_vinitf(), and BMO_slot_get().

◆ BMO_op_callf()

◆ BMO_op_exec()

void BMO_op_exec ( BMesh * bm,
BMOperator * op )

BMESH OPSTACK EXEC OP.

Executes a passed in operator.

This handles the allocation and freeing of temporary tool flag layers and starting/stopping the modeling loop. Can be called from other operators exec callbacks as well.

Definition at line 166 of file bmesh_operators.cc.

References bm, BM_mesh_elem_toolflags_ensure(), bmesh_edit_begin(), bmesh_edit_end(), BMO_pop(), BMO_push(), BMOperator::exec, and BMOperator::type_flag.

Referenced by bm_bridge_splice_loops(), BM_mesh_esubdivide(), bm_vert_connect_pair(), bmo_collapse_exec(), bmo_connect_vert_pair_exec(), bmo_contextual_create_exec(), bmo_create_icosphere_exec(), bmo_create_uvsphere_exec(), bmo_edgenet_fill_exec(), bmo_extrude_edge_only_exec(), bmo_extrude_face_region_exec(), bmo_holes_fill_exec(), bmo_mirror_exec(), BMO_op_callf(), bmo_pointmerge_exec(), bmo_remove_doubles_exec(), bmo_solidify_face_region_exec(), bmo_spin_exec(), bmo_split_exec(), bmo_symmetrize_exec(), bmo_triangle_fill_exec(), BPy_BMO_call(), bridge_loop_pair(), build_hull(), collapse_face_corners(), edbm_add_edge_face_exec(), EDBM_automerge_and_split(), edbm_automerge_impl(), edbm_bevel_calc(), edbm_bridge_edge_loops_for_single_editmesh(), edbm_connect_vert_pair(), edbm_dupli_extrude_cursor_invoke(), edbm_duplicate_exec(), edbm_edge_rotate_selected_exec(), edbm_extrude_discrete_faces(), edbm_extrude_edges_indiv(), edbm_extrude_ex(), edbm_extrude_verts_indiv(), edbm_fill_exec(), edbm_fill_grid_split_join_finish(), edbm_fill_grid_split_join_init(), edbm_inset_calc(), edbm_offset_edgeloop_exec(), EDBM_op_call_and_selectf(), EDBM_op_call_silentf(), EDBM_op_callf(), edbm_poke_face_exec(), edbm_quads_convert_to_tris_exec(), edbm_remove_doubles_exec(), edbm_reverse_colors_exec(), edbm_reverse_uvs_exec(), edbm_rotate_colors_exec(), edbm_rotate_uvs_exec(), edbm_screw_exec(), EDBM_select_less(), EDBM_select_more(), edbm_solidify_exec(), edbm_spin_exec(), edbm_split_exec(), edbm_unsubdivide_exec(), edbm_wireframe_exec(), mesh_bisect_exec(), mesh_symmetrize_exec(), and skin_fix_hole_no_good_verts().

◆ BMO_op_finish()

◆ BMO_op_flag_disable()

void BMO_op_flag_disable ( BMesh * bm,
BMOperator * op,
const int op_flag )

Definition at line 55 of file bmesh_operators.cc.

References BMOperator::flag.

◆ BMO_op_flag_enable()

void BMO_op_flag_enable ( BMesh * bm,
BMOperator * op,
const int op_flag )

Definition at line 50 of file bmesh_operators.cc.

References BMOperator::flag.

◆ BMO_op_init()

◆ BMO_op_initf()

◆ bmo_op_slots_free()

void bmo_op_slots_free ( const BMOSlotType * slot_types,
BMOpSlot * slot_args )
static

◆ bmo_op_slots_init()

◆ BMO_op_vinitf()

◆ BMO_opcode_from_opname()

int BMO_opcode_from_opname ( const char * opname)

◆ BMO_opcode_from_opname_check()

int BMO_opcode_from_opname_check ( const char * opname)
static

Definition at line 1593 of file bmesh_operators.cc.

References BMO_opcode_from_opname(), and i.

Referenced by BMO_op_vinitf().

◆ BMO_pop()

void BMO_pop ( BMesh * bm)

BMESH OPSTACK POP.

Pops the operator-stack one level and frees a flag layer if appropriate

BMESH_TODO: investigate NOT freeing flag layers.

Definition at line 75 of file bmesh_operators.cc.

References bm, and bmo_flag_layer_free().

Referenced by BMO_op_exec(), build_skin(), and walker_deselect_nth().

◆ BMO_push()

void BMO_push ( BMesh * bm,
BMOperator * op )

BMESH OPSTACK PUSH.

Pushes the operator-stack down one level and allocates a new flag layer if appropriate.

Definition at line 60 of file bmesh_operators.cc.

References BLI_assert, bm, bmo_flag_layer_alloc(), and bmo_flag_layer_clear().

Referenced by BMO_op_exec(), build_skin(), and walker_deselect_nth().

◆ BMO_slot_as_arrayN()

void * BMO_slot_as_arrayN ( BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
const char * slot_name,
int * len )

◆ BMO_slot_bool_get()

bool BMO_slot_bool_get ( BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
const char * slot_name )

Definition at line 453 of file bmesh_operators.cc.

References BLI_assert, BMO_OP_MAX_SLOTS, BMO_OP_SLOT_BOOL, BMO_slot_get(), BMOpSlot::data, BMOpSlot::i, and BMOpSlot::slot_type.

Referenced by bm_edge_delmimit_data_from_op(), bmesh_find_doubles_common(), bmo_beautify_fill_exec(), bmo_bevel_exec(), bmo_bisect_plane_exec(), bmo_bridge_loops_exec(), bmo_collapse_exec(), bmo_connect_verts_exec(), bmo_contextual_create_exec(), bmo_create_circle_exec(), bmo_create_cone_exec(), bmo_create_cube_exec(), bmo_create_grid_exec(), bmo_create_icosphere_exec(), bmo_create_monkey_exec(), bmo_create_uvsphere_exec(), bmo_dissolve_edges_exec(), bmo_dissolve_faces_exec(), bmo_dissolve_limit_exec(), bmo_dissolve_verts_exec(), bmo_edgeloop_fill_exec(), bmo_edgenet_fill_exec(), bmo_extrude_discrete_faces_exec(), bmo_extrude_edge_only_exec(), bmo_extrude_face_region_exec(), bmo_extrude_vert_indiv_exec(), bmo_face_attribute_fill_exec(), bmo_grid_fill_exec(), bmo_inset_individual_exec(), bmo_inset_region_exec(), bmo_join_triangles_exec(), bmo_mesh_copy(), bmo_mesh_to_bmesh_exec(), bmo_mirror_exec(), bmo_offset_edgeloops_exec(), bmo_poke_exec(), bmo_region_extend_exec(), bmo_reverse_faces_exec(), bmo_rotate_colors_exec(), bmo_rotate_edges_exec(), bmo_rotate_uvs_exec(), bmo_smooth_laplacian_vert_exec(), bmo_smooth_vert_exec(), bmo_spin_exec(), bmo_split_edges_exec(), bmo_split_exec(), bmo_subdivide_edges_exec(), bmo_transform_exec(), bmo_triangle_fill_exec(), bmo_weld_verts_exec(), and bmo_wireframe_exec().

◆ BMO_slot_bool_set()

void BMO_slot_bool_set ( BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
const char * slot_name,
const bool i )

◆ BMO_slot_buffer_alloc()

◆ BMO_slot_buffer_flag_disable()

void BMO_slot_buffer_flag_disable ( BMesh * bm,
BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
const char * slot_name,
char htype,
short oflag )

◆ BMO_slot_buffer_flag_enable()

◆ BMO_slot_buffer_from_all()

void BMO_slot_buffer_from_all ( BMesh * bm,
BMOperator * op,
BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
const char * slot_name,
char htype )

BMO_ALL_TO_SLOT.

Copies all elements of a certain type into an operator slot.

Definition at line 740 of file bmesh_operators.cc.

References BLI_assert, bm, BM_ALL_NOLOOP, BM_EDGE, BM_EDGES_OF_MESH, BM_FACE, BM_FACES_OF_MESH, BM_ITER_MESH, BM_VERT, BM_VERTS_OF_MESH, BMO_OP_MAX_SLOTS, BMO_OP_SLOT_ELEMENT_BUF, BMO_slot_buffer_alloc(), BMO_slot_get(), i, and output.

Referenced by BMO_op_vinitf(), and bpy_slot_from_py().

◆ BMO_slot_buffer_from_array()

void BMO_slot_buffer_from_array ( BMOperator * op,
BMOpSlot * slot,
BMHeader ** ele_buffer,
int ele_buffer_len )

◆ BMO_slot_buffer_from_disabled_flag()

void BMO_slot_buffer_from_disabled_flag ( BMesh * bm,
BMOperator * op,
BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
const char * slot_name,
char htype,
short oflag )

Puts every element of type 'type' (which is a bit-mask) without tool flag 'flag', into a slot.

Definition at line 1046 of file bmesh_operators.cc.

References bm, BMO_OP_MAX_SLOTS, bmo_slot_buffer_from_flag(), and oflag.

Referenced by BMO_op_vinitf().

◆ BMO_slot_buffer_from_disabled_hflag()

void BMO_slot_buffer_from_disabled_hflag ( BMesh * bm,
BMOperator * op,
BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
const char * slot_name,
char htype,
char hflag )

Puts every element of type 'type' (which is a bit-mask) without header flag 'flag', into a slot.

Note
ignores hidden elements (e.g. elements with header flag BM_ELEM_HIDDEN set).

Definition at line 879 of file bmesh_operators.cc.

References bm, BMO_OP_MAX_SLOTS, and bmo_slot_buffer_from_hflag().

Referenced by BMO_op_vinitf().

◆ BMO_slot_buffer_from_enabled_flag()

◆ BMO_slot_buffer_from_enabled_hflag()

void BMO_slot_buffer_from_enabled_hflag ( BMesh * bm,
BMOperator * op,
BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
const char * slot_name,
char htype,
char hflag )

Puts every element of type 'type' (which is a bit-mask) with header flag 'flag', into a slot.

Note
ignores hidden elements (e.g. elements with header flag BM_ELEM_HIDDEN set).

Definition at line 869 of file bmesh_operators.cc.

References bm, BMO_OP_MAX_SLOTS, and bmo_slot_buffer_from_hflag().

Referenced by bmo_bevel_exec(), bmo_edgenet_fill_exec(), bmo_face_attribute_fill_exec(), bmo_holes_fill_exec(), BMO_op_vinitf(), bmo_split_edges_exec(), bmo_triangulate_exec(), bmo_wireframe_exec(), edbm_extrude_ex(), edbm_fill_grid_split_join_init(), and edbm_inset_calc().

◆ bmo_slot_buffer_from_flag()

void bmo_slot_buffer_from_flag ( BMesh * bm,
BMOperator * op,
BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
const char * slot_name,
const char htype,
const short oflag,
const bool test_for_enabled )
static

◆ bmo_slot_buffer_from_hflag()

void bmo_slot_buffer_from_hflag ( BMesh * bm,
BMOperator * op,
BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
const char * slot_name,
const char htype,
const char hflag,
const bool test_for_enabled )
static

◆ BMO_slot_buffer_from_single()

◆ BMO_slot_buffer_get_first()

void * BMO_slot_buffer_get_first ( BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
const char * slot_name )

◆ BMO_slot_buffer_get_single()

◆ BMO_slot_buffer_hflag_disable()

void BMO_slot_buffer_hflag_disable ( BMesh * bm,
BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
const char * slot_name,
char htype,
char hflag,
bool do_flush )

◆ BMO_slot_buffer_hflag_enable()

void BMO_slot_buffer_hflag_enable ( BMesh * bm,
BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
const char * slot_name,
char htype,
char hflag,
bool do_flush )

◆ BMO_slot_buffer_len()

◆ BMO_slot_exists()

bool BMO_slot_exists ( BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
const char * identifier )

BMESH OPSTACK HAS SLOT.

Returns
Success if the slot if found.

Definition at line 202 of file bmesh_operators.cc.

References bmo_name_to_slotcode(), and BMO_OP_MAX_SLOTS.

Referenced by bmesh_find_doubles_common(), and BPy_BMO_call().

◆ BMO_slot_float_get()

◆ BMO_slot_float_set()

void BMO_slot_float_set ( BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
const char * slot_name,
const float f )

◆ BMO_slot_get()

BMOpSlot * BMO_slot_get ( BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
const char * identifier )

BMESH OPSTACK GET SLOT.

Returns a pointer to the slot of type 'slot_code'

Definition at line 208 of file bmesh_operators.cc.

References BLI_assert, bmo_name_to_slotcode_check(), BMO_OP_MAX_SLOTS, and UNLIKELY.

Referenced by _bmo_slot_buffer_append(), _bmo_slot_copy(), bm_bridge_splice_loops(), bm_rotate_edges_shared(), bmesh_find_doubles_common(), bmo_bisect_edges_exec(), bmo_collapse_exec(), bmo_connect_vert_pair_exec(), bmo_create_grid_exec(), bmo_dissolve_limit_exec(), bmo_extrude_face_region_exec(), bmo_find_doubles_exec(), BMO_iter_new(), bmo_mesh_copy(), bmo_mirror_exec(), BMO_op_vinitf(), bmo_pointmerge_exec(), bmo_pointmerge_facedata_exec(), bmo_remove_doubles_exec(), BMO_slot_as_arrayN(), BMO_slot_bool_get(), BMO_slot_bool_set(), BMO_slot_buffer_alloc(), BMO_slot_buffer_flag_disable(), BMO_slot_buffer_flag_enable(), BMO_slot_buffer_from_all(), bmo_slot_buffer_from_flag(), bmo_slot_buffer_from_hflag(), BMO_slot_buffer_get_first(), BMO_slot_buffer_hflag_disable(), BMO_slot_buffer_hflag_enable(), BMO_slot_buffer_len(), BMO_slot_float_get(), BMO_slot_float_set(), BMO_slot_int_get(), BMO_slot_int_set(), BMO_slot_map_len(), BMO_slot_map_to_flag(), BMO_slot_mat3_get(), BMO_slot_mat4_get(), BMO_slot_mat_set(), BMO_slot_ptr_get(), BMO_slot_ptr_set(), BMO_slot_vec_get(), BMO_slot_vec_set(), bmo_spin_exec(), bmo_split_exec(), bmo_subdivide_edges_exec(), bmo_symmetrize_exec(), bmo_triangulate_exec(), bmo_unsubdivide_exec(), bmo_weld_verts_exec(), BPy_BMO_call(), collapse_face_corners(), EDBM_automerge_and_split(), edbm_connect_vert_pair(), edbm_extrude_ex(), edbm_fill_grid_split_join_init(), EDBM_op_call_and_selectf(), and skin_fix_hole_no_good_verts().

◆ BMO_slot_int_get()

◆ BMO_slot_int_set()

void BMO_slot_int_set ( BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
const char * slot_name,
const int i )

◆ BMO_slot_map_insert()

void BMO_slot_map_insert ( BMOperator * op,
BMOpSlot * slot,
const void * element,
const void * data )

Inserts a key/value mapping into a mapping slot. note that it copies the value, it doesn't store a reference to it.

Definition at line 644 of file bmesh_operators.cc.

References BLI_assert, BLI_ghash_insert(), BMO_ASSERT_SLOT_IN_OP, BMO_OP_SLOT_MAPPING, BMOpSlot::data, data, element, BMOpSlot::ghash, and BMOpSlot::slot_type.

Referenced by BMO_slot_map_bool_insert(), BMO_slot_map_elem_insert(), BMO_slot_map_empty_insert(), BMO_slot_map_float_insert(), BMO_slot_map_int_insert(), and BMO_slot_map_ptr_insert().

◆ BMO_slot_map_len()

int BMO_slot_map_len ( BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
const char * slot_name )

Return the number of elements inside a slot map.

Definition at line 637 of file bmesh_operators.cc.

References BLI_assert, BLI_ghash_len(), BMO_OP_MAX_SLOTS, BMO_OP_SLOT_MAPPING, BMO_slot_get(), BMOpSlot::data, BMOpSlot::ghash, and BMOpSlot::slot_type.

Referenced by bmo_extrude_face_region_exec().

◆ BMO_slot_map_to_flag()

void BMO_slot_map_to_flag ( BMesh * bm,
BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
const char * slot_name,
char htype,
short oflag )

Flags all elements in a mapping.

Note
that the mapping must only have BMesh elements in it.

Definition at line 696 of file bmesh_operators.cc.

References BLI_assert, BLI_ghashIterator_getKey(), bm, BMO_elem_flag_enable, BMO_OP_MAX_SLOTS, BMO_OP_SLOT_MAPPING, BMO_slot_get(), BMOpSlot::data, BMOpSlot::ghash, GHASH_ITER, BMElemF::head, BMHeader::htype, oflag, and BMOpSlot::slot_type.

Referenced by bmo_bisect_edges_exec(), and bmo_subdivide_edges_exec().

◆ BMO_slot_mat3_get()

void BMO_slot_mat3_get ( BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
const char * slot_name,
float r_mat[3][3] )

◆ BMO_slot_mat4_get()

◆ BMO_slot_mat_set()

void BMO_slot_mat_set ( BMOperator * op,
BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
const char * slot_name,
const float * mat,
int size )

Only supports square matrices. size must be 3 or 4; this API is meant only for transformation matrices.

Note
the matrix is stored in 4x4 form, and it's safe to call whichever function you want.

Definition at line 343 of file bmesh_operators.cc.

References BMOperator::arena, BLI_assert, BLI_memarena_alloc(), BMO_OP_MAX_SLOTS, BMO_OP_SLOT_MAT, BMO_slot_get(), copy_m4_m3(), copy_m4_m4(), BMOpSlot::data, float, BMOpSlot::len, BMOpSlot::p, size(), BMOpSlot::slot_type, and zero_m4().

Referenced by BMO_op_vinitf(), and bpy_slot_from_py().

◆ BMO_slot_ptr_get()

void * BMO_slot_ptr_get ( BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
const char * slot_name )

◆ BMO_slot_ptr_set()

void BMO_slot_ptr_set ( BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
const char * slot_name,
void * p )

Don't pass in arrays that are supposed to map to elements this way.

so, e.g. passing in list of floats per element in another slot is bad. passing in, e.g. pointer to an edit-mesh for the conversion operator is fine though.

Definition at line 407 of file bmesh_operators.cc.

References BLI_assert, BMO_OP_MAX_SLOTS, BMO_OP_SLOT_PTR, BMO_slot_get(), BMOpSlot::data, BMOpSlot::p, and BMOpSlot::slot_type.

Referenced by BMO_op_vinitf().

◆ BMO_slot_vec_get()

◆ BMO_slot_vec_set()

void BMO_slot_vec_set ( BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
const char * slot_name,
const float vec[3] )

Variable Documentation

◆ BMO_OPSLOT_TYPEINFO

const int BMO_OPSLOT_TYPEINFO[BMO_OP_SLOT_TOTAL_TYPES]
Initial value:
= {
0,
sizeof(int),
sizeof(int),
sizeof(float),
sizeof(void *),
sizeof(void *),
0,
0,
sizeof(float[3]),
sizeof(void *),
sizeof(void *),
}
nullptr float

Definition at line 33 of file bmesh_operators.cc.

Referenced by _bmo_slot_buffer_append(), _bmo_slot_copy(), and BMO_slot_buffer_alloc().