Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2020-09-29 17:02:40 +0300
committerJacques Lucke <jacques@blender.org>2020-09-29 17:03:30 +0300
commit5845c06a63a6b96f038f5a46d538b0f9737102e9 (patch)
tree9a2bf0a1e90e6e37c60fcbf357c64874f258ab86 /source/blender/blenkernel/BKE_volume.h
parente12767a0352a9e113892b4a07c6c8446d3ff361f (diff)
Volumes: new Mesh to Volume modifier
This modifier can only be added to Volume objects. It takes a mesh as input and generates a "density" grid near the surface or in the enclosed volume. Ref T73201. Reviewers: brecht Differential Revision: https://developer.blender.org/D9032
Diffstat (limited to 'source/blender/blenkernel/BKE_volume.h')
-rw-r--r--source/blender/blenkernel/BKE_volume.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_volume.h b/source/blender/blenkernel/BKE_volume.h
index b3437454f31..4481c1b4332 100644
--- a/source/blender/blenkernel/BKE_volume.h
+++ b/source/blender/blenkernel/BKE_volume.h
@@ -157,4 +157,16 @@ openvdb::GridBase::ConstPtr BKE_volume_grid_openvdb_for_read(const struct Volume
openvdb::GridBase::Ptr BKE_volume_grid_openvdb_for_write(const struct Volume *volume,
struct VolumeGrid *grid,
const bool clear);
+
+template<typename GridType>
+typename GridType::Ptr BKE_volume_grid_openvdb_for_write(const struct Volume *volume,
+ struct VolumeGrid *grid,
+ const bool clear)
+{
+ openvdb::GridBase::Ptr openvdb_grid = BKE_volume_grid_openvdb_for_write(volume, grid, clear);
+ BLI_assert(openvdb_grid->isType<GridType>());
+ typename GridType::Ptr typed_openvdb_grid = openvdb::gridPtrCast<GridType>(openvdb_grid);
+ return typed_openvdb_grid;
+}
+
#endif