code cleanup: minor BMESH_TODO's, some were left in even though they were done/invalid.
This commit is contained in:
parent
8cca2fec82
commit
be71c46b24
@ -26,13 +26,6 @@
|
||||
* This file contains code for dealing
|
||||
* with polygons (normal/area calculation,
|
||||
* tessellation, etc)
|
||||
*
|
||||
* BMESH_TODO:
|
||||
* - Add in Tessellator frontend that creates
|
||||
* BMTriangles from copied faces
|
||||
*
|
||||
* - Add in Function that checks for and flags
|
||||
* degenerate faces.
|
||||
*/
|
||||
|
||||
#include "DNA_listBase.h"
|
||||
|
@ -6544,13 +6544,13 @@ static int curvesurf_prim_add(bContext *C, wmOperator *op, int type, int isSurf)
|
||||
Object *obedit = CTX_data_edit_object(C);
|
||||
ListBase *editnurb;
|
||||
Nurb *nu;
|
||||
int newob = 0;
|
||||
int enter_editmode, is_aligned;
|
||||
bool newob = false;
|
||||
bool enter_editmode, is_view_aligned;
|
||||
unsigned int layer;
|
||||
float loc[3], rot[3];
|
||||
float mat[4][4];
|
||||
|
||||
if (!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, &is_aligned))
|
||||
if (!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, &is_view_aligned))
|
||||
return OPERATOR_CANCELLED;
|
||||
|
||||
if (!isSurf) { /* adding curve */
|
||||
@ -6558,7 +6558,7 @@ static int curvesurf_prim_add(bContext *C, wmOperator *op, int type, int isSurf)
|
||||
Curve *cu;
|
||||
|
||||
obedit = ED_object_add_type(C, OB_CURVE, loc, rot, TRUE, layer);
|
||||
newob = 1;
|
||||
newob = true;
|
||||
|
||||
cu = (Curve *)obedit->data;
|
||||
cu->flag |= CU_DEFORM_FILL;
|
||||
@ -6573,7 +6573,7 @@ static int curvesurf_prim_add(bContext *C, wmOperator *op, int type, int isSurf)
|
||||
else { /* adding surface */
|
||||
if (obedit == NULL || obedit->type != OB_SURF) {
|
||||
obedit = ED_object_add_type(C, OB_SURF, loc, rot, TRUE, layer);
|
||||
newob = 1;
|
||||
newob = true;
|
||||
}
|
||||
else {
|
||||
DAG_id_tag_update(&obedit->id, OB_RECALC_DATA);
|
||||
|
@ -141,7 +141,7 @@ float ED_object_new_primitive_matrix(struct bContext *C, struct Object *editob,
|
||||
|
||||
void ED_object_add_generic_props(struct wmOperatorType *ot, int do_editmode);
|
||||
int ED_object_add_generic_get_opts(struct bContext *C, struct wmOperator *op, float loc[3], float rot[3],
|
||||
int *enter_editmode, unsigned int *layer, int *is_view_aligned);
|
||||
bool *enter_editmode, unsigned int *layer, bool *is_view_aligned);
|
||||
|
||||
struct Object *ED_object_add_type(struct bContext *C, int type, const float loc[3], const float rot[3],
|
||||
int enter_editmode, unsigned int layer);
|
||||
|
@ -57,11 +57,11 @@
|
||||
* or at least something more descriptive */
|
||||
static Object *make_prim_init(bContext *C, const char *idname,
|
||||
float *dia, float mat[4][4],
|
||||
int *state, const float loc[3], const float rot[3], const unsigned int layer)
|
||||
bool *was_editmode, const float loc[3], const float rot[3], const unsigned int layer)
|
||||
{
|
||||
Object *obedit = CTX_data_edit_object(C);
|
||||
|
||||
*state = 0;
|
||||
*was_editmode = false;
|
||||
if (obedit == NULL || obedit->type != OB_MESH) {
|
||||
obedit = ED_object_add_type(C, OB_MESH, loc, rot, false, layer);
|
||||
|
||||
@ -70,7 +70,7 @@ static Object *make_prim_init(bContext *C, const char *idname,
|
||||
|
||||
/* create editmode */
|
||||
ED_object_editmode_enter(C, EM_DO_UNDO | EM_IGNORE_LAYER); /* rare cases the active layer is messed up */
|
||||
*state = 1;
|
||||
*was_editmode = true;
|
||||
}
|
||||
|
||||
*dia = ED_object_new_primitive_matrix(C, obedit, loc, rot, mat, false);
|
||||
@ -78,10 +78,10 @@ static Object *make_prim_init(bContext *C, const char *idname,
|
||||
return obedit;
|
||||
}
|
||||
|
||||
static void make_prim_finish(bContext *C, Object *obedit, int *state, int enter_editmode)
|
||||
static void make_prim_finish(bContext *C, Object *obedit, bool was_editmode, int enter_editmode)
|
||||
{
|
||||
BMEditMesh *em = BMEdit_FromObject(obedit);
|
||||
const int exit_editmode = (*state && !enter_editmode);
|
||||
const int exit_editmode = ((was_editmode == true) && (enter_editmode == false));
|
||||
|
||||
/* Primitive has all verts selected, use vert select flush
|
||||
* to push this up to edges & faces. */
|
||||
@ -102,12 +102,12 @@ static int add_primitive_plane_exec(bContext *C, wmOperator *op)
|
||||
Object *obedit;
|
||||
BMEditMesh *em;
|
||||
float loc[3], rot[3], mat[4][4], dia;
|
||||
int enter_editmode;
|
||||
int state;
|
||||
bool enter_editmode;
|
||||
bool was_editmode;
|
||||
unsigned int layer;
|
||||
|
||||
ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL);
|
||||
obedit = make_prim_init(C, CTX_DATA_(BLF_I18NCONTEXT_ID_MESH, "Plane"), &dia, mat, &state, loc, rot, layer);
|
||||
obedit = make_prim_init(C, CTX_DATA_(BLF_I18NCONTEXT_ID_MESH, "Plane"), &dia, mat, &was_editmode, loc, rot, layer);
|
||||
em = BMEdit_FromObject(obedit);
|
||||
|
||||
if (!EDBM_op_call_and_selectf(em, op, "verts.out",
|
||||
@ -116,7 +116,7 @@ static int add_primitive_plane_exec(bContext *C, wmOperator *op)
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
make_prim_finish(C, obedit, &state, enter_editmode);
|
||||
make_prim_finish(C, obedit, was_editmode, enter_editmode);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
@ -143,12 +143,12 @@ static int add_primitive_cube_exec(bContext *C, wmOperator *op)
|
||||
Object *obedit;
|
||||
BMEditMesh *em;
|
||||
float loc[3], rot[3], mat[4][4], dia;
|
||||
int enter_editmode;
|
||||
int state;
|
||||
bool enter_editmode;
|
||||
bool was_editmode;
|
||||
unsigned int layer;
|
||||
|
||||
ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL);
|
||||
obedit = make_prim_init(C, CTX_DATA_(BLF_I18NCONTEXT_ID_MESH, "Cube"), &dia, mat, &state, loc, rot, layer);
|
||||
obedit = make_prim_init(C, CTX_DATA_(BLF_I18NCONTEXT_ID_MESH, "Cube"), &dia, mat, &was_editmode, loc, rot, layer);
|
||||
em = BMEdit_FromObject(obedit);
|
||||
|
||||
if (!EDBM_op_call_and_selectf(em, op, "verts.out", "create_cube matrix=%m4 size=%f", mat, dia * 2.0f)) {
|
||||
@ -156,7 +156,7 @@ static int add_primitive_cube_exec(bContext *C, wmOperator *op)
|
||||
}
|
||||
|
||||
/* BMESH_TODO make plane side this: M_SQRT2 - plane (diameter of 1.41 makes it unit size) */
|
||||
make_prim_finish(C, obedit, &state, enter_editmode);
|
||||
make_prim_finish(C, obedit, was_editmode, enter_editmode);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
@ -189,15 +189,16 @@ static int add_primitive_circle_exec(bContext *C, wmOperator *op)
|
||||
Object *obedit;
|
||||
BMEditMesh *em;
|
||||
float loc[3], rot[3], mat[4][4], dia;
|
||||
int enter_editmode;
|
||||
int state, cap_end, cap_tri;
|
||||
bool enter_editmode;
|
||||
int cap_end, cap_tri;
|
||||
unsigned int layer;
|
||||
bool was_editmode;
|
||||
|
||||
cap_end = RNA_enum_get(op->ptr, "fill_type");
|
||||
cap_tri = (cap_end == 2);
|
||||
|
||||
ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL);
|
||||
obedit = make_prim_init(C, CTX_DATA_(BLF_I18NCONTEXT_ID_MESH, "Circle"), &dia, mat, &state, loc, rot, layer);
|
||||
obedit = make_prim_init(C, CTX_DATA_(BLF_I18NCONTEXT_ID_MESH, "Circle"), &dia, mat, &was_editmode, loc, rot, layer);
|
||||
em = BMEdit_FromObject(obedit);
|
||||
|
||||
if (!EDBM_op_call_and_selectf(em, op, "verts.out",
|
||||
@ -208,7 +209,7 @@ static int add_primitive_circle_exec(bContext *C, wmOperator *op)
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
make_prim_finish(C, obedit, &state, enter_editmode);
|
||||
make_prim_finish(C, obedit, was_editmode, enter_editmode);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
@ -244,15 +245,16 @@ static int add_primitive_cylinder_exec(bContext *C, wmOperator *op)
|
||||
Object *obedit;
|
||||
BMEditMesh *em;
|
||||
float loc[3], rot[3], mat[4][4], dia;
|
||||
int enter_editmode;
|
||||
int state, cap_end, cap_tri;
|
||||
bool enter_editmode;
|
||||
int cap_end, cap_tri;
|
||||
unsigned int layer;
|
||||
bool was_editmode;
|
||||
|
||||
cap_end = RNA_enum_get(op->ptr, "end_fill_type");
|
||||
cap_tri = (cap_end == 2);
|
||||
|
||||
ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL);
|
||||
obedit = make_prim_init(C, CTX_DATA_(BLF_I18NCONTEXT_ID_MESH, "Cylinder"), &dia, mat, &state, loc, rot, layer);
|
||||
obedit = make_prim_init(C, CTX_DATA_(BLF_I18NCONTEXT_ID_MESH, "Cylinder"), &dia, mat, &was_editmode, loc, rot, layer);
|
||||
em = BMEdit_FromObject(obedit);
|
||||
|
||||
if (!EDBM_op_call_and_selectf(
|
||||
@ -267,7 +269,7 @@ static int add_primitive_cylinder_exec(bContext *C, wmOperator *op)
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
make_prim_finish(C, obedit, &state, enter_editmode);
|
||||
make_prim_finish(C, obedit, was_editmode, enter_editmode);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
@ -305,15 +307,16 @@ static int add_primitive_cone_exec(bContext *C, wmOperator *op)
|
||||
Object *obedit;
|
||||
BMEditMesh *em;
|
||||
float loc[3], rot[3], mat[4][4], dia;
|
||||
int enter_editmode;
|
||||
int state, cap_end, cap_tri;
|
||||
bool enter_editmode;
|
||||
int cap_end, cap_tri;
|
||||
unsigned int layer;
|
||||
bool was_editmode;
|
||||
|
||||
cap_end = RNA_enum_get(op->ptr, "end_fill_type");
|
||||
cap_tri = (cap_end == 2);
|
||||
|
||||
ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL);
|
||||
obedit = make_prim_init(C, CTX_DATA_(BLF_I18NCONTEXT_ID_MESH, "Cone"), &dia, mat, &state, loc, rot, layer);
|
||||
obedit = make_prim_init(C, CTX_DATA_(BLF_I18NCONTEXT_ID_MESH, "Cone"), &dia, mat, &was_editmode, loc, rot, layer);
|
||||
em = BMEdit_FromObject(obedit);
|
||||
|
||||
if (!EDBM_op_call_and_selectf(
|
||||
@ -325,7 +328,7 @@ static int add_primitive_cone_exec(bContext *C, wmOperator *op)
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
make_prim_finish(C, obedit, &state, enter_editmode);
|
||||
make_prim_finish(C, obedit, was_editmode, enter_editmode);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
@ -365,12 +368,12 @@ static int add_primitive_grid_exec(bContext *C, wmOperator *op)
|
||||
Object *obedit;
|
||||
BMEditMesh *em;
|
||||
float loc[3], rot[3], mat[4][4], dia;
|
||||
int enter_editmode;
|
||||
int state;
|
||||
bool enter_editmode;
|
||||
bool was_editmode;
|
||||
unsigned int layer;
|
||||
|
||||
ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL);
|
||||
obedit = make_prim_init(C, CTX_DATA_(BLF_I18NCONTEXT_ID_MESH, "Grid"), &dia, mat, &state, loc, rot, layer);
|
||||
obedit = make_prim_init(C, CTX_DATA_(BLF_I18NCONTEXT_ID_MESH, "Grid"), &dia, mat, &was_editmode, loc, rot, layer);
|
||||
em = BMEdit_FromObject(obedit);
|
||||
|
||||
if (!EDBM_op_call_and_selectf(em, op, "verts.out",
|
||||
@ -382,7 +385,7 @@ static int add_primitive_grid_exec(bContext *C, wmOperator *op)
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
make_prim_finish(C, obedit, &state, enter_editmode);
|
||||
make_prim_finish(C, obedit, was_editmode, enter_editmode);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
@ -418,15 +421,16 @@ static int add_primitive_monkey_exec(bContext *C, wmOperator *op)
|
||||
Object *obedit;
|
||||
BMEditMesh *em;
|
||||
float loc[3], rot[3], mat[4][4], dia;
|
||||
int enter_editmode;
|
||||
int state, view_aligned;
|
||||
bool enter_editmode;
|
||||
bool is_view_aligned;
|
||||
unsigned int layer;
|
||||
bool was_editmode;
|
||||
|
||||
ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, &view_aligned);
|
||||
if (!view_aligned)
|
||||
ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, &is_view_aligned);
|
||||
if (!is_view_aligned)
|
||||
rot[0] += (float)M_PI / 2.0f;
|
||||
|
||||
obedit = make_prim_init(C, CTX_DATA_(BLF_I18NCONTEXT_ID_MESH, "Suzanne"), &dia, mat, &state, loc, rot, layer);
|
||||
obedit = make_prim_init(C, CTX_DATA_(BLF_I18NCONTEXT_ID_MESH, "Suzanne"), &dia, mat, &was_editmode, loc, rot, layer);
|
||||
mat[0][0] *= dia;
|
||||
mat[1][1] *= dia;
|
||||
mat[2][2] *= dia;
|
||||
@ -437,7 +441,7 @@ static int add_primitive_monkey_exec(bContext *C, wmOperator *op)
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
make_prim_finish(C, obedit, &state, enter_editmode);
|
||||
make_prim_finish(C, obedit, was_editmode, enter_editmode);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
@ -464,12 +468,12 @@ static int add_primitive_uvsphere_exec(bContext *C, wmOperator *op)
|
||||
Object *obedit;
|
||||
BMEditMesh *em;
|
||||
float loc[3], rot[3], mat[4][4], dia;
|
||||
int enter_editmode;
|
||||
int state;
|
||||
bool enter_editmode;
|
||||
bool was_editmode;
|
||||
unsigned int layer;
|
||||
|
||||
ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL);
|
||||
obedit = make_prim_init(C, CTX_DATA_(BLF_I18NCONTEXT_ID_MESH, "Sphere"), &dia, mat, &state, loc, rot, layer);
|
||||
obedit = make_prim_init(C, CTX_DATA_(BLF_I18NCONTEXT_ID_MESH, "Sphere"), &dia, mat, &was_editmode, loc, rot, layer);
|
||||
em = BMEdit_FromObject(obedit);
|
||||
|
||||
if (!EDBM_op_call_and_selectf(em, op, "verts.out",
|
||||
@ -480,7 +484,7 @@ static int add_primitive_uvsphere_exec(bContext *C, wmOperator *op)
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
make_prim_finish(C, obedit, &state, enter_editmode);
|
||||
make_prim_finish(C, obedit, was_editmode, enter_editmode);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
@ -516,12 +520,12 @@ static int add_primitive_icosphere_exec(bContext *C, wmOperator *op)
|
||||
Object *obedit;
|
||||
BMEditMesh *em;
|
||||
float loc[3], rot[3], mat[4][4], dia;
|
||||
int enter_editmode;
|
||||
int state;
|
||||
bool enter_editmode;
|
||||
bool was_editmode;
|
||||
unsigned int layer;
|
||||
|
||||
ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL);
|
||||
obedit = make_prim_init(C, CTX_DATA_(BLF_I18NCONTEXT_ID_MESH, "Icosphere"), &dia, mat, &state, loc, rot, layer);
|
||||
obedit = make_prim_init(C, CTX_DATA_(BLF_I18NCONTEXT_ID_MESH, "Icosphere"), &dia, mat, &was_editmode, loc, rot, layer);
|
||||
em = BMEdit_FromObject(obedit);
|
||||
|
||||
if (!EDBM_op_call_and_selectf(
|
||||
@ -533,7 +537,7 @@ static int add_primitive_icosphere_exec(bContext *C, wmOperator *op)
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
make_prim_finish(C, obedit, &state, enter_editmode);
|
||||
make_prim_finish(C, obedit, was_editmode, enter_editmode);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
@ -70,6 +70,9 @@
|
||||
|
||||
#include "mesh_intern.h" /* own include */
|
||||
|
||||
/* use bmesh operator flags for a few operators */
|
||||
#define BMO_ELE_TAG 1
|
||||
|
||||
/* ****************************** MIRROR **************** */
|
||||
|
||||
void EDBM_select_mirrored(Object *UNUSED(obedit), BMEditMesh *em, bool extend)
|
||||
@ -2419,13 +2422,12 @@ static int edbm_select_linked_exec(bContext *C, wmOperator *op)
|
||||
/* grr, shouldn't need to alloc BMO flags here */
|
||||
BM_mesh_elem_toolflags_ensure(bm);
|
||||
BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) {
|
||||
/* BMESH_TODO, don't use 'BM_ELEM_SELECT' here, its a HFLAG only! */
|
||||
BMO_elem_flag_set(bm, e, BM_ELEM_SELECT, !BM_elem_flag_test(e, BM_ELEM_SEAM));
|
||||
BMO_elem_flag_set(bm, e, BMO_ELE_TAG, !BM_elem_flag_test(e, BM_ELEM_SEAM));
|
||||
}
|
||||
}
|
||||
|
||||
BMW_init(&walker, bm, BMW_ISLAND,
|
||||
BMW_MASK_NOP, limit ? BM_ELEM_SELECT : BMW_MASK_NOP, BMW_MASK_NOP,
|
||||
BMW_MASK_NOP, limit ? BMO_ELE_TAG : BMW_MASK_NOP, BMW_MASK_NOP,
|
||||
BMW_FLAG_TEST_HIDDEN,
|
||||
BMW_NIL_LAY);
|
||||
|
||||
@ -2543,14 +2545,13 @@ static int edbm_select_linked_pick_invoke(bContext *C, wmOperator *op, const wmE
|
||||
BM_mesh_elem_toolflags_ensure(bm);
|
||||
/* hflag no-seam --> bmo-tag */
|
||||
BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) {
|
||||
/* BMESH_TODO, don't use 'BM_ELEM_SELECT' here, its a HFLAG only! */
|
||||
BMO_elem_flag_set(bm, e, BM_ELEM_SELECT, !BM_elem_flag_test(e, BM_ELEM_SEAM));
|
||||
BMO_elem_flag_set(bm, e, BMO_ELE_TAG, !BM_elem_flag_test(e, BM_ELEM_SEAM));
|
||||
}
|
||||
}
|
||||
|
||||
/* walk */
|
||||
BMW_init(&walker, bm, BMW_ISLAND,
|
||||
BMW_MASK_NOP, limit ? BM_ELEM_SELECT : BMW_MASK_NOP, BMW_MASK_NOP,
|
||||
BMW_MASK_NOP, limit ? BMO_ELE_TAG : BMW_MASK_NOP, BMW_MASK_NOP,
|
||||
BMW_FLAG_TEST_HIDDEN,
|
||||
BMW_NIL_LAY);
|
||||
|
||||
@ -2584,6 +2585,7 @@ static int edbm_select_linked_pick_invoke(bContext *C, wmOperator *op, const wmE
|
||||
}
|
||||
|
||||
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
@ -2840,19 +2842,19 @@ static void walker_deselect_nth(BMEditMesh *em, int nth, int offset, BMHeader *h
|
||||
itertype = BM_VERTS_OF_MESH;
|
||||
walktype = BMW_CONNECTED_VERTEX;
|
||||
flushtype = SCE_SELECT_VERTEX;
|
||||
mask_vert = BM_ELEM_SELECT;
|
||||
mask_vert = BMO_ELE_TAG;
|
||||
break;
|
||||
case BM_EDGE:
|
||||
itertype = BM_EDGES_OF_MESH;
|
||||
walktype = BMW_SHELL;
|
||||
flushtype = SCE_SELECT_EDGE;
|
||||
mask_edge = BM_ELEM_SELECT;
|
||||
mask_edge = BMO_ELE_TAG;
|
||||
break;
|
||||
case BM_FACE:
|
||||
itertype = BM_FACES_OF_MESH;
|
||||
walktype = BMW_ISLAND;
|
||||
flushtype = SCE_SELECT_FACE;
|
||||
mask_face = BM_ELEM_SELECT;
|
||||
mask_face = BMO_ELE_TAG;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -2864,8 +2866,7 @@ static void walker_deselect_nth(BMEditMesh *em, int nth, int offset, BMHeader *h
|
||||
BMO_push(bm, NULL);
|
||||
BM_ITER_MESH (ele, &iter, bm, itertype) {
|
||||
if (BM_elem_flag_test(ele, BM_ELEM_SELECT)) {
|
||||
/* BMESH_TODO, don't use 'BM_ELEM_SELECT' here, its a HFLAG only! */
|
||||
BMO_elem_flag_enable(bm, (BMElemF *)ele, BM_ELEM_SELECT);
|
||||
BMO_elem_flag_enable(bm, (BMElemF *)ele, BMO_ELE_TAG);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -262,13 +262,13 @@ void ED_object_add_generic_props(wmOperatorType *ot, int do_editmode)
|
||||
}
|
||||
|
||||
int ED_object_add_generic_get_opts(bContext *C, wmOperator *op, float loc[3], float rot[3],
|
||||
int *enter_editmode, unsigned int *layer, int *is_view_aligned)
|
||||
bool *enter_editmode, unsigned int *layer, bool *is_view_aligned)
|
||||
{
|
||||
View3D *v3d = CTX_wm_view3d(C);
|
||||
|
||||
/* Switch to Edit mode? */
|
||||
if (RNA_struct_find_property(op->ptr, "enter_editmode")) { /* optional */
|
||||
int _enter_editmode;
|
||||
bool _enter_editmode;
|
||||
if (!enter_editmode)
|
||||
enter_editmode = &_enter_editmode;
|
||||
|
||||
@ -330,7 +330,7 @@ int ED_object_add_generic_get_opts(bContext *C, wmOperator *op, float loc[3], fl
|
||||
|
||||
/* Rotation! */
|
||||
{
|
||||
int _is_view_aligned;
|
||||
bool _is_view_aligned;
|
||||
float _rot[3];
|
||||
if (!is_view_aligned)
|
||||
is_view_aligned = &_is_view_aligned;
|
||||
@ -338,7 +338,7 @@ int ED_object_add_generic_get_opts(bContext *C, wmOperator *op, float loc[3], fl
|
||||
rot = _rot;
|
||||
|
||||
if (RNA_struct_property_is_set(op->ptr, "rotation"))
|
||||
*is_view_aligned = FALSE;
|
||||
*is_view_aligned = false;
|
||||
else if (RNA_struct_property_is_set(op->ptr, "view_align"))
|
||||
*is_view_aligned = RNA_boolean_get(op->ptr, "view_align");
|
||||
else {
|
||||
@ -407,7 +407,7 @@ Object *ED_object_add_type(bContext *C, int type, const float loc[3], const floa
|
||||
/* for object add operator */
|
||||
static int object_add_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
int enter_editmode;
|
||||
bool enter_editmode;
|
||||
unsigned int layer;
|
||||
float loc[3], rot[3];
|
||||
|
||||
@ -444,7 +444,8 @@ void OBJECT_OT_add(wmOperatorType *ot)
|
||||
static int effector_add_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
Object *ob;
|
||||
int type, enter_editmode;
|
||||
int type;
|
||||
bool enter_editmode;
|
||||
unsigned int layer;
|
||||
float loc[3], rot[3];
|
||||
float mat[4][4];
|
||||
@ -510,7 +511,7 @@ static int object_camera_add_exec(bContext *C, wmOperator *op)
|
||||
View3D *v3d = CTX_wm_view3d(C);
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
Object *ob;
|
||||
int enter_editmode;
|
||||
bool enter_editmode;
|
||||
unsigned int layer;
|
||||
float loc[3], rot[3];
|
||||
|
||||
@ -562,8 +563,8 @@ void OBJECT_OT_camera_add(wmOperatorType *ot)
|
||||
static int object_metaball_add_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
Object *obedit = CTX_data_edit_object(C);
|
||||
int newob = 0;
|
||||
int enter_editmode;
|
||||
bool newob = false;
|
||||
bool enter_editmode;
|
||||
unsigned int layer;
|
||||
float loc[3], rot[3];
|
||||
float mat[4][4];
|
||||
@ -574,7 +575,7 @@ static int object_metaball_add_exec(bContext *C, wmOperator *op)
|
||||
|
||||
if (obedit == NULL || obedit->type != OB_MBALL) {
|
||||
obedit = ED_object_add_type(C, OB_MBALL, loc, rot, TRUE, layer);
|
||||
newob = 1;
|
||||
newob = true;
|
||||
}
|
||||
else
|
||||
DAG_id_tag_update(&obedit->id, OB_RECALC_DATA);
|
||||
@ -618,7 +619,7 @@ void OBJECT_OT_metaball_add(wmOperatorType *ot)
|
||||
static int object_add_text_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
Object *obedit = CTX_data_edit_object(C);
|
||||
int enter_editmode;
|
||||
bool enter_editmode;
|
||||
unsigned int layer;
|
||||
float loc[3], rot[3];
|
||||
|
||||
@ -658,8 +659,8 @@ static int object_armature_add_exec(bContext *C, wmOperator *op)
|
||||
Object *obedit = CTX_data_edit_object(C);
|
||||
View3D *v3d = CTX_wm_view3d(C);
|
||||
RegionView3D *rv3d = CTX_wm_region_view3d(C);
|
||||
int newob = 0;
|
||||
int enter_editmode;
|
||||
bool newob = false;
|
||||
bool enter_editmode;
|
||||
unsigned int layer;
|
||||
float loc[3], rot[3];
|
||||
|
||||
@ -669,7 +670,7 @@ static int object_armature_add_exec(bContext *C, wmOperator *op)
|
||||
if ((obedit == NULL) || (obedit->type != OB_ARMATURE)) {
|
||||
obedit = ED_object_add_type(C, OB_ARMATURE, loc, rot, TRUE, layer);
|
||||
ED_object_editmode_enter(C, 0);
|
||||
newob = 1;
|
||||
newob = true;
|
||||
}
|
||||
else {
|
||||
DAG_id_tag_update(&obedit->id, OB_RECALC_DATA);
|
||||
@ -2095,7 +2096,7 @@ void OBJECT_OT_duplicate(wmOperatorType *ot)
|
||||
static int add_named_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
wmWindow *win = CTX_wm_window(C);
|
||||
wmEvent *event = win ? win->eventstate : NULL;
|
||||
const wmEvent *event = win ? win->eventstate : NULL;
|
||||
Main *bmain = CTX_data_main(C);
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
Base *basen, *base;
|
||||
|
@ -1877,7 +1877,7 @@ void ED_region_info_draw(ARegion *ar, const char *text, int block, float fill_co
|
||||
/* setup scissor */
|
||||
glGetIntegerv(GL_SCISSOR_BOX, scissor);
|
||||
glScissor(ar->winrct.xmin + rect.xmin, ar->winrct.ymin + rect.ymin,
|
||||
BLI_rcti_size_x(&rect), BLI_rcti_size_y(&rect));
|
||||
BLI_rcti_size_x(&rect), BLI_rcti_size_y(&rect));
|
||||
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
@ -517,9 +517,9 @@ static int stencil_control_cancel(bContext *UNUSED(C), wmOperator *op)
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
static void stencil_control_calculate(StencilControlData *scd, const int *mval)
|
||||
static void stencil_control_calculate(StencilControlData *scd, const int mval[2])
|
||||
{
|
||||
#define PIXEL_MARGIN 5
|
||||
#define PIXEL_MARGIN 5
|
||||
|
||||
float mdiff[2];
|
||||
float mvalf[2] = {mval[0], mval[1]};
|
||||
@ -565,6 +565,7 @@ static void stencil_control_calculate(StencilControlData *scd, const int *mval)
|
||||
break;
|
||||
}
|
||||
}
|
||||
#undef PIXEL_MARGIN
|
||||
}
|
||||
|
||||
static int stencil_control_modal(bContext *C, wmOperator *op, const wmEvent *event)
|
||||
|
@ -588,12 +588,12 @@ static int startffmpeg(struct anim *anim)
|
||||
avpicture_fill((AVPicture *) anim->pFrameDeinterlaced,
|
||||
MEM_callocN(avpicture_get_size(
|
||||
anim->pCodecCtx->pix_fmt,
|
||||
anim->pCodecCtx->width,
|
||||
anim->pCodecCtx->height),
|
||||
anim->pCodecCtx->width,
|
||||
anim->pCodecCtx->height),
|
||||
"ffmpeg deinterlace"),
|
||||
anim->pCodecCtx->pix_fmt,
|
||||
anim->pCodecCtx->width,
|
||||
anim->pCodecCtx->height);
|
||||
anim->pCodecCtx->width,
|
||||
anim->pCodecCtx->height);
|
||||
}
|
||||
|
||||
if (pCodecCtx->has_b_frames) {
|
||||
|
@ -810,7 +810,7 @@ static IndexBuildContext *index_ffmpeg_create_context(struct anim *anim, IMB_Tim
|
||||
anim, context->iStream, proxy_sizes[i],
|
||||
context->iCodecCtx->width * proxy_fac[i],
|
||||
av_get_cropped_height_from_codec(
|
||||
context->iCodecCtx) * proxy_fac[i],
|
||||
context->iCodecCtx) * proxy_fac[i],
|
||||
quality);
|
||||
if (!context->proxy_ctx[i]) {
|
||||
proxy_sizes_in_use &= ~proxy_sizes[i];
|
||||
|
@ -354,7 +354,7 @@ static PyObject *bpy_bm_utils_edge_rotate(PyObject *UNUSED(self), PyObject *args
|
||||
|
||||
bm = py_edge->bm;
|
||||
|
||||
e_new = BM_edge_rotate(bm, py_edge->e, do_ccw, 0); /* BMESH_TODO - expose to API */
|
||||
e_new = BM_edge_rotate(bm, py_edge->e, do_ccw, 0);
|
||||
|
||||
if (e_new) {
|
||||
return BPy_BMEdge_CreatePyObject(bm, e_new);
|
||||
|
Loading…
Reference in New Issue
Block a user