OpenVDB: Fix compilation error against OpenVDB 4
[blender.git] / intern / openvdb / intern / openvdb_writer.cc
index 923752909d93f8960ea4d7db7c68fcb55e173364..e886c5a76a8c2cfbd81b425c76901bb7c0b47ace 100644 (file)
@@ -45,7 +45,11 @@ void OpenVDBWriter::insert(const openvdb::GridBase::Ptr &grid)
 
 void OpenVDBWriter::insert(const openvdb::GridBase &grid)
 {
+#if (OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER == 3)
        m_grids->push_back(grid.copyGrid());
+#else
+       m_grids->push_back(grid.copyGridWithNewTree());
+#endif
 }
 
 void OpenVDBWriter::insertFloatMeta(const openvdb::Name &name, const float value)