Cleanup: Pass ReportList instead of wmOperator
This is more flexible and doesn't include unnecessary information.
This commit is contained in:
@@ -529,8 +529,8 @@ bool ED_mesh_color_ensure(Mesh *mesh, const char *name);
|
||||
int ED_mesh_color_add(
|
||||
Mesh *mesh, const char *name, bool active_set, bool do_init, ReportList *reports);
|
||||
|
||||
void ED_mesh_report_mirror(wmOperator *op, int totmirr, int totfail);
|
||||
void ED_mesh_report_mirror_ex(wmOperator *op, int totmirr, int totfail, char selectmode);
|
||||
void ED_mesh_report_mirror(ReportList &reports, int totmirr, int totfail);
|
||||
void ED_mesh_report_mirror_ex(ReportList &reports, int totmirr, int totfail, char selectmode);
|
||||
|
||||
KeyBlock *ED_mesh_get_edit_shape_key(const Mesh *me);
|
||||
|
||||
|
||||
@@ -4304,7 +4304,7 @@ static wmOperatorStatus edbm_select_mirror_exec(bContext *C, wmOperator *op)
|
||||
}
|
||||
|
||||
if (tot_mirr || tot_fail) {
|
||||
ED_mesh_report_mirror_ex(op, tot_mirr, tot_fail, select_mode);
|
||||
ED_mesh_report_mirror_ex(*op->reports, tot_mirr, tot_fail, select_mode);
|
||||
}
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
@@ -1088,7 +1088,7 @@ void ED_mesh_geometry_clear(Mesh *mesh)
|
||||
|
||||
/** \} */
|
||||
|
||||
void ED_mesh_report_mirror_ex(wmOperator *op, int totmirr, int totfail, char selectmode)
|
||||
void ED_mesh_report_mirror_ex(ReportList &reports, int totmirr, int totfail, char selectmode)
|
||||
{
|
||||
const char *elem_type;
|
||||
|
||||
@@ -1103,17 +1103,16 @@ void ED_mesh_report_mirror_ex(wmOperator *op, int totmirr, int totfail, char sel
|
||||
}
|
||||
|
||||
if (totfail) {
|
||||
BKE_reportf(
|
||||
op->reports, RPT_WARNING, "%d %s mirrored, %d failed", totmirr, elem_type, totfail);
|
||||
BKE_reportf(&reports, RPT_WARNING, "%d %s mirrored, %d failed", totmirr, elem_type, totfail);
|
||||
}
|
||||
else {
|
||||
BKE_reportf(op->reports, RPT_INFO, "%d %s mirrored", totmirr, elem_type);
|
||||
BKE_reportf(&reports, RPT_INFO, "%d %s mirrored", totmirr, elem_type);
|
||||
}
|
||||
}
|
||||
|
||||
void ED_mesh_report_mirror(wmOperator *op, int totmirr, int totfail)
|
||||
void ED_mesh_report_mirror(ReportList &reports, int totmirr, int totfail)
|
||||
{
|
||||
ED_mesh_report_mirror_ex(op, totmirr, totfail, SCE_SELECT_VERTEX);
|
||||
ED_mesh_report_mirror_ex(reports, totmirr, totfail, SCE_SELECT_VERTEX);
|
||||
}
|
||||
|
||||
KeyBlock *ED_mesh_get_edit_shape_key(const Mesh *me)
|
||||
|
||||
@@ -626,7 +626,7 @@ static wmOperatorStatus shape_key_mirror_exec(bContext *C, wmOperator *op)
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
ED_mesh_report_mirror(op, totmirr, totfail);
|
||||
ED_mesh_report_mirror(*op->reports, totmirr, totfail);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
@@ -3702,7 +3702,7 @@ static wmOperatorStatus vertex_group_mirror_exec(bContext *C, wmOperator *op)
|
||||
&totmirr,
|
||||
&totfail);
|
||||
|
||||
ED_mesh_report_mirror(op, totmirr, totfail);
|
||||
ED_mesh_report_mirror(*op->reports, totmirr, totfail);
|
||||
|
||||
DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY);
|
||||
DEG_relations_tag_update(CTX_data_main(C));
|
||||
|
||||
Reference in New Issue
Block a user