Cleanup: update naming for dualcon: rename loop corner_verts
These weren't the equivalent of MLoop's even with the old naming this was misleading, especially `DualConInput::mloop`.
This commit is contained in:
@@ -15,10 +15,10 @@ typedef float (*DualConCo)[3];
|
||||
|
||||
typedef unsigned int (*DualConTri)[3];
|
||||
|
||||
typedef unsigned int *DualConLoop;
|
||||
typedef unsigned int *DualConCornerVerts;
|
||||
|
||||
typedef struct DualConInput {
|
||||
DualConLoop mloop;
|
||||
DualConCornerVerts corner_verts;
|
||||
|
||||
DualConCo co;
|
||||
int co_stride;
|
||||
@@ -28,7 +28,7 @@ typedef struct DualConInput {
|
||||
int tri_stride;
|
||||
int tottri;
|
||||
|
||||
int loop_stride;
|
||||
int corner_verts_stride;
|
||||
|
||||
float min[3], max[3];
|
||||
} DualConInput;
|
||||
|
||||
@@ -26,8 +26,8 @@ static void veccopy(float dst[3], const float src[3])
|
||||
|
||||
#define GET_CO(_mesh, _n) (*(DualConCo)(((char *)(_mesh)->co) + ((_n) * (_mesh)->co_stride)))
|
||||
|
||||
#define GET_LOOP(_mesh, _n) \
|
||||
(*(DualConLoop)(((char *)(_mesh)->mloop) + ((_n) * (_mesh)->loop_stride)))
|
||||
#define GET_CORNER_VERT(_mesh, _n) \
|
||||
(*(DualConCornerVerts)(((char *)(_mesh)->corner_verts) + ((_n) * (_mesh)->corner_verts_stride)))
|
||||
|
||||
class DualConInputReader : public ModelReader {
|
||||
private:
|
||||
@@ -80,9 +80,9 @@ class DualConInputReader : public ModelReader {
|
||||
Triangle *t = new Triangle();
|
||||
|
||||
const unsigned int *tr = GET_TRI(input_mesh, curtri);
|
||||
veccopy(t->vt[0], GET_CO(input_mesh, GET_LOOP(input_mesh, tr[0])));
|
||||
veccopy(t->vt[1], GET_CO(input_mesh, GET_LOOP(input_mesh, tr[1])));
|
||||
veccopy(t->vt[2], GET_CO(input_mesh, GET_LOOP(input_mesh, tr[2])));
|
||||
veccopy(t->vt[0], GET_CO(input_mesh, GET_CORNER_VERT(input_mesh, tr[0])));
|
||||
veccopy(t->vt[1], GET_CO(input_mesh, GET_CORNER_VERT(input_mesh, tr[1])));
|
||||
veccopy(t->vt[2], GET_CO(input_mesh, GET_CORNER_VERT(input_mesh, tr[2])));
|
||||
|
||||
curtri++;
|
||||
|
||||
|
||||
@@ -61,8 +61,8 @@ static void init_dualcon_mesh(DualConInput *input, Mesh *mesh)
|
||||
input->co_stride = sizeof(blender::float3);
|
||||
input->totco = mesh->verts_num;
|
||||
|
||||
input->mloop = (DualConLoop)mesh->corner_verts().data();
|
||||
input->loop_stride = sizeof(int);
|
||||
input->corner_verts = (DualConCornerVerts)mesh->corner_verts().data();
|
||||
input->corner_verts_stride = sizeof(int);
|
||||
|
||||
input->corner_tris = (DualConTri)mesh->corner_tris().data();
|
||||
input->tri_stride = sizeof(blender::int3);
|
||||
@@ -130,14 +130,8 @@ static void dualcon_add_quad(void *output_v, const int vert_indices[4])
|
||||
static Mesh *modify_mesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh *mesh)
|
||||
{
|
||||
using namespace blender;
|
||||
RemeshModifierData *rmd;
|
||||
DualConOutput *output;
|
||||
DualConInput input;
|
||||
RemeshModifierData *rmd = (RemeshModifierData *)md;
|
||||
Mesh *result;
|
||||
DualConFlags flags = DualConFlags(0);
|
||||
DualConMode mode = DualConMode(0);
|
||||
|
||||
rmd = (RemeshModifierData *)md;
|
||||
|
||||
if (rmd->mode == MOD_REMESH_VOXEL) {
|
||||
/* OpenVDB modes. */
|
||||
@@ -156,6 +150,11 @@ static Mesh *modify_mesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
DualConOutput *output;
|
||||
DualConInput input;
|
||||
DualConFlags flags = DualConFlags(0);
|
||||
DualConMode mode = DualConMode(0);
|
||||
|
||||
/* Dualcon modes. */
|
||||
init_dualcon_mesh(&input, mesh);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user