[Bf-blender-cvs] [543ee79] openvdb: Cycles: fix typos (crashers) in vector grid allocation and sampling code.

Kévin Dietrich noreply at git.blender.org
Fri Jun 5 14:08:23 CEST 2015


Commit: 543ee7961bb5907f6f6b28cedebcb74780303c4b
Author: Kévin Dietrich
Date:   Thu May 28 15:37:17 2015 +0200
Branches: openvdb
https://developer.blender.org/rB543ee7961bb5907f6f6b28cedebcb74780303c4b

Cycles: fix typos (crashers) in vector grid allocation and sampling
code.

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

M	intern/cycles/render/openvdb.cpp
M	intern/cycles/util/util_openvdb.h

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

diff --git a/intern/cycles/render/openvdb.cpp b/intern/cycles/render/openvdb.cpp
index 53c128d..eea849d 100644
--- a/intern/cycles/render/openvdb.cpp
+++ b/intern/cycles/render/openvdb.cpp
@@ -165,7 +165,7 @@ size_t VolumeManager::add_openvdb_volume(const std::string& filename, const std:
 		scalar_grids.push_back(grid);
 	}
 	else if(grid_type == NODE_VDB_FLOAT3) {
-		size_t slot = find_empty_slot(float3_volumes);
+		slot = find_empty_slot(float3_volumes);
 
 		if(slot == -1) return -1;
 
diff --git a/intern/cycles/util/util_openvdb.h b/intern/cycles/util/util_openvdb.h
index 2bbadfc..54f1ac6 100644
--- a/intern/cycles/util/util_openvdb.h
+++ b/intern/cycles/util/util_openvdb.h
@@ -233,8 +233,6 @@ public:
 class vdb_float3_volume : public float3_volume {
 	typedef openvdb::tools::GridSampler<openvdb::Vec3SGrid::ConstAccessor, openvdb::tools::PointSampler> point_sampler_t;
 	typedef openvdb::tools::GridSampler<openvdb::Vec3SGrid::ConstAccessor, openvdb::tools::BoxSampler> box_sampler_t;
-	point_sampler_t *point_sampler;
-	box_sampler_t *box_sampler;
 
 	typedef openvdb::tools::VolumeRayIntersector<openvdb::Vec3SGrid> isector_t;
 	typedef isector_t::RayType vdb_ray_t;
@@ -313,7 +311,7 @@ public:
 
 			if(iter == point_samplers.end()) {
 				openvdb::Vec3SGrid::ConstAccessor *acc = new openvdb::Vec3SGrid::ConstAccessor(*accessor);
-				sampler = new point_sampler_t(*acc, point_sampler->transform());
+				sampler = new point_sampler_t(*acc, *transfrom);
 				pair<pthread_t, point_sampler_t *> sampl(thread, sampler);
 				point_samplers.insert(sampl);
 			}
@@ -329,7 +327,7 @@ public:
 
 			if(iter == box_samplers.end()) {
 				openvdb::Vec3SGrid::ConstAccessor *acc = new openvdb::Vec3SGrid::ConstAccessor(*accessor);
-				sampler = new box_sampler_t(*acc, box_sampler->transform());
+				sampler = new box_sampler_t(*acc, *transfrom);
 				pair<pthread_t, box_sampler_t *> sampl(thread, sampler);
 				box_samplers.insert(sampl);
 			}




More information about the Bf-blender-cvs mailing list