Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorErik <ecke101@gmail.com>2022-06-20 21:12:44 +0300
committerThomas Dinges <blender@dingto.org>2022-06-24 11:41:01 +0300
commit6d196b8f5e95b8f5e537f7b7910e313c27497a8b (patch)
tree53c1de46989231e57e5b5db82c823b922e2a1d63 /source
parente2c02655c78b2c669468ae568ddf4b17953cc98d (diff)
Fix T94969: Crash in Volume to Mesh with 0 voxels
Checks if voxel amount or -size is <= 0 and if so, returns early. Differential Revision: https://developer.blender.org/D15241
Diffstat (limited to 'source')
-rw-r--r--source/blender/nodes/geometry/nodes/node_geo_volume_to_mesh.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/nodes/geometry/nodes/node_geo_volume_to_mesh.cc b/source/blender/nodes/geometry/nodes/node_geo_volume_to_mesh.cc
index e5827c24320..f395b7ed440 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_volume_to_mesh.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_volume_to_mesh.cc
@@ -151,6 +151,16 @@ static Mesh *create_mesh_from_volume(GeometrySet &geometry_set, GeoNodeExecParam
}
const bke::VolumeToMeshResolution resolution = get_resolution_param(params);
+
+ if (resolution.mode == VOLUME_TO_MESH_RESOLUTION_MODE_VOXEL_SIZE &&
+ resolution.settings.voxel_size <= 0.0f) {
+ return nullptr;
+ }
+ if (resolution.mode == VOLUME_TO_MESH_RESOLUTION_MODE_VOXEL_AMOUNT &&
+ resolution.settings.voxel_amount <= 0) {
+ return nullptr;
+ }
+
const Main *bmain = DEG_get_bmain(params.depsgraph());
BKE_volume_load(volume, bmain);