Blender  V3.3
Macros | Typedefs | Enumerations | Functions
bmesh_error.h File Reference
#include "bmesh_operator_api.h"

Go to the source code of this file.

Macros

#define BM_ELEM_INDEX_VALIDATE(_bm, _msg_a, _msg_b)    BM_mesh_elem_index_validate(_bm, __FILE__ ":" STRINGIFY(__LINE__), __func__, _msg_a, _msg_b)
 
#define _BMESH_DUMMY_ABORT()   (void)0
 
#define BMESH_ASSERT(a)
 

Typedefs

typedef enum eBMOpErrorLevel eBMOpErrorLevel
 

Enumerations

enum  eBMOpErrorLevel { BMO_ERROR_CANCEL = 0 , BMO_ERROR_WARN = 1 , BMO_ERROR_FATAL = 2 }
 

Functions

void BMO_error_raise (BMesh *bm, BMOperator *owner, eBMOpErrorLevel level, const char *msg) ATTR_NONNULL(1
 
void 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_occurred_at_level (BMesh *bm, eBMOpErrorLevel level)
 
bool BMO_error_pop (BMesh *bm, const char **r_msg, BMOperator **r_op, eBMOpErrorLevel *r_level)
 
void BMO_error_clear (BMesh *bm)
 

Macro Definition Documentation

◆ _BMESH_DUMMY_ABORT

#define _BMESH_DUMMY_ABORT ( )    (void)0

Definition at line 73 of file bmesh_error.h.

◆ BM_ELEM_INDEX_VALIDATE

#define BM_ELEM_INDEX_VALIDATE (   _bm,
  _msg_a,
  _msg_b 
)     BM_mesh_elem_index_validate(_bm, __FILE__ ":" STRINGIFY(__LINE__), __func__, _msg_a, _msg_b)

Definition at line 66 of file bmesh_error.h.

◆ BMESH_ASSERT

#define BMESH_ASSERT (   a)
Value:
(void)((!(a)) ? ((fprintf(stderr, \
"BMESH_ASSERT failed: %s, %s(), %d at \'%s\'\n", \
__FILE__, \
__func__, \
__LINE__, \
STRINGIFY(a)), \
_BMESH_DUMMY_ABORT(), \
NULL)) : \
NULL)
#define STRINGIFY(x)
SyclQueue void void size_t num_bytes void
static unsigned a[3]
Definition: RandGen.cpp:78

This is meant to be higher level than BLI_assert(), its enabled even when in Release mode.

Definition at line 80 of file bmesh_error.h.

Typedef Documentation

◆ eBMOpErrorLevel

Note
More can be added as needed.

Enumeration Type Documentation

◆ eBMOpErrorLevel

Note
More can be added as needed.
Enumerator
BMO_ERROR_CANCEL 

Use when the operation could not succeed, typically from input that isn't sufficient for completing the operation.

BMO_ERROR_WARN 

Use this when one or more operations could not succeed, when the resulting mesh can be used (since some operations succeeded or no change was made). This is used by default.

BMO_ERROR_FATAL 

The mesh resulting from this operation should not be used (where possible). It should not be left in a corrupt state either.

See BMBackup type & function calls.

Definition at line 16 of file bmesh_error.h.

Function Documentation

◆ BMO_error_clear()

void BMO_error_clear ( BMesh bm)

Definition at line 1452 of file bmesh_operators.c.

References bm, BMO_error_pop(), and NULL.

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

◆ BMO_error_get()

void 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 1480 of file bmesh_operators.c.

References bm, err, BMesh::errorstack, ListBase::first, and NULL.

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 1500 of file bmesh_operators.c.

References bm, err, BMesh::errorstack, ListBase::first, and BMOpError::level.

◆ 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 
)

◆ BMO_error_raise()

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

Pushes an error onto the bmesh error stack. if msg is null, then the default message for the errcode is used.

Referenced by bmo_bisect_plane_exec(), bmo_bridge_loops_exec(), bmo_connect_verts_exec(), bmo_grid_fill_exec(), bmo_reverse_colors_exec(), bmo_rotate_colors_exec(), and bmo_subdivide_edgering_exec().