30template<
typename T>
struct VolumeGridTraits {
34 using BlenderType = void;
42 using TreeType = void;
49template<>
struct VolumeGridTraits<bool> {
50 using BlenderType = bool;
52 using TreeType = openvdb::BoolTree;
55 static bool to_openvdb(
const bool &value)
59 static bool to_blender(
const bool &value)
65template<>
struct VolumeGridTraits<int> {
66 using BlenderType = int;
68 using TreeType = openvdb::Int32Tree;
71 static int to_openvdb(
const int &value)
75 static int to_blender(
const int &value)
81template<>
struct VolumeGridTraits<
float> {
82 using BlenderType =
float;
84 using TreeType = openvdb::FloatTree;
87 static float to_openvdb(
const float &value)
91 static float to_blender(
const float &value)
97template<>
struct VolumeGridTraits<
float3> {
98 using BlenderType =
float3;
100 using TreeType = openvdb::Vec3STree;
103 static openvdb::Vec3f to_openvdb(
const float3 &value)
105 return openvdb::Vec3f(value.
x, value.
y, value.
z);
107 static float3 to_blender(
const openvdb::Vec3f &value)
109 return float3(value.asV());
113template<
typename T>
using OpenvdbTreeType =
typename VolumeGridTraits<T>::TreeType;
114template<
typename T>
using OpenvdbGridType = openvdb::Grid<OpenvdbTreeType<T>>;
@ VOLUME_GRID_VECTOR_FLOAT
VecBase< float, 3 > float3
VecBase< float, 3 > float3