Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-04-05 23:58:18 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-04-05 23:58:18 +0400
commit716ed32d902cd57cf700723627e8a4ba3e55a858 (patch)
treed8fd1e1981f685fb326fb8147dcd8f0f7b80a825 /source/blender/bmesh/intern/bmesh_operators.c
parent79e58c31a085c52a4901fdb8a0d026aa4ab2e594 (diff)
fix [#34870] bmesh.ops.* parameter lists and descriptions don't show in PyConsole on auto-complete
more a feature request then a bug but nice to have __doc__ on bmesh operators.
Diffstat (limited to 'source/blender/bmesh/intern/bmesh_operators.c')
-rw-r--r--source/blender/bmesh/intern/bmesh_operators.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/source/blender/bmesh/intern/bmesh_operators.c b/source/blender/bmesh/intern/bmesh_operators.c
index a358623834f..1d20f94c51c 100644
--- a/source/blender/bmesh/intern/bmesh_operators.c
+++ b/source/blender/bmesh/intern/bmesh_operators.c
@@ -47,7 +47,6 @@ static void bmo_flag_layer_free(BMesh *bm);
static void bmo_flag_layer_clear(BMesh *bm);
static int bmo_name_to_slotcode(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *identifier);
static int bmo_name_to_slotcode_check(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *identifier);
-static int bmo_opname_to_opcode(const char *opname);
static const char *bmo_error_messages[] = {
NULL,
@@ -145,7 +144,7 @@ static void bmo_op_slots_init(const BMOSlotType *slot_types, BMOpSlot *slot_args
*/
void BMO_op_init(BMesh *bm, BMOperator *op, const int flag, const char *opname)
{
- int opcode = bmo_opname_to_opcode(opname);
+ int opcode = BMO_opcode_from_opname(opname);
#ifdef DEBUG
BM_ELEM_INDEX_VALIDATE(bm, "pre bmo", opname);
@@ -1522,20 +1521,27 @@ static int bmo_name_to_slotcode_check(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], cons
return i;
}
-static int bmo_opname_to_opcode(const char *opname)
+int BMO_opcode_from_opname(const char *opname)
{
- int i;
- for (i = 0; i < bmo_opdefines_total; i++) {
- if (STREQ(opname, bmo_opdefines[i]->opname)) {
+ const unsigned int tot = bmo_opdefines_total;
+ unsigned int i;
+ for (i = 0; i < tot; i++) {
+ if (STREQ(bmo_opdefines[i]->opname, opname)) {
return i;
}
}
-
- fprintf(stderr, "%s: could not find bmesh slot for name %s! (bmesh internal error)\n", __func__, opname);
return -1;
}
+static int BMO_opcode_from_opname_check(const char *opname)
+{
+ int i = BMO_opcode_from_opname(opname);
+ if (i == -1)
+ fprintf(stderr, "%s: could not find bmesh slot for name %s! (bmesh internal error)\n", __func__, opname);
+ return i;
+}
+
/**
* \brief Format Strings for #BMOperator Initialization.
*
@@ -1628,10 +1634,11 @@ bool BMO_op_vinitf(BMesh *bm, BMOperator *op, const int flag, const char *_fmt,
fmt += i + (noslot ? 0 : 1);
- i = bmo_opname_to_opcode(opname);
+ i = BMO_opcode_from_opname_check(opname);
if (i == -1) {
MEM_freeN(ofmt);
+ BLI_assert(0);
return false;
}