[Bf-blender-cvs] [c219639] openvdb: Cycles: do not consider level set grids.

Kévin Dietrich noreply at git.blender.org
Sat Jun 13 03:45:52 CEST 2015


Commit: c2196395d659b69a08cb0c71684cebcc9d4aa2d7
Author: Kévin Dietrich
Date:   Sat Jun 13 01:51:48 2015 +0200
Branches: openvdb
https://developer.blender.org/rBc2196395d659b69a08cb0c71684cebcc9d4aa2d7

Cycles: do not consider level set grids.

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

M	intern/cycles/render/openvdb.cpp

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

diff --git a/intern/cycles/render/openvdb.cpp b/intern/cycles/render/openvdb.cpp
index 2d6b8fd..00520b8 100644
--- a/intern/cycles/render/openvdb.cpp
+++ b/intern/cycles/render/openvdb.cpp
@@ -177,27 +177,30 @@ size_t VolumeManager::add_openvdb_volume(const std::string& filename, const std:
 
 	if(!file.hasGrid(name)) return -1;
 
+	GridBase::Ptr grid = file.readGrid(name);
+	if(grid->getGridClass() == GRID_LEVEL_SET) return -1;
+
 	if(grid_type == NODE_VDB_FLOAT) {
 		slot = find_empty_slot(float_volumes);
 
 		if(slot == -1) return -1;
 
-		FloatGrid::Ptr grid = gridPtrCast<FloatGrid>(file.readGrid(name));
-		vdb_float_volume *sampler = new vdb_float_volume(grid);
+		FloatGrid::Ptr fgrid = gridPtrCast<FloatGrid>(grid);
 
+		vdb_float_volume *sampler = new vdb_float_volume(fgrid);
 		float_volumes.insert(float_volumes.begin() + slot, sampler);
-		scalar_grids.push_back(grid);
+		scalar_grids.push_back(fgrid);
 	}
 	else if(grid_type == NODE_VDB_FLOAT3) {
 		slot = find_empty_slot(float3_volumes);
 
 		if(slot == -1) return -1;
 
-		Vec3SGrid::Ptr grid = gridPtrCast<Vec3SGrid>(file.readGrid(name));
-		vdb_float3_volume *sampler = new vdb_float3_volume(grid);
+		Vec3SGrid::Ptr vgrid = gridPtrCast<Vec3SGrid>(grid);
 
+		vdb_float3_volume *sampler = new vdb_float3_volume(vgrid);
 		float3_volumes.insert(float3_volumes.begin() + slot, sampler);
-		vector_grids.push_back(grid);
+		vector_grids.push_back(vgrid);
 	}
 #else
 	(void)filename;




More information about the Bf-blender-cvs mailing list