Sculpt-dev: fix compile errors from merge.

This commit is contained in:
Joseph Eagar 2022-04-15 20:03:50 -07:00
parent ecbf681e31
commit ae555c3219
3 changed files with 21 additions and 67 deletions

View File

@ -298,7 +298,7 @@ Mesh *BKE_mesh_remesh_instant_meshes(const Mesh *input_mesh,
}
int *fsets = (int *)CustomData_get_layer(&input_mesh->pdata, CD_SCULPT_FACE_SETS);
for (const int i : IndexRange(input_mesh->totedge)) {
MEdge *me = input_mesh->medge + i;
MeshElemMap *mep = epmap + i;
@ -863,26 +863,35 @@ void BKE_remesh_reproject_vertex_paint(Mesh *target, const Mesh *source)
else {
/* Lazily init vertex -> loop maps. */
if (!source_lmap) {
const MPoly *source_polys = (MPoly *)CustomData_get_layer(&source->pdata, CD_MPOLY);
const MVert *source_verts = (MVert *)CustomData_get_layer(&source->vdata, CD_MVERT);
const MEdge *source_edges = (MEdge *)CustomData_get_layer(&source->edata, CD_MEDGE);
const MLoop *source_loops = (MLoop *)CustomData_get_layer(&source->ldata, CD_MLOOP);
const MPoly *target_polys = (MPoly *)CustomData_get_layer(&target->pdata, CD_MPOLY);
const MPoly *source_polys = (MPoly *)CustomData_get_layer(&source->pdata, CD_MPOLY);
const MEdge *target_edges = (MEdge *)CustomData_get_layer(&target->edata, CD_MEDGE);
const MLoop *target_loops = (MLoop *)CustomData_get_layer(&target->ldata, CD_MLOOP);
const MPoly *target_polys = (MPoly *)CustomData_get_layer(&target->pdata, CD_MPOLY);
BKE_mesh_vert_loop_map_create(&source_lmap,
&source_lmap_mem,
source_verts,
source_edges,
source_polys,
source_loops,
source->totvert,
source->totpoly,
source->totloop);
source->totloop,
false);
BKE_mesh_vert_loop_map_create(&target_lmap,
&target_lmap_mem,
target_verts,
target_edges,
target_polys,
target_loops,
target->totvert,
target->totpoly,
target->totloop);
target->totloop,
false);
}
for (int i = 0; i < target->totvert; i++) {

View File

@ -293,16 +293,19 @@ static void sculpt_color_presmooth_init(SculptSession *ss)
}
for (int i = 0; i < totvert; i++) {
SCULPT_vertex_color_get(ss, i, ss->filter_cache->pre_smoothed_color[i]);
SculptVertRef vertex = BKE_pbvh_table_index_to_vertex(ss->pbvh, i);
SCULPT_vertex_color_get(ss, vertex, ss->filter_cache->pre_smoothed_color[i]);
}
for (int iteration = 0; iteration < 2; iteration++) {
for (int i = 0; i < totvert; i++) {
float avg[4] = {0.0f, 0.0f, 0.0f, 0.0f};
int total = 0;
SculptVertRef vertex = BKE_pbvh_table_index_to_vertex(ss->pbvh, i);
SculptVertexNeighborIter ni;
SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN (ss, i, ni) {
SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN (ss, vertex, ni) {
float col[4] = {0};
copy_v4_v4(col, ss->filter_cache->pre_smoothed_color[ni.index]);

View File

@ -495,66 +495,6 @@ typedef struct AutomaskingCache {
SculptCustomLayer *factorlayer;
} AutomaskingCache;
typedef struct FilterCache {
bool enabled_axis[3];
bool enabled_force_axis[3];
int random_seed;
/* Used for alternating between filter operations in filters that need to apply different ones to
* achieve certain effects. */
int iteration_count;
/* Stores the displacement produced by the laplacian step of HC smooth. */
float (*surface_smooth_laplacian_disp)[3];
float surface_smooth_shape_preservation;
float surface_smooth_current_vertex;
/* Sharpen mesh filter. */
float sharpen_smooth_ratio;
float sharpen_intensify_detail_strength;
int sharpen_curvature_smooth_iterations;
float *sharpen_factor;
float (*detail_directions)[3];
/* Filter orientation. */
SculptFilterOrientation orientation;
float obmat[4][4];
float obmat_inv[4][4];
float viewmat[4][4];
float viewmat_inv[4][4];
/* Displacement eraser. */
float (*limit_surface_co)[3];
/* unmasked nodes */
PBVHNode **nodes;
int totnode;
/* Cloth filter. */
SculptClothSimulation *cloth_sim;
float cloth_sim_pinch_point[3];
/* mask expand iteration caches */
int mask_update_current_it;
int mask_update_last_it;
int *mask_update_it;
float *normal_factor;
float *edge_factor;
float *prev_mask;
float mask_expand_initial_co[3];
int new_face_set;
int *prev_face_set;
int active_face_set;
/* Auto-masking. */
AutomaskingCache *automasking;
/* Pre-smoothed colors used by sharpening. Colors are HSL. */
float (*pre_smoothed_color)[4];
} FilterCache;
/**
* This structure contains all the temporary data
* needed for individual brush strokes.
@ -1066,6 +1006,8 @@ typedef struct FilterCache {
bool hard_edge_mode;
float bound_smooth_radius;
float bevel_smooth_fac;
float (*pre_smoothed_color)[3];
} FilterCache;
typedef struct SculptCurvatureData {