diff options
author | Jacques Lucke <jacques@blender.org> | 2020-09-29 17:02:40 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-09-29 17:03:30 +0300 |
commit | 5845c06a63a6b96f038f5a46d538b0f9737102e9 (patch) | |
tree | 9a2bf0a1e90e6e37c60fcbf357c64874f258ab86 /source/blender/blenkernel/BKE_volume.h | |
parent | e12767a0352a9e113892b4a07c6c8446d3ff361f (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.h | 12 |
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 |