[Bf-blender-cvs] [a9729e6] master: Fix T48236: OpenVDB smoke cache glitches out with smokeless flames.

Kévin Dietrich noreply at git.blender.org
Fri Apr 22 11:47:06 CEST 2016


Commit: a9729e6d75c74f48c6135df710f117435e7ff2f3
Author: Kévin Dietrich
Date:   Fri Apr 22 11:46:02 2016 +0200
Branches: master
https://developer.blender.org/rBa9729e6d75c74f48c6135df710f117435e7ff2f3

Fix T48236: OpenVDB smoke cache glitches out with smokeless flames.

Issue was that before writing to disk grids are clipped against the
density field's tree to optimize for memory/disk space, which in the
case of simulations with no density field results in all grids having
empty trees.

For now avoid clipping against empty grids, but perhaps in the future it
can be interresting to have some UI parameters to let the user choose
the grid used for clipping.

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

M	intern/openvdb/intern/openvdb_dense_convert.cc
M	intern/openvdb/intern/openvdb_dense_convert.h

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

diff --git a/intern/openvdb/intern/openvdb_dense_convert.cc b/intern/openvdb/intern/openvdb_dense_convert.cc
index d4f6277..ef52408 100644
--- a/intern/openvdb/intern/openvdb_dense_convert.cc
+++ b/intern/openvdb/intern/openvdb_dense_convert.cc
@@ -115,7 +115,8 @@ openvdb::GridBase *OpenVDB_export_vector_grid(
 
 	vecgrid->setTransform(transform);
 
-	if (mask) {
+	/* Avoid clipping against an empty grid. */
+	if (mask && !mask->tree().empty()) {
 		vecgrid = tools::clip(*vecgrid, *mask);
 	}
 
diff --git a/intern/openvdb/intern/openvdb_dense_convert.h b/intern/openvdb/intern/openvdb_dense_convert.h
index fd10334..284fd1c 100644
--- a/intern/openvdb/intern/openvdb_dense_convert.h
+++ b/intern/openvdb/intern/openvdb_dense_convert.h
@@ -64,7 +64,8 @@ GridType *OpenVDB_export_grid(
 
 	grid->setTransform(transform);
 
-	if (mask) {
+	/* Avoid clipping against an empty grid. */
+	if (mask && !mask->tree().empty()) {
 		grid = tools::clip(*grid, *mask);
 	}




More information about the Bf-blender-cvs mailing list