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
diff options
context:
space:
mode:
authorLukas Tönne <lukas.toenne@gmail.com>2016-11-13 13:25:49 +0300
committerLukas Tönne <lukas.toenne@gmail.com>2016-11-13 13:25:49 +0300
commit3d04df097a6d338763ac20a7f3faa92212ea8466 (patch)
tree0dae8024085d6f96056f56d7553f2eb2b5481652
parent54318700dd16a3bab16c796d6aea1d3f6b6c5c01 (diff)
Added an assert to catch non-uniform grids earlier.
OpenVDB ray intersectors only support uniform grids. This should be checked as early as possible to allow feedback to the Cycles user (i.e. the Blender app). For now the assert just prevents exceptions from OpenVDB itself, until a transparent mechanism for this is implemented.
-rw-r--r--intern/cycles/render/volume.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/intern/cycles/render/volume.cpp b/intern/cycles/render/volume.cpp
index e6b49311baf..473d4a191ee 100644
--- a/intern/cycles/render/volume.cpp
+++ b/intern/cycles/render/volume.cpp
@@ -273,6 +273,11 @@ size_t VolumeManager::add_openvdb_volume(Volume *volume, const std::string &file
openvdb::FloatGrid::Ptr fgrid = openvdb::gridPtrCast<openvdb::FloatGrid>(grid);
volume->scalar_grids.push_back(fgrid);
+ /* XXX Ray intersectors only support uniform grids.
+ * Can we make this transparent somehow? - lukas
+ */
+ assert(fgrid->hasUniformVoxels());
+
slot = num_float_volume++;
}
else if(grid->isType<openvdb::Vec3SGrid>()) {