forked from bartvdbraak/blender
- remove edge collapse loop operator (now replaced by dissolve).
- fix missing null pointer check from own recent changes. - add asserts if BLI path functions are given wrong id's
This commit is contained in:
parent
46808dd22c
commit
bb42703ea3
@ -1222,6 +1222,9 @@ const char *BLI_get_folder(int folder_id, const char *subfolder)
|
|||||||
if (get_path_local(path, "python", subfolder, ver)) break;
|
if (get_path_local(path, "python", subfolder, ver)) break;
|
||||||
if (get_path_system(path, "python", subfolder, "BLENDER_SYSTEM_PYTHON", ver)) break;
|
if (get_path_system(path, "python", subfolder, "BLENDER_SYSTEM_PYTHON", ver)) break;
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
default:
|
||||||
|
BLI_assert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
return path;
|
return path;
|
||||||
@ -1248,6 +1251,8 @@ const char *BLI_get_user_folder_notest(int folder_id, const char *subfolder)
|
|||||||
case BLENDER_USER_SCRIPTS:
|
case BLENDER_USER_SCRIPTS:
|
||||||
get_path_user(path, "scripts", subfolder, "BLENDER_USER_SCRIPTS", ver);
|
get_path_user(path, "scripts", subfolder, "BLENDER_USER_SCRIPTS", ver);
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
BLI_assert(0);
|
||||||
}
|
}
|
||||||
if ('\0' == path[0]) {
|
if ('\0' == path[0]) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -2392,16 +2392,18 @@ static void deselect_nth_active(BMEditMesh *em, BMVert **r_eve, BMEdge **r_eed,
|
|||||||
EDBM_selectmode_flush(em);
|
EDBM_selectmode_flush(em);
|
||||||
ele = BM_mesh_active_elem_get(em->bm);
|
ele = BM_mesh_active_elem_get(em->bm);
|
||||||
|
|
||||||
switch (ele->head.htype) {
|
if (ele) {
|
||||||
case BM_VERT:
|
switch (ele->head.htype) {
|
||||||
*r_eve = (BMVert *)ele;
|
case BM_VERT:
|
||||||
return;
|
*r_eve = (BMVert *)ele;
|
||||||
case BM_EDGE:
|
return;
|
||||||
*r_eed = (BMEdge *)ele;
|
case BM_EDGE:
|
||||||
return;
|
*r_eed = (BMEdge *)ele;
|
||||||
case BM_FACE:
|
return;
|
||||||
*r_efa = (BMFace *)ele;
|
case BM_FACE:
|
||||||
return;
|
*r_efa = (BMFace *)ele;
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (em->selectmode & SCE_SELECT_VERTEX) {
|
if (em->selectmode & SCE_SELECT_VERTEX) {
|
||||||
|
@ -407,34 +407,6 @@ void MESH_OT_edge_collapse(wmOperatorType *ot)
|
|||||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int edbm_collapse_edge_loop_exec(bContext *C, wmOperator *op)
|
|
||||||
{
|
|
||||||
Object *obedit = CTX_data_edit_object(C);
|
|
||||||
BMEditMesh *em = BKE_editmesh_from_object(obedit);
|
|
||||||
|
|
||||||
if (!EDBM_op_callf(em, op, "dissolve_edge_loop edges=%he", BM_ELEM_SELECT))
|
|
||||||
return OPERATOR_CANCELLED;
|
|
||||||
|
|
||||||
EDBM_update_generic(em, true, true);
|
|
||||||
|
|
||||||
return OPERATOR_FINISHED;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MESH_OT_edge_collapse_loop(wmOperatorType *ot)
|
|
||||||
{
|
|
||||||
/* identifiers */
|
|
||||||
ot->name = "Edge Collapse Loop";
|
|
||||||
ot->description = "Collapse selected edge loops";
|
|
||||||
ot->idname = "MESH_OT_edge_collapse_loop";
|
|
||||||
|
|
||||||
/* api callbacks */
|
|
||||||
ot->exec = edbm_collapse_edge_loop_exec;
|
|
||||||
ot->poll = ED_operator_editmesh;
|
|
||||||
|
|
||||||
/* flags */
|
|
||||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int edbm_add_edge_face__smooth_get(BMesh *bm)
|
static int edbm_add_edge_face__smooth_get(BMesh *bm)
|
||||||
{
|
{
|
||||||
BMEdge *e;
|
BMEdge *e;
|
||||||
|
@ -180,7 +180,6 @@ void MESH_OT_colors_rotate(struct wmOperatorType *ot);
|
|||||||
void MESH_OT_colors_reverse(struct wmOperatorType *ot);
|
void MESH_OT_colors_reverse(struct wmOperatorType *ot);
|
||||||
void MESH_OT_delete(struct wmOperatorType *ot);
|
void MESH_OT_delete(struct wmOperatorType *ot);
|
||||||
void MESH_OT_edge_collapse(struct wmOperatorType *ot);
|
void MESH_OT_edge_collapse(struct wmOperatorType *ot);
|
||||||
void MESH_OT_edge_collapse_loop(struct wmOperatorType *ot);
|
|
||||||
void MESH_OT_faces_shade_smooth(struct wmOperatorType *ot);
|
void MESH_OT_faces_shade_smooth(struct wmOperatorType *ot);
|
||||||
void MESH_OT_faces_shade_flat(struct wmOperatorType *ot);
|
void MESH_OT_faces_shade_flat(struct wmOperatorType *ot);
|
||||||
void MESH_OT_split(struct wmOperatorType *ot);
|
void MESH_OT_split(struct wmOperatorType *ot);
|
||||||
|
@ -119,7 +119,6 @@ void ED_operatortypes_mesh(void)
|
|||||||
|
|
||||||
WM_operatortype_append(MESH_OT_delete);
|
WM_operatortype_append(MESH_OT_delete);
|
||||||
WM_operatortype_append(MESH_OT_edge_collapse);
|
WM_operatortype_append(MESH_OT_edge_collapse);
|
||||||
WM_operatortype_append(MESH_OT_edge_collapse_loop);
|
|
||||||
|
|
||||||
WM_operatortype_append(MESH_OT_separate);
|
WM_operatortype_append(MESH_OT_separate);
|
||||||
WM_operatortype_append(MESH_OT_dupli_extrude_cursor);
|
WM_operatortype_append(MESH_OT_dupli_extrude_cursor);
|
||||||
|
Loading…
Reference in New Issue
Block a user