Fix #108108: Remesh modifier crash with empty result
Caused by 7966cd16d6
This commit is contained in:
@@ -227,9 +227,11 @@ static Mesh *remesh_voxel_volume_to_mesh(const openvdb::FloatGrid::Ptr level_set
|
||||
MutableSpan<int> poly_offsets = mesh->poly_offsets_for_write();
|
||||
MutableSpan<int> mesh_corner_verts = mesh->corner_verts_for_write();
|
||||
|
||||
poly_offsets.take_front(quads.size()).fill(4);
|
||||
poly_offsets.drop_front(quads.size()).fill(3);
|
||||
blender::offset_indices::accumulate_counts_to_offsets(poly_offsets);
|
||||
if (!poly_offsets.is_empty()) {
|
||||
poly_offsets.take_front(quads.size()).fill(4);
|
||||
poly_offsets.drop_front(quads.size()).fill(3);
|
||||
blender::offset_indices::accumulate_counts_to_offsets(poly_offsets);
|
||||
}
|
||||
|
||||
for (const int i : vert_positions.index_range()) {
|
||||
vert_positions[i] = float3(vertices[i].x(), vertices[i].y(), vertices[i].z());
|
||||
|
||||
@@ -188,7 +188,6 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext * /*ctx*/, M
|
||||
rmd->scale,
|
||||
rmd->depth));
|
||||
BLI_mutex_unlock(&dualcon_mutex);
|
||||
output->mesh->poly_offsets_for_write().last() = output->mesh->totloop;
|
||||
result = output->mesh;
|
||||
MEM_freeN(output);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user