Cleanup: use designated initializes for mesh extract structs
Better readability and allows adding new struct members without adding empty slots to every 'MeshExtract' struct.
This commit is contained in:
parent
38c9deeb5a
commit
5a6145f32c
|
@ -511,29 +511,55 @@ BLI_INLINE const float *bm_face_no_get(const MeshRenderData *mr, const BMFace *e
|
|||
* \{ */
|
||||
|
||||
typedef void *(ExtractInitFn)(const MeshRenderData *mr, void *buffer);
|
||||
typedef void(ExtractEditTriFn)(const MeshRenderData *mr, int t, BMLoop **e, void *data);
|
||||
typedef void(ExtractEditLoopFn)(const MeshRenderData *mr, int l, BMLoop *el, void *data);
|
||||
typedef void(ExtractEditLedgeFn)(const MeshRenderData *mr, int e, BMEdge *ed, void *data);
|
||||
typedef void(ExtractEditLvertFn)(const MeshRenderData *mr, int v, BMVert *ev, void *data);
|
||||
typedef void(ExtractTriFn)(const MeshRenderData *mr, int t, const MLoopTri *mlt, void *data);
|
||||
typedef void(ExtractLoopFn)(
|
||||
const MeshRenderData *mr, int l, const MLoop *mloop, int p, const MPoly *mpoly, void *data);
|
||||
typedef void(ExtractLedgeFn)(const MeshRenderData *mr, int e, const MEdge *medge, void *data);
|
||||
typedef void(ExtractLvertFn)(const MeshRenderData *mr, int v, const MVert *mvert, void *data);
|
||||
|
||||
typedef void(ExtractTriBMeshFn)(const MeshRenderData *mr,
|
||||
int tri_index,
|
||||
BMLoop **ltri,
|
||||
void *data);
|
||||
typedef void(ExtractTriMeshFn)(const MeshRenderData *mr,
|
||||
int tri_index,
|
||||
const MLoopTri *mlt,
|
||||
void *data);
|
||||
|
||||
typedef void(ExtractLoopBMeshFn)(const MeshRenderData *mr, int loop_index, BMLoop *el, void *data);
|
||||
typedef void(ExtractLoopMeshFn)(const MeshRenderData *mr,
|
||||
int loop_index,
|
||||
const MLoop *mloop,
|
||||
int poly_index,
|
||||
const MPoly *mpoly,
|
||||
void *data);
|
||||
|
||||
typedef void(ExtractLEdgeBMeshFn)(const MeshRenderData *mr,
|
||||
int ledge_index,
|
||||
BMEdge *eed,
|
||||
void *data);
|
||||
typedef void(ExtractLEdgeMeshFn)(const MeshRenderData *mr,
|
||||
int ledge_index,
|
||||
const MEdge *medge,
|
||||
void *data);
|
||||
|
||||
typedef void(ExtractLVertBMeshFn)(const MeshRenderData *mr,
|
||||
int lvert_index,
|
||||
BMVert *eve,
|
||||
void *data);
|
||||
typedef void(ExtractLVertFn)(const MeshRenderData *mr,
|
||||
int lvert_index,
|
||||
const MVert *mvert,
|
||||
void *data);
|
||||
typedef void(ExtractFinishFn)(const MeshRenderData *mr, void *buffer, void *data);
|
||||
|
||||
typedef struct MeshExtract {
|
||||
/** Executed on main thread and return user data for iteration functions. */
|
||||
ExtractInitFn *init;
|
||||
/** Executed on one (or more if use_threading) worker thread(s). */
|
||||
ExtractEditTriFn *iter_looptri_bm;
|
||||
ExtractTriFn *iter_looptri;
|
||||
ExtractEditLoopFn *iter_loop_bm;
|
||||
ExtractLoopFn *iter_loop;
|
||||
ExtractEditLedgeFn *iter_ledge_bm;
|
||||
ExtractLedgeFn *iter_ledge;
|
||||
ExtractEditLvertFn *iter_lvert_bm;
|
||||
ExtractLvertFn *iter_lvert;
|
||||
ExtractTriBMeshFn *iter_looptri_bm;
|
||||
ExtractTriMeshFn *iter_looptri_mesh;
|
||||
ExtractLoopBMeshFn *iter_loop_bm;
|
||||
ExtractLoopMeshFn *iter_loop_mesh;
|
||||
ExtractLEdgeBMeshFn *iter_ledge_bm;
|
||||
ExtractLEdgeMeshFn *iter_ledge_mesh;
|
||||
ExtractLVertBMeshFn *iter_lvert_bm;
|
||||
ExtractLVertFn *iter_lvert_mesh;
|
||||
/** Executed on one worker thread after all elements iterations. */
|
||||
ExtractFinishFn *finish;
|
||||
/** Used to request common data. */
|
||||
|
@ -545,10 +571,10 @@ typedef struct MeshExtract {
|
|||
BLI_INLINE eMRIterType mesh_extract_iter_type(const MeshExtract *ext)
|
||||
{
|
||||
eMRIterType type = 0;
|
||||
SET_FLAG_FROM_TEST(type, (ext->iter_looptri_bm || ext->iter_looptri), MR_ITER_LOOPTRI);
|
||||
SET_FLAG_FROM_TEST(type, (ext->iter_loop_bm || ext->iter_loop), MR_ITER_LOOP);
|
||||
SET_FLAG_FROM_TEST(type, (ext->iter_ledge_bm || ext->iter_ledge), MR_ITER_LEDGE);
|
||||
SET_FLAG_FROM_TEST(type, (ext->iter_lvert_bm || ext->iter_lvert), MR_ITER_LVERT);
|
||||
SET_FLAG_FROM_TEST(type, (ext->iter_looptri_bm || ext->iter_looptri_mesh), MR_ITER_LOOPTRI);
|
||||
SET_FLAG_FROM_TEST(type, (ext->iter_loop_bm || ext->iter_loop_mesh), MR_ITER_LOOP);
|
||||
SET_FLAG_FROM_TEST(type, (ext->iter_ledge_bm || ext->iter_ledge_mesh), MR_ITER_LEDGE);
|
||||
SET_FLAG_FROM_TEST(type, (ext->iter_lvert_bm || ext->iter_lvert_mesh), MR_ITER_LVERT);
|
||||
return type;
|
||||
}
|
||||
|
||||
|
@ -664,18 +690,12 @@ static void extract_tris_finish(const MeshRenderData *mr, void *ibo, void *_data
|
|||
}
|
||||
|
||||
static const MeshExtract extract_tris = {
|
||||
extract_tris_init,
|
||||
extract_tris_looptri_bmesh,
|
||||
extract_tris_looptri_mesh,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
extract_tris_finish,
|
||||
0,
|
||||
false,
|
||||
.init = extract_tris_init,
|
||||
.iter_looptri_bm = extract_tris_looptri_bmesh,
|
||||
.iter_looptri_mesh = extract_tris_looptri_mesh,
|
||||
.finish = extract_tris_finish,
|
||||
.data_flag = 0,
|
||||
.use_threading = false,
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
@ -767,18 +787,14 @@ static void extract_lines_finish(const MeshRenderData *UNUSED(mr), void *ibo, vo
|
|||
}
|
||||
|
||||
static const MeshExtract extract_lines = {
|
||||
extract_lines_init,
|
||||
NULL,
|
||||
NULL,
|
||||
extract_lines_loop_bmesh,
|
||||
extract_lines_loop_mesh,
|
||||
extract_lines_ledge_bmesh,
|
||||
extract_lines_ledge_mesh,
|
||||
NULL,
|
||||
NULL,
|
||||
extract_lines_finish,
|
||||
0,
|
||||
false,
|
||||
.init = extract_lines_init,
|
||||
.iter_loop_bm = extract_lines_loop_bmesh,
|
||||
.iter_loop_mesh = extract_lines_loop_mesh,
|
||||
.iter_ledge_bm = extract_lines_ledge_bmesh,
|
||||
.iter_ledge_mesh = extract_lines_ledge_mesh,
|
||||
.finish = extract_lines_finish,
|
||||
.data_flag = 0,
|
||||
.use_threading = false,
|
||||
};
|
||||
/** \} */
|
||||
|
||||
|
@ -805,18 +821,14 @@ static void extract_lines_with_lines_loose_finish(const MeshRenderData *mr, void
|
|||
}
|
||||
|
||||
static const MeshExtract extract_lines_with_lines_loose = {
|
||||
extract_lines_init,
|
||||
NULL,
|
||||
NULL,
|
||||
extract_lines_loop_bmesh,
|
||||
extract_lines_loop_mesh,
|
||||
extract_lines_ledge_bmesh,
|
||||
extract_lines_ledge_mesh,
|
||||
NULL,
|
||||
NULL,
|
||||
extract_lines_with_lines_loose_finish,
|
||||
0,
|
||||
false,
|
||||
.init = extract_lines_init,
|
||||
.iter_loop_bm = extract_lines_loop_bmesh,
|
||||
.iter_loop_mesh = extract_lines_loop_mesh,
|
||||
.iter_ledge_bm = extract_lines_ledge_bmesh,
|
||||
.iter_ledge_mesh = extract_lines_ledge_mesh,
|
||||
.finish = extract_lines_with_lines_loose_finish,
|
||||
.data_flag = 0,
|
||||
.use_threading = false,
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
@ -912,18 +924,16 @@ static void extract_points_finish(const MeshRenderData *UNUSED(mr), void *ibo, v
|
|||
}
|
||||
|
||||
static const MeshExtract extract_points = {
|
||||
extract_points_init,
|
||||
NULL,
|
||||
NULL,
|
||||
extract_points_loop_bmesh,
|
||||
extract_points_loop_mesh,
|
||||
extract_points_ledge_bmesh,
|
||||
extract_points_ledge_mesh,
|
||||
extract_points_lvert_bmesh,
|
||||
extract_points_lvert_mesh,
|
||||
extract_points_finish,
|
||||
0,
|
||||
false,
|
||||
.init = extract_points_init,
|
||||
.iter_loop_bm = extract_points_loop_bmesh,
|
||||
.iter_loop_mesh = extract_points_loop_mesh,
|
||||
.iter_ledge_bm = extract_points_ledge_bmesh,
|
||||
.iter_ledge_mesh = extract_points_ledge_mesh,
|
||||
.iter_lvert_bm = extract_points_lvert_bmesh,
|
||||
.iter_lvert_mesh = extract_points_lvert_mesh,
|
||||
.finish = extract_points_finish,
|
||||
.data_flag = 0,
|
||||
.use_threading = false,
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
@ -977,18 +987,12 @@ static void extract_fdots_finish(const MeshRenderData *UNUSED(mr), void *ibo, vo
|
|||
}
|
||||
|
||||
static const MeshExtract extract_fdots = {
|
||||
extract_fdots_init,
|
||||
NULL,
|
||||
NULL,
|
||||
extract_fdots_loop_bmesh,
|
||||
extract_fdots_loop_mesh,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
extract_fdots_finish,
|
||||
0,
|
||||
false,
|
||||
.init = extract_fdots_init,
|
||||
.iter_loop_bm = extract_fdots_loop_bmesh,
|
||||
.iter_loop_mesh = extract_fdots_loop_mesh,
|
||||
.finish = extract_fdots_finish,
|
||||
.data_flag = 0,
|
||||
.use_threading = false,
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
@ -1059,18 +1063,11 @@ static void extract_lines_paint_mask_finish(const MeshRenderData *UNUSED(mr),
|
|||
}
|
||||
|
||||
static const MeshExtract extract_lines_paint_mask = {
|
||||
extract_lines_paint_mask_init,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
extract_lines_paint_mask_loop_mesh,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
extract_lines_paint_mask_finish,
|
||||
0,
|
||||
false,
|
||||
.init = extract_lines_paint_mask_init,
|
||||
.iter_loop_mesh = extract_lines_paint_mask_loop_mesh,
|
||||
.finish = extract_lines_paint_mask_finish,
|
||||
.data_flag = 0,
|
||||
.use_threading = false,
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
@ -1211,18 +1208,12 @@ static void extract_lines_adjacency_finish(const MeshRenderData *mr, void *ibo,
|
|||
#undef NO_EDGE
|
||||
|
||||
static const MeshExtract extract_lines_adjacency = {
|
||||
extract_lines_adjacency_init,
|
||||
extract_lines_adjacency_looptri_bmesh,
|
||||
extract_lines_adjacency_looptri_mesh,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
extract_lines_adjacency_finish,
|
||||
0,
|
||||
false,
|
||||
.init = extract_lines_adjacency_init,
|
||||
.iter_looptri_bm = extract_lines_adjacency_looptri_bmesh,
|
||||
.iter_looptri_mesh = extract_lines_adjacency_looptri_mesh,
|
||||
.finish = extract_lines_adjacency_finish,
|
||||
.data_flag = 0,
|
||||
.use_threading = false,
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
@ -1287,18 +1278,12 @@ static void extract_edituv_tris_finish(const MeshRenderData *UNUSED(mr), void *i
|
|||
}
|
||||
|
||||
static const MeshExtract extract_edituv_tris = {
|
||||
extract_edituv_tris_init,
|
||||
extract_edituv_tris_looptri_bmesh,
|
||||
extract_edituv_tris_looptri_mesh,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
extract_edituv_tris_finish,
|
||||
0,
|
||||
false,
|
||||
.init = extract_edituv_tris_init,
|
||||
.iter_looptri_bm = extract_edituv_tris_looptri_bmesh,
|
||||
.iter_looptri_mesh = extract_edituv_tris_looptri_mesh,
|
||||
.finish = extract_edituv_tris_finish,
|
||||
.data_flag = 0,
|
||||
.use_threading = false,
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
@ -1361,18 +1346,12 @@ static void extract_edituv_lines_finish(const MeshRenderData *UNUSED(mr), void *
|
|||
}
|
||||
|
||||
static const MeshExtract extract_edituv_lines = {
|
||||
extract_edituv_lines_init,
|
||||
NULL,
|
||||
NULL,
|
||||
extract_edituv_lines_loop_bmesh,
|
||||
extract_edituv_lines_loop_mesh,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
extract_edituv_lines_finish,
|
||||
0,
|
||||
false,
|
||||
.init = extract_edituv_lines_init,
|
||||
.iter_loop_bm = extract_edituv_lines_loop_bmesh,
|
||||
.iter_loop_mesh = extract_edituv_lines_loop_mesh,
|
||||
.finish = extract_edituv_lines_finish,
|
||||
.data_flag = 0,
|
||||
.use_threading = false,
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
@ -1432,18 +1411,12 @@ static void extract_edituv_points_finish(const MeshRenderData *UNUSED(mr), void
|
|||
}
|
||||
|
||||
static const MeshExtract extract_edituv_points = {
|
||||
extract_edituv_points_init,
|
||||
NULL,
|
||||
NULL,
|
||||
extract_edituv_points_loop_bmesh,
|
||||
extract_edituv_points_loop_mesh,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
extract_edituv_points_finish,
|
||||
0,
|
||||
false,
|
||||
.init = extract_edituv_points_init,
|
||||
.iter_loop_bm = extract_edituv_points_loop_bmesh,
|
||||
.iter_loop_mesh = extract_edituv_points_loop_mesh,
|
||||
.finish = extract_edituv_points_finish,
|
||||
.data_flag = 0,
|
||||
.use_threading = false,
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
@ -1510,18 +1483,12 @@ static void extract_edituv_fdots_finish(const MeshRenderData *UNUSED(mr), void *
|
|||
}
|
||||
|
||||
static const MeshExtract extract_edituv_fdots = {
|
||||
extract_edituv_fdots_init,
|
||||
NULL,
|
||||
NULL,
|
||||
extract_edituv_fdots_loop_bmesh,
|
||||
extract_edituv_fdots_loop_mesh,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
extract_edituv_fdots_finish,
|
||||
0,
|
||||
false,
|
||||
.init = extract_edituv_fdots_init,
|
||||
.iter_loop_bm = extract_edituv_fdots_loop_bmesh,
|
||||
.iter_loop_mesh = extract_edituv_fdots_loop_mesh,
|
||||
.finish = extract_edituv_fdots_finish,
|
||||
.data_flag = 0,
|
||||
.use_threading = false,
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
@ -1665,18 +1632,16 @@ static void extract_pos_nor_finish(const MeshRenderData *UNUSED(mr), void *UNUSE
|
|||
}
|
||||
|
||||
static const MeshExtract extract_pos_nor = {
|
||||
extract_pos_nor_init,
|
||||
NULL,
|
||||
NULL,
|
||||
extract_pos_nor_loop_bmesh,
|
||||
extract_pos_nor_loop_mesh,
|
||||
extract_pos_nor_ledge_bmesh,
|
||||
extract_pos_nor_ledge_mesh,
|
||||
extract_pos_nor_lvert_bmesh,
|
||||
extract_pos_nor_lvert_mesh,
|
||||
extract_pos_nor_finish,
|
||||
0,
|
||||
true,
|
||||
.init = extract_pos_nor_init,
|
||||
.iter_loop_bm = extract_pos_nor_loop_bmesh,
|
||||
.iter_loop_mesh = extract_pos_nor_loop_mesh,
|
||||
.iter_ledge_bm = extract_pos_nor_ledge_bmesh,
|
||||
.iter_ledge_mesh = extract_pos_nor_ledge_mesh,
|
||||
.iter_lvert_bm = extract_pos_nor_lvert_bmesh,
|
||||
.iter_lvert_mesh = extract_pos_nor_lvert_mesh,
|
||||
.finish = extract_pos_nor_finish,
|
||||
.data_flag = 0,
|
||||
.use_threading = true,
|
||||
};
|
||||
/** \} */
|
||||
|
||||
|
@ -1746,18 +1711,11 @@ static void extract_lnor_hq_loop_mesh(
|
|||
}
|
||||
|
||||
static const MeshExtract extract_lnor_hq = {
|
||||
extract_lnor_hq_init,
|
||||
NULL,
|
||||
NULL,
|
||||
extract_lnor_hq_loop_bmesh,
|
||||
extract_lnor_hq_loop_mesh,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
MR_DATA_LOOP_NOR,
|
||||
true,
|
||||
.init = extract_lnor_hq_init,
|
||||
.iter_loop_bm = extract_lnor_hq_loop_bmesh,
|
||||
.iter_loop_mesh = extract_lnor_hq_loop_mesh,
|
||||
.data_flag = MR_DATA_LOOP_NOR,
|
||||
.use_threading = true,
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
@ -1825,18 +1783,11 @@ static void extract_lnor_loop_mesh(
|
|||
}
|
||||
|
||||
static const MeshExtract extract_lnor = {
|
||||
extract_lnor_init,
|
||||
NULL,
|
||||
NULL,
|
||||
extract_lnor_loop_bmesh,
|
||||
extract_lnor_loop_mesh,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
MR_DATA_LOOP_NOR,
|
||||
true,
|
||||
.init = extract_lnor_init,
|
||||
.iter_loop_bm = extract_lnor_loop_bmesh,
|
||||
.iter_loop_mesh = extract_lnor_loop_mesh,
|
||||
.data_flag = MR_DATA_LOOP_NOR,
|
||||
.use_threading = true,
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
@ -1931,18 +1882,9 @@ static void *extract_uv_init(const MeshRenderData *mr, void *buf)
|
|||
}
|
||||
|
||||
static const MeshExtract extract_uv = {
|
||||
extract_uv_init,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
0,
|
||||
false,
|
||||
.init = extract_uv_init,
|
||||
.data_flag = 0,
|
||||
.use_threading = false,
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
@ -2127,18 +2069,9 @@ static void *extract_tan_init(const MeshRenderData *mr, void *buf)
|
|||
}
|
||||
|
||||
static const MeshExtract extract_tan = {
|
||||
extract_tan_init,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
MR_DATA_POLY_NOR | MR_DATA_TAN_LOOP_NOR | MR_DATA_LOOPTRI,
|
||||
false,
|
||||
.init = extract_tan_init,
|
||||
.data_flag = MR_DATA_POLY_NOR | MR_DATA_TAN_LOOP_NOR | MR_DATA_LOOPTRI,
|
||||
.use_threading = false,
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
@ -2154,18 +2087,9 @@ static void *extract_tan_hq_init(const MeshRenderData *mr, void *buf)
|
|||
}
|
||||
|
||||
static const MeshExtract extract_tan_hq = {
|
||||
extract_tan_hq_init,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
MR_DATA_POLY_NOR | MR_DATA_TAN_LOOP_NOR | MR_DATA_LOOPTRI,
|
||||
false,
|
||||
.init = extract_tan_hq_init,
|
||||
.data_flag = MR_DATA_POLY_NOR | MR_DATA_TAN_LOOP_NOR | MR_DATA_LOOPTRI,
|
||||
.use_threading = false,
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
@ -2311,17 +2235,9 @@ static void *extract_vcol_init(const MeshRenderData *mr, void *buf)
|
|||
}
|
||||
|
||||
static const MeshExtract extract_vcol = {
|
||||
extract_vcol_init,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
0,
|
||||
false,
|
||||
.init = extract_vcol_init,
|
||||
.data_flag = 0,
|
||||
.use_threading = false,
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
@ -2390,18 +2306,12 @@ static void extract_orco_finish(const MeshRenderData *UNUSED(mr), void *UNUSED(b
|
|||
}
|
||||
|
||||
static const MeshExtract extract_orco = {
|
||||
extract_orco_init,
|
||||
NULL,
|
||||
NULL,
|
||||
extract_orco_loop_bmesh,
|
||||
extract_orco_loop_mesh,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
extract_orco_finish,
|
||||
0,
|
||||
true,
|
||||
.init = extract_orco_init,
|
||||
.iter_loop_bm = extract_orco_loop_bmesh,
|
||||
.iter_loop_mesh = extract_orco_loop_mesh,
|
||||
.finish = extract_orco_finish,
|
||||
.data_flag = 0,
|
||||
.use_threading = true,
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
@ -2569,18 +2479,14 @@ static void extract_edge_fac_finish(const MeshRenderData *mr, void *buf, void *_
|
|||
}
|
||||
|
||||
static const MeshExtract extract_edge_fac = {
|
||||
extract_edge_fac_init,
|
||||
NULL,
|
||||
NULL,
|
||||
extract_edge_fac_loop_bmesh,
|
||||
extract_edge_fac_loop_mesh,
|
||||
extract_edge_fac_ledge_bmesh,
|
||||
extract_edge_fac_ledge_mesh,
|
||||
NULL,
|
||||
NULL,
|
||||
extract_edge_fac_finish,
|
||||
MR_DATA_POLY_NOR,
|
||||
false,
|
||||
.init = extract_edge_fac_init,
|
||||
.iter_loop_bm = extract_edge_fac_loop_bmesh,
|
||||
.iter_loop_mesh = extract_edge_fac_loop_mesh,
|
||||
.iter_ledge_bm = extract_edge_fac_ledge_bmesh,
|
||||
.iter_ledge_mesh = extract_edge_fac_ledge_mesh,
|
||||
.finish = extract_edge_fac_finish,
|
||||
.data_flag = MR_DATA_POLY_NOR,
|
||||
.use_threading = false,
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
@ -2707,18 +2613,12 @@ static void extract_weights_finish(const MeshRenderData *UNUSED(mr), void *UNUSE
|
|||
}
|
||||
|
||||
static const MeshExtract extract_weights = {
|
||||
extract_weights_init,
|
||||
NULL,
|
||||
NULL,
|
||||
extract_weights_loop_bmesh,
|
||||
extract_weights_loop_mesh,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
extract_weights_finish,
|
||||
0,
|
||||
true,
|
||||
.init = extract_weights_init,
|
||||
.iter_loop_bm = extract_weights_loop_bmesh,
|
||||
.iter_loop_mesh = extract_weights_loop_mesh,
|
||||
.finish = extract_weights_finish,
|
||||
.data_flag = 0,
|
||||
.use_threading = true,
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
@ -2975,18 +2875,15 @@ static void extract_edit_data_lvert_mesh(const MeshRenderData *mr,
|
|||
}
|
||||
|
||||
static const MeshExtract extract_edit_data = {
|
||||
extract_edit_data_init,
|
||||
NULL,
|
||||
NULL,
|
||||
extract_edit_data_loop_bmesh,
|
||||
extract_edit_data_loop_mesh,
|
||||
extract_edit_data_ledge_bmesh,
|
||||
extract_edit_data_ledge_mesh,
|
||||
extract_edit_data_lvert_bmesh,
|
||||
extract_edit_data_lvert_mesh,
|
||||
NULL,
|
||||
0,
|
||||
true,
|
||||
.init = extract_edit_data_init,
|
||||
.iter_loop_bm = extract_edit_data_loop_bmesh,
|
||||
.iter_loop_mesh = extract_edit_data_loop_mesh,
|
||||
.iter_ledge_bm = extract_edit_data_ledge_bmesh,
|
||||
.iter_ledge_mesh = extract_edit_data_ledge_mesh,
|
||||
.iter_lvert_bm = extract_edit_data_lvert_bmesh,
|
||||
.iter_lvert_mesh = extract_edit_data_lvert_mesh,
|
||||
.data_flag = 0,
|
||||
.use_threading = true,
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
@ -3076,18 +2973,12 @@ static void extract_edituv_data_finish(const MeshRenderData *UNUSED(mr),
|
|||
}
|
||||
|
||||
static const MeshExtract extract_edituv_data = {
|
||||
extract_edituv_data_init,
|
||||
NULL,
|
||||
NULL,
|
||||
extract_edituv_data_loop_bmesh,
|
||||
extract_edituv_data_loop_mesh,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
extract_edituv_data_finish,
|
||||
0,
|
||||
true,
|
||||
.init = extract_edituv_data_init,
|
||||
.iter_loop_bm = extract_edituv_data_loop_bmesh,
|
||||
.iter_loop_mesh = extract_edituv_data_loop_mesh,
|
||||
.finish = extract_edituv_data_finish,
|
||||
.data_flag = 0,
|
||||
.use_threading = true,
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
@ -3201,18 +3092,10 @@ static void mesh_stretch_area_finish(const MeshRenderData *mr, void *buf, void *
|
|||
}
|
||||
|
||||
static const MeshExtract extract_stretch_area = {
|
||||
extract_stretch_area_init,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
mesh_stretch_area_finish,
|
||||
0,
|
||||
false,
|
||||
.init = extract_stretch_area_init,
|
||||
.finish = mesh_stretch_area_finish,
|
||||
.data_flag = 0,
|
||||
.use_threading = false,
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
@ -3400,18 +3283,12 @@ static void extract_stretch_angle_finish(const MeshRenderData *UNUSED(mr),
|
|||
}
|
||||
|
||||
static const MeshExtract extract_stretch_angle = {
|
||||
extract_stretch_angle_init,
|
||||
NULL,
|
||||
NULL,
|
||||
extract_stretch_angle_loop_bmesh,
|
||||
extract_stretch_angle_loop_mesh,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
extract_stretch_angle_finish,
|
||||
0,
|
||||
false,
|
||||
.init = extract_stretch_angle_init,
|
||||
.iter_loop_bm = extract_stretch_angle_loop_bmesh,
|
||||
.iter_loop_mesh = extract_stretch_angle_loop_mesh,
|
||||
.finish = extract_stretch_angle_finish,
|
||||
.data_flag = 0,
|
||||
.use_threading = false,
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
@ -4009,20 +3886,12 @@ static void extract_mesh_analysis_finish(const MeshRenderData *mr, void *buf, vo
|
|||
}
|
||||
|
||||
static const MeshExtract extract_mesh_analysis = {
|
||||
extract_mesh_analysis_init,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
extract_mesh_analysis_finish,
|
||||
.init = extract_mesh_analysis_init,
|
||||
.finish = extract_mesh_analysis_finish,
|
||||
/* This is not needed for all visualization types.
|
||||
* Maybe split into different extract. */
|
||||
MR_DATA_POLY_NOR | MR_DATA_LOOPTRI,
|
||||
false,
|
||||
* * Maybe split into different extract. */
|
||||
.data_flag = MR_DATA_POLY_NOR | MR_DATA_LOOPTRI,
|
||||
.use_threading = false,
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
@ -4078,18 +3947,11 @@ static void extract_fdots_pos_loop_mesh(const MeshRenderData *mr,
|
|||
}
|
||||
|
||||
static const MeshExtract extract_fdots_pos = {
|
||||
extract_fdots_pos_init,
|
||||
NULL,
|
||||
NULL,
|
||||
extract_fdots_pos_loop_bmesh,
|
||||
extract_fdots_pos_loop_mesh,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
0,
|
||||
true,
|
||||
.init = extract_fdots_pos_init,
|
||||
.iter_loop_bm = extract_fdots_pos_loop_bmesh,
|
||||
.iter_loop_mesh = extract_fdots_pos_loop_mesh,
|
||||
.data_flag = 0,
|
||||
.use_threading = true,
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
@ -4162,18 +4024,10 @@ static void extract_fdots_nor_finish(const MeshRenderData *mr, void *buf, void *
|
|||
}
|
||||
|
||||
static const MeshExtract extract_fdots_nor = {
|
||||
extract_fdots_nor_init,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
extract_fdots_nor_finish,
|
||||
MR_DATA_POLY_NOR,
|
||||
false,
|
||||
.init = extract_fdots_nor_init,
|
||||
.finish = extract_fdots_nor_finish,
|
||||
.data_flag = MR_DATA_POLY_NOR,
|
||||
.use_threading = false,
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
@ -4252,18 +4106,12 @@ static void extract_fdots_uv_finish(const MeshRenderData *UNUSED(mr),
|
|||
}
|
||||
|
||||
static const MeshExtract extract_fdots_uv = {
|
||||
extract_fdots_uv_init,
|
||||
NULL,
|
||||
NULL,
|
||||
extract_fdots_uv_loop_bmesh,
|
||||
extract_fdots_uv_loop_mesh,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
extract_fdots_uv_finish,
|
||||
0,
|
||||
true,
|
||||
.init = extract_fdots_uv_init,
|
||||
.iter_loop_bm = extract_fdots_uv_loop_bmesh,
|
||||
.iter_loop_mesh = extract_fdots_uv_loop_mesh,
|
||||
.finish = extract_fdots_uv_finish,
|
||||
.data_flag = 0,
|
||||
.use_threading = true,
|
||||
};
|
||||
/** \} */
|
||||
|
||||
|
@ -4327,18 +4175,12 @@ static void extract_fdots_edituv_data_finish(const MeshRenderData *UNUSED(mr),
|
|||
}
|
||||
|
||||
static const MeshExtract extract_fdots_edituv_data = {
|
||||
extract_fdots_edituv_data_init,
|
||||
NULL,
|
||||
NULL,
|
||||
extract_fdots_edituv_data_loop_bmesh,
|
||||
extract_fdots_edituv_data_loop_mesh,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
extract_fdots_edituv_data_finish,
|
||||
0,
|
||||
true,
|
||||
.init = extract_fdots_edituv_data_init,
|
||||
.iter_loop_bm = extract_fdots_edituv_data_loop_bmesh,
|
||||
.iter_loop_mesh = extract_fdots_edituv_data_loop_mesh,
|
||||
.finish = extract_fdots_edituv_data_finish,
|
||||
.data_flag = 0,
|
||||
.use_threading = true,
|
||||
};
|
||||
/** \} */
|
||||
|
||||
|
@ -4389,18 +4231,9 @@ static void *extract_skin_roots_init(const MeshRenderData *mr, void *buf)
|
|||
}
|
||||
|
||||
static const MeshExtract extract_skin_roots = {
|
||||
extract_skin_roots_init,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
0,
|
||||
false,
|
||||
.init = extract_skin_roots_init,
|
||||
.data_flag = 0,
|
||||
.use_threading = false,
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
@ -4531,48 +4364,33 @@ static void extract_vert_idx_lvert_mesh(const MeshRenderData *mr,
|
|||
}
|
||||
|
||||
static const MeshExtract extract_poly_idx = {
|
||||
extract_select_idx_init,
|
||||
NULL,
|
||||
NULL,
|
||||
extract_poly_idx_loop_bmesh,
|
||||
extract_poly_idx_loop_mesh,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
0,
|
||||
true,
|
||||
.init = extract_select_idx_init,
|
||||
.iter_loop_bm = extract_poly_idx_loop_bmesh,
|
||||
.iter_loop_mesh = extract_poly_idx_loop_mesh,
|
||||
.data_flag = 0,
|
||||
.use_threading = true,
|
||||
};
|
||||
|
||||
static const MeshExtract extract_edge_idx = {
|
||||
extract_select_idx_init,
|
||||
NULL,
|
||||
NULL,
|
||||
extract_edge_idx_loop_bmesh,
|
||||
extract_edge_idx_loop_mesh,
|
||||
extract_edge_idx_ledge_bmesh,
|
||||
extract_edge_idx_ledge_mesh,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
0,
|
||||
true,
|
||||
.init = extract_select_idx_init,
|
||||
.iter_loop_bm = extract_edge_idx_loop_bmesh,
|
||||
.iter_loop_mesh = extract_edge_idx_loop_mesh,
|
||||
.iter_ledge_bm = extract_edge_idx_ledge_bmesh,
|
||||
.iter_ledge_mesh = extract_edge_idx_ledge_mesh,
|
||||
.data_flag = 0,
|
||||
.use_threading = true,
|
||||
};
|
||||
|
||||
static const MeshExtract extract_vert_idx = {
|
||||
extract_select_idx_init,
|
||||
NULL,
|
||||
NULL,
|
||||
extract_vert_idx_loop_bmesh,
|
||||
extract_vert_idx_loop_mesh,
|
||||
extract_vert_idx_ledge_bmesh,
|
||||
extract_vert_idx_ledge_mesh,
|
||||
extract_vert_idx_lvert_bmesh,
|
||||
extract_vert_idx_lvert_mesh,
|
||||
NULL,
|
||||
0,
|
||||
true,
|
||||
.init = extract_select_idx_init,
|
||||
.iter_loop_bm = extract_vert_idx_loop_bmesh,
|
||||
.iter_loop_mesh = extract_vert_idx_loop_mesh,
|
||||
.iter_ledge_bm = extract_vert_idx_ledge_bmesh,
|
||||
.iter_ledge_mesh = extract_vert_idx_ledge_mesh,
|
||||
.iter_lvert_bm = extract_vert_idx_lvert_bmesh,
|
||||
.iter_lvert_mesh = extract_vert_idx_lvert_mesh,
|
||||
.data_flag = 0,
|
||||
.use_threading = true,
|
||||
};
|
||||
|
||||
static void *extract_select_fdot_idx_init(const MeshRenderData *mr, void *buf)
|
||||
|
@ -4607,18 +4425,11 @@ static void extract_fdot_idx_loop_mesh(const MeshRenderData *mr,
|
|||
}
|
||||
|
||||
static const MeshExtract extract_fdot_idx = {
|
||||
extract_select_fdot_idx_init,
|
||||
NULL,
|
||||
NULL,
|
||||
extract_fdot_idx_loop_bmesh,
|
||||
extract_fdot_idx_loop_mesh,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
0,
|
||||
true,
|
||||
.init = extract_select_fdot_idx_init,
|
||||
.iter_loop_bm = extract_fdot_idx_loop_bmesh,
|
||||
.iter_loop_mesh = extract_fdot_idx_loop_mesh,
|
||||
.data_flag = 0,
|
||||
.use_threading = true,
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
@ -4737,7 +4548,7 @@ BLI_INLINE void mesh_extract_iter(const MeshRenderData *mr,
|
|||
if (iter_type & MR_ITER_LOOPTRI) {
|
||||
int t_end = min_ii(mr->tri_len, end);
|
||||
for (int t = start; t < t_end; t++) {
|
||||
extract->iter_looptri(mr, t, &mr->mlooptri[t], user_data);
|
||||
extract->iter_looptri_mesh(mr, t, &mr->mlooptri[t], user_data);
|
||||
}
|
||||
}
|
||||
if (iter_type & MR_ITER_LOOP) {
|
||||
|
@ -4746,20 +4557,20 @@ BLI_INLINE void mesh_extract_iter(const MeshRenderData *mr,
|
|||
const MPoly *mpoly = &mr->mpoly[p];
|
||||
int l = mpoly->loopstart;
|
||||
for (int i = 0; i < mpoly->totloop; i++, l++) {
|
||||
extract->iter_loop(mr, l, &mr->mloop[l], p, mpoly, user_data);
|
||||
extract->iter_loop_mesh(mr, l, &mr->mloop[l], p, mpoly, user_data);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (iter_type & MR_ITER_LEDGE) {
|
||||
int le_end = min_ii(mr->edge_loose_len, end);
|
||||
for (int e = start; e < le_end; e++) {
|
||||
extract->iter_ledge(mr, e, &mr->medge[mr->ledges[e]], user_data);
|
||||
extract->iter_ledge_mesh(mr, e, &mr->medge[mr->ledges[e]], user_data);
|
||||
}
|
||||
}
|
||||
if (iter_type & MR_ITER_LVERT) {
|
||||
int lv_end = min_ii(mr->vert_loose_len, end);
|
||||
for (int v = start; v < lv_end; v++) {
|
||||
extract->iter_lvert(mr, v, &mr->mvert[mr->lverts[v]], user_data);
|
||||
extract->iter_lvert_mesh(mr, v, &mr->mvert[mr->lverts[v]], user_data);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue