[Bf-blender-cvs] [ef264e1] openvdb: Cleanup: deduplicate check to see if a given grid exists in the file.

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


Commit: ef264e1bb010ece405c8fe72fddafc4ee4a8021b
Author: Kévin Dietrich
Date:   Sat Jun 13 01:16:55 2015 +0200
Branches: openvdb
https://developer.blender.org/rBef264e1bb010ece405c8fe72fddafc4ee4a8021b

Cleanup: deduplicate check to see if a given grid exists in the file.

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

M	intern/cycles/render/openvdb.cpp

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

diff --git a/intern/cycles/render/openvdb.cpp b/intern/cycles/render/openvdb.cpp
index 44468f4..2d6b8fd 100644
--- a/intern/cycles/render/openvdb.cpp
+++ b/intern/cycles/render/openvdb.cpp
@@ -175,14 +175,13 @@ size_t VolumeManager::add_openvdb_volume(const std::string& filename, const std:
 	io::File file(filename);
 	file.open();
 
-	if (!file.hasGrid(name)) return -1;
+	if(!file.hasGrid(name)) return -1;
 
 	if(grid_type == NODE_VDB_FLOAT) {
 		slot = find_empty_slot(float_volumes);
 
 		if(slot == -1) return -1;
 
-		if (!file.hasGrid(name)) return -1;
 		FloatGrid::Ptr grid = gridPtrCast<FloatGrid>(file.readGrid(name));
 		vdb_float_volume *sampler = new vdb_float_volume(grid);
 
@@ -194,7 +193,6 @@ size_t VolumeManager::add_openvdb_volume(const std::string& filename, const std:
 
 		if(slot == -1) return -1;
 
-		if (!file.hasGrid(name)) return -1;
 		Vec3SGrid::Ptr grid = gridPtrCast<Vec3SGrid>(file.readGrid(name));
 		vdb_float3_volume *sampler = new vdb_float3_volume(grid);




More information about the Bf-blender-cvs mailing list