Mesh: Rename MLoopTri variable names, and functions
Make the naming consistent with the recent change from "loop" to "corner". Avoid the need for a special type for these triangles by conveying the semantics in the naming instead. - `looptris` -> `corner_tris` - `lt` -> `tri` (or `corner_tri` when there is less context) - `looptri_index` -> `tri_index` (or `corner_tri_index`) - `lt->tri[0]` -> `tri[0]` - `Span<MLoopTri>` -> `Span<int3>` - `looptri_faces` -> `tri_faces` (or `corner_tri_faces`) If we followed the naming pattern of "corner_verts" and "edge_verts" exactly, we'd probably use "tri_corners" instead. But that sounds much worse and less intuitive to me. I've found that by using standard vector types for this sort of data, the commonalities with other areas become much clearer, and code ends up being naturally more data oriented. Besides that, the consistency is nice, and we get to mostly remove use of `DNA_meshdata_types.h`. Pull Request: https://projects.blender.org/blender/blender/pulls/116238
This commit is contained in:
@@ -26,7 +26,7 @@ typedef struct DualConInput {
|
||||
int co_stride;
|
||||
int totco;
|
||||
|
||||
DualConTri looptris;
|
||||
DualConTri corner_tris;
|
||||
int tri_stride;
|
||||
int tottri;
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ static void veccopy(float dst[3], const float src[3])
|
||||
}
|
||||
|
||||
#define GET_TRI(_mesh, _n) \
|
||||
(*(DualConTri)(((char *)(_mesh)->looptris) + ((_n) * (_mesh)->tri_stride)))
|
||||
(*(DualConTri)(((char *)(_mesh)->corner_tris) + ((_n) * (_mesh)->tri_stride)))
|
||||
|
||||
#define GET_CO(_mesh, _n) (*(DualConCo)(((char *)(_mesh)->co) + ((_n) * (_mesh)->co_stride)))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user