[Bf-blender-cvs] [3d04df0] openvdb: Added an assert to catch non-uniform grids earlier.

Lukas Tönne noreply at git.blender.org
Sun Nov 13 21:44:50 CET 2016


Commit: 3d04df097a6d338763ac20a7f3faa92212ea8466
Author: Lukas Tönne
Date:   Sun Nov 13 11:25:49 2016 +0100
Branches: openvdb
https://developer.blender.org/rB3d04df097a6d338763ac20a7f3faa92212ea8466

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.

===================================================================

M	intern/cycles/render/volume.cpp

===================================================================

diff --git a/intern/cycles/render/volume.cpp b/intern/cycles/render/volume.cpp
index e6b4931..473d4a1 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>()) {




More information about the Bf-blender-cvs mailing list