OpenVDB 13.0.0

Loading...
Searching...
No Matches
openvdb_houdini Namespace Reference

## Namespaces
namespace | node_info_text
| Namespace to hold functionality for registering info text callbacks. Whenever getNodeSpecificInfoText() is called, the default info text is added to MMB output unless a valid callback has been registered for the grid type.

## Classes
class | AttributeDetailBase
class | AttributeDetail
class | MeshAttrTransfer
class | PointAttrTransfer
struct | AttributeCopyBase
struct | AttributeCopy
struct | StrAttributeCopy
class | TransferPrimitiveAttributesOp
class | TransferPointAttributesOp
class | GT_GEOPrimCollectVDB
class | TransformOp
| TBB body object for threaded world to voxel space transformation and copy of points. More...
class | PrimCpyOp
| TBB body object for threaded primitive copy. More...
class | VertexNormalOp
| TBB body object for threaded vertex normal generation. More...
class | SharpenFeaturesOp
| TBB body object for threaded sharp feature construction. More...
class | GenAdaptivityMaskOp
| TBB body object for threaded sharp feature construction. More...
class | OpenVDBOpFactory
| Use this class to register a new OpenVDB operator (SOP, POP, etc.). More...
class | SOP_NodeVDB
| Base class from which to derive OpenVDB-related Houdini SOPs. More...
class | GridTransformOp
| GridTransformOp is a functor class for use with GridBase::apply() that samples an input grid into an output grid of the same type through a given affine transform. More...
class | GridResampleOp
| GridResampleOp is a functor class for use with UTvdbProcessTypedGrid() that samples an input grid into an output grid of the same type through a given transform. More...
class | GridResampleToMatchOp
| GridResampleToMatchOp is a functor class for use with GridBase::apply() that samples an input grid into an output grid of the same type such that, after resampling, the input and output grids coincide, but the output grid's transform is unchanged. More...
class | VdbPrimCIterator
| Iterator over const VDB primitives on a geometry detail. More...
class | VdbPrimIterator
| Iterator over non-const VDB primitives on a geometry detail. More...
class | HoudiniInterrupter
| Wrapper class that adapts a Houdini `UT_Interrupt` object for use with OpenVDB library routines. More...

## Typedefs
using | AttributeDetailList = std::vector<AttributeDetailBase::Ptr>
using | OffsetList = std::vector<GA_Offset>
using | OffsetListPtr = std::shared_ptr<OffsetList>
using | OffsetPair = std::pair<GA_Offset, GA_Offset>
using | OffsetPairList = std::vector<OffsetPair>
using | OffsetPairListPtr = std::shared_ptr<OffsetPairList>
using | AttributeInfoMap = std::map<openvdb::Name, std::pair<int, bool>>
using | WarnFunc = std::function<void (const std::string&)>
using | Grid = openvdb::GridBase
using | GridPtr = openvdb::GridBase::Ptr
using | GridCPtr = openvdb::GridBase::ConstPtr
using | GridRef = openvdb::GridBase&
using | GridCRef = const openvdb::GridBase&
using | ScalarGridTypes
using | NumericGridTypes
using | RealGridTypes
using | Vec3GridTypes
using | PointGridTypes
using | VolumeGridTypes = ScalarGridTypes::Append<Vec3GridTypes>
using | AllGridTypes = VolumeGridTypes::Append<PointGridTypes>

## Enumerations
enum | POINT_COMPRESSION_TYPE { COMPRESSION_NONE = 0 , COMPRESSION_TRUNCATE , COMPRESSION_UNIT_VECTOR , COMPRESSION_UNIT_FIXED_POINT_8 , COMPRESSION_UNIT_FIXED_POINT_16 }
| Enum to store available compression types for point grids. More...

## Functions
template<typename ValueType>
ValueType | evalAttr (const GA_Attribute *atr, const GA_AIFTuple *aif, GA_Offset off, int idx)
template<>
float | evalAttr< float > (const GA_Attribute *atr, const GA_AIFTuple *aif, GA_Offset off, int idx)
template<>
openvdb::Int32 | evalAttr< openvdb::Int32 > (const GA_Attribute *atr, const GA_AIFTuple *aif, GA_Offset off, int idx)
template<>
openvdb::Int64 | evalAttr< openvdb::Int64 > (const GA_Attribute *atr, const GA_AIFTuple *aif, GA_Offset off, int idx)
template<>
openvdb::Vec3i | evalAttr< openvdb::Vec3i > (const GA_Attribute *atr, const GA_AIFTuple *aif, GA_Offset off, int)
template<>
openvdb::Vec3s | evalAttr< openvdb::Vec3s > (const GA_Attribute *atr, const GA_AIFTuple *aif, GA_Offset off, int)
template<>
openvdb::Vec3d | evalAttr< openvdb::Vec3d > (const GA_Attribute *atr, const GA_AIFTuple *aif, GA_Offset off, int)
template<typename ValueType>
ValueType | combine (const ValueType &v0, const ValueType &v1, const ValueType &v2, const openvdb::Vec3d &w)
| Combine different value types.
template<>
openvdb::Int32 | combine (const openvdb::Int32 &v0, const openvdb::Int32 &v1, const openvdb::Int32 &v2, const openvdb::Vec3d &w)
template<>
openvdb::Int64 | combine (const openvdb::Int64 &v0, const openvdb::Int64 &v1, const openvdb::Int64 &v2, const openvdb::Vec3d &w)
template<>
openvdb::Vec3i | combine (const openvdb::Vec3i &v0, const openvdb::Vec3i &v1, const openvdb::Vec3i &v2, const openvdb::Vec3d &w)
template<>
openvdb::Vec3s | combine (const openvdb::Vec3s &v0, const openvdb::Vec3s &v1, const openvdb::Vec3s &v2, const openvdb::Vec3d &w)
template<>
openvdb::Vec3d | combine (const openvdb::Vec3d &v0, const openvdb::Vec3d &v1, const openvdb::Vec3d &v2, const openvdb::Vec3d &w)
template<typename ValueType>
ValueType | evalAttrDefault (const GA_Defaults &defaults, int idx)
| Get an OpenVDB-specific value by evaluating GA_Default::get() with appropriate arguments.
template<>
float | evalAttrDefault< float > (const GA_Defaults &defaults, int)
template<>
openvdb::Int32 | evalAttrDefault< openvdb::Int32 > (const GA_Defaults &defaults, int idx)
template<>
openvdb::Int64 | evalAttrDefault< openvdb::Int64 > (const GA_Defaults &defaults, int idx)
template<>
openvdb::Vec3i | evalAttrDefault< openvdb::Vec3i > (const GA_Defaults &defaults, int)
template<>
openvdb::Vec3s | evalAttrDefault< openvdb::Vec3s > (const GA_Defaults &defaults, int)
template<>
openvdb::Vec3d | evalAttrDefault< openvdb::Vec3d > (const GA_Defaults &defaults, int)
template<>
openvdb::math::Quat< float > | evalAttrDefault< openvdb::math::Quat< float > > (const GA_Defaults &defaults, int)
template<>
openvdb::math::Quat< double > | evalAttrDefault< openvdb::math::Quat< double > > (const GA_Defaults &defaults, int)
template<>
openvdb::math::Mat3< float > | evalAttrDefault< openvdb::math::Mat3< float > > (const GA_Defaults &defaults, int)
template<>
openvdb::math::Mat3< double > | evalAttrDefault< openvdb::math::Mat3< double > > (const GA_Defaults &defaults, int)
template<>
openvdb::math::Mat4< float > | evalAttrDefault< openvdb::math::Mat4< float > > (const GA_Defaults &defaults, int)
template<>
openvdb::math::Mat4< double > | evalAttrDefault< openvdb::math::Mat4< double > > (const GA_Defaults &defaults, int)
AttributeCopyBase::Ptr | createAttributeCopier (const GA_Attribute &sourceAttr, GA_Attribute &targetAttr)
GA_Offset | findClosestPrimitiveToPoint (const GU_Detail &geo, const std::set< GA_Index > &primitives, const openvdb::Vec3d &p, GA_Offset &vert0, GA_Offset &vert1, GA_Offset &vert2, openvdb::Vec3d &uvw)
GA_Offset | findClosestPrimitiveToPoint (const GU_Detail &geo, std::vector< GA_Index > &primitives, const openvdb::Vec3d &p, GA_Offset &vert0, GA_Offset &vert1, GA_Offset &vert2, openvdb::Vec3d &uvw)
template<class GridType>
void | transferPrimitiveAttributes (const GU_Detail &sourceGeo, GU_Detail &targetGeo, GridType &indexGrid, openvdb::util::NullInterrupter &boss, const GA_PrimitiveGroup *primitives=nullptr)
OPENVDB_HOUDINI_API void | drawFrustum (GU_Detail &, const openvdb::math::Transform &, const UT_Vector3 *boxColor, const UT_Vector3 *tickColor, bool shaded, bool drawTicks=true)
| Add geometry to the given detail to indicate the extents of a frustum transform.
OPENVDB_HOUDINI_API openvdb::math::Transform::Ptr | frustumTransformFromCamera (OP_Node &, OP_Context &, OBJ_Camera &, float offset, float nearPlaneDist, float farPlaneDist, float voxelDepthSize=1.0, int voxelCountX=100)
| Construct a frustum transform from a Houdini camera.
OPENVDB_HOUDINI_API bool | pointInPrimGroup (GA_Offset ptnOffset, GU_Detail &, const GA_PrimitiveGroup &)
| Return `true` if the point at the given offset is referenced by primitives from a certain primitive group.
OPENVDB_HOUDINI_API std::unique_ptr< GU_Detail > | convertGeometry (const GU_Detail &, std::string &warning, openvdb::util::NullInterrupter *)
| Convert geometry to quads and triangles.
OPENVDB_HOUDINI_API float | computeVoxelSizeFromHoudini (const GU_Detail &detail, const openvdb::Index pointsPerVoxel, const openvdb::math::Mat4d &matrix, const openvdb::Index decimalPlaces, openvdb::util::NullInterrupter &interrupter)
| Compute a voxel size from a Houdini detail.
OPENVDB_HOUDINI_API openvdb::points::PointDataGrid::Ptr | convertHoudiniToPointDataGrid (const GU_Detail &detail, const int compression, const AttributeInfoMap &attributes, const openvdb::math::Transform &transform, const WarnFunc &warnings=[](const std::string &){})
| Convert a Houdini detail into a VDB Points grid.
OPENVDB_HOUDINI_API void | convertPointDataGridToHoudini (GU_Detail &detail, const openvdb::points::PointDataGrid &grid, const std::vector< std::string > &attributes={}, const std::vector< std::string > &includeGroups={}, const std::vector< std::string > &excludeGroups={}, const bool inCoreOnly=false)
| Convert a VDB Points grid into Houdini points and append them to a Houdini Detail.
OPENVDB_HOUDINI_API void | populateMetadataFromHoudini (openvdb::points::PointDataGrid &grid, const GU_Detail &detail, const WarnFunc &warnings=[](const std::string &){})
| Populate VDB Points grid metadata from Houdini detail attributes.
OPENVDB_HOUDINI_API void | convertMetadataToHoudini (GU_Detail &detail, const openvdb::MetaMap &metaMap, const WarnFunc &warnings=[](const std::string &){})
| Convert VDB Points grid metadata into Houdini detail attributes.
OPENVDB_HOUDINI_API int16_t | attributeTupleSize (const GA_Attribute *const attribute)
| Returns supported tuple sizes for conversion from GA_Attribute.
OPENVDB_HOUDINI_API GA_Storage | attributeStorageType (const GA_Attribute *const attribute)
| Returns supported Storage types for conversion from GA_Attribute.
OPENVDB_HOUDINI_API void | pointDataGridSpecificInfoText (std::ostream &, const openvdb::GridBase &)
| If the given grid is a PointDataGrid, add node specific info text to the stream provided. This is used to populate the MMB window in Houdini versions 15 and earlier, as well as the Operator Information Window.
OPENVDB_HOUDINI_API void | collectPointInfo (const openvdb::points::PointDataGrid &grid, std::string &countStr, std::string &groupStr, std::string &attributeStr)
| Populates string data with information about the provided OpenVDB Points grid.
OPENVDB_HOUDINI_API GU_PrimVDB * | createVdbPrimitive (GU_Detail &gdp, GridPtr grid, const char *name=nullptr)
| Store a VDB grid in a new VDB primitive and add the primitive to a geometry detail.
OPENVDB_HOUDINI_API GU_PrimVDB * | replaceVdbPrimitive (GU_Detail &gdp, GridPtr grid, GEO_PrimVDB &src, const bool copyAttrs=true, const char *name=nullptr)
| Replace an existing VDB primitive with a new primitive that contains the given grid.
OPENVDB_HOUDINI_API bool | evalGridBBox (GridCRef grid, UT_Vector3 corners[8], bool expandHalfVoxel=false)
| Return in corners the corners of the given grid's active voxel bounding box.
OPENVDB_HOUDINI_API openvdb::CoordBBox | makeCoordBBox (const UT_BoundingBox &, const openvdb::math::Transform &)
| Construct an index-space CoordBBox from a UT_BoundingBox.
template<typename GridTypeListT, typename OpT>
bool | GEOvdbApply (const GEO_PrimVDB &vdb, OpT &op)
| If the given primitive's grid resolves to one of the listed grid types, invoke the functor op on the resolved grid.
template<typename GridTypeListT, typename OpT>
bool | GEOvdbApply (GEO_PrimVDB &vdb, OpT &op, bool makeUnique=true)
| If the given primitive's grid resolves to one of the listed grid types, invoke the functor op on the resolved grid.
OPENVDB_HOUDINI_API void | startLogForwarding (OP_OpTypeId)
| Start forwarding OpenVDB log messages to the Houdini error manager for all operators of the given type.
OPENVDB_HOUDINI_API void | stopLogForwarding (OP_OpTypeId)
| Stop forwarding OpenVDB log messages to the Houdini error manager for all operators of the given type.
OPENVDB_HOUDINI_API bool | isLogForwarding (OP_OpTypeId)
| Return `true` if OpenVDB messages logged by operators of the given type are forwarded to the Houdini error manager.

## Variables
const std::string | META_GROUP_VIEWPORT = "group_viewport"
| Metadata name for viewport groups.
OPENVDB_HOUDINI_API const PRM_ChoiceList | VDBPointsGroupMenuInput1
OPENVDB_HOUDINI_API const PRM_ChoiceList | VDBPointsGroupMenuInput2
OPENVDB_HOUDINI_API const PRM_ChoiceList | VDBPointsGroupMenuInput3
OPENVDB_HOUDINI_API const PRM_ChoiceList | VDBPointsGroupMenuInput4
OPENVDB_HOUDINI_API const PRM_ChoiceList | VDBPointsGroupMenu

## Typedef Documentation

## ◆ AllGridTypes

using AllGridTypes = VolumeGridTypes::Append<PointGridTypes>

## ◆ AttributeDetailList

using AttributeDetailList = std::vector<AttributeDetailBase::Ptr>

## ◆ AttributeInfoMap

using AttributeInfoMap = std::map<openvdb::Name, std::pair<int, bool>>

## ◆ Grid

using Grid = openvdb::GridBase

## ◆ GridCPtr

using GridCPtr = openvdb::GridBase::ConstPtr

## ◆ GridCRef

using GridCRef = const openvdb::GridBase&

## ◆ GridPtr

using GridPtr = openvdb::GridBase::Ptr

## ◆ GridRef

using GridRef = openvdb::GridBase&

## ◆ NumericGridTypes

using NumericGridTypes

Initial value:
openvdb::TypeList<
openvdb::FloatGrid,
openvdb::DoubleGrid,
openvdb::Int32Grid,
openvdb::Int64Grid>
openvdb::v13_0::FloatGrid
Grid< FloatTree > FloatGrid
Definition openvdb.h:76
openvdb::v13_0::Int64Grid
Grid< Int64Tree > Int64Grid
Definition openvdb.h:79
openvdb::v13_0::Int32Grid
Grid< Int32Tree > Int32Grid
Definition openvdb.h:78
openvdb::v13_0::DoubleGrid
Grid< DoubleTree > DoubleGrid
Definition openvdb.h:75
openvdb::v13_0::TypeList
A list of types (not necessarily unique).
Definition TypeList.h:578

## ◆ OffsetList

using OffsetList = std::vector<GA_Offset>

## ◆ OffsetListPtr

using OffsetListPtr = std::shared_ptr<OffsetList>

## ◆ OffsetPair

using OffsetPair = std::pair<GA_Offset, GA_Offset>

## ◆ OffsetPairList

using OffsetPairList = std::vector<OffsetPair>

## ◆ OffsetPairListPtr

using OffsetPairListPtr = std::shared_ptr<OffsetPairList>

## ◆ PointGridTypes

using PointGridTypes

Initial value:
openvdb::TypeList<
openvdb::points::PointDataGrid>

## ◆ RealGridTypes

using RealGridTypes

Initial value:
openvdb::TypeList<
openvdb::FloatGrid,
openvdb::DoubleGrid>

## ◆ ScalarGridTypes

using ScalarGridTypes

Initial value:
openvdb::TypeList<
openvdb::BoolGrid,
openvdb::FloatGrid,
openvdb::DoubleGrid,
openvdb::Int32Grid,
openvdb::Int64Grid>
openvdb::v13_0::BoolGrid
Grid< BoolTree > BoolGrid
Common grid types.
Definition openvdb.h:74

## ◆ Vec3GridTypes

using Vec3GridTypes

Initial value:
openvdb::TypeList<
openvdb::Vec3SGrid,
openvdb::Vec3DGrid,
openvdb::Vec3IGrid>
openvdb::v13_0::Vec3DGrid
Grid< Vec3DTree > Vec3DGrid
Definition openvdb.h:81
openvdb::v13_0::Vec3IGrid
Grid< Vec3ITree > Vec3IGrid
Definition openvdb.h:82
openvdb::v13_0::Vec3SGrid
Grid< Vec3STree > Vec3SGrid
Definition openvdb.h:83

## ◆ VolumeGridTypes

using VolumeGridTypes = ScalarGridTypes::Append<Vec3GridTypes>

## ◆ WarnFunc

using WarnFunc = std::function<void (const std::string&)>

## Enumeration Type Documentation

## ◆ POINT_COMPRESSION_TYPE

enum POINT_COMPRESSION_TYPE

Enum to store available compression types for point grids.

Enumerator
COMPRESSION_NONE |
COMPRESSION_TRUNCATE |
COMPRESSION_UNIT_VECTOR |
COMPRESSION_UNIT_FIXED_POINT_8 |
COMPRESSION_UNIT_FIXED_POINT_16 |

## Function Documentation

## ◆ attributeStorageType()

OPENVDB_HOUDINI_API GA_Storage attributeStorageType | ( | const GA_Attribute *const | attribute | ) |

Returns supported Storage types for conversion from GA_Attribute.

## ◆ attributeTupleSize()

OPENVDB_HOUDINI_API int16_t attributeTupleSize | ( | const GA_Attribute *const | attribute | ) |

Returns supported tuple sizes for conversion from GA_Attribute.

## ◆ collectPointInfo()

OPENVDB_HOUDINI_API void collectPointInfo | ( | const openvdb::points::PointDataGrid & | grid,
|  | std::string & | countStr,
|  | std::string & | groupStr,
|  | std::string & | attributeStr )

Populates string data with information about the provided OpenVDB Points grid.

Parameters

  grid | The OpenVDB Points grid to retrieve information from.
  countStr | The total point count as a formatted integer.
  groupStr | The list of comma separated groups (or "none" if no groups exist). Enclosed by parentheses.
  attributeStr | The list of comma separated attributes (or "none" if no attributes exist). Enclosed by parentheses. Each attribute takes the form "name [type] [code] [stride]" where code and stride are added for non default attributes.

## ◆ combine() [1/6]

template<>

openvdb::Int32 combine | ( | const openvdb::Int32 & | v0,
|  | const openvdb::Int32 & | v1,
|  | const openvdb::Int32 & | v2,
|  | const openvdb::Vec3d & | w )
| inline

## ◆ combine() [2/6]

template<>

openvdb::Int64 combine | ( | const openvdb::Int64 & | v0,
|  | const openvdb::Int64 & | v1,
|  | const openvdb::Int64 & | v2,
|  | const openvdb::Vec3d & | w )
| inline

## ◆ combine() [3/6]

template<>

openvdb::Vec3d combine | ( | const openvdb::Vec3d & | v0,
|  | const openvdb::Vec3d & | v1,
|  | const openvdb::Vec3d & | v2,
|  | const openvdb::Vec3d & | w )
| inline

## ◆ combine() [4/6]

template<>

openvdb::Vec3i combine | ( | const openvdb::Vec3i & | v0,
|  | const openvdb::Vec3i & | v1,
|  | const openvdb::Vec3i & | v2,
|  | const openvdb::Vec3d & | w )
| inline

## ◆ combine() [5/6]

template<>

openvdb::Vec3s combine | ( | const openvdb::Vec3s & | v0,
|  | const openvdb::Vec3s & | v1,
|  | const openvdb::Vec3s & | v2,
|  | const openvdb::Vec3d & | w )
| inline

## ◆ combine() [6/6]

template<typename ValueType>

ValueType combine | ( | const ValueType & | v0,
|  | const ValueType & | v1,
|  | const ValueType & | v2,
|  | const openvdb::Vec3d & | w )
| inline

Combine different value types.

## ◆ computeVoxelSizeFromHoudini()

OPENVDB_HOUDINI_API float computeVoxelSizeFromHoudini | ( | const GU_Detail & | detail,
|  | const openvdb::Index | pointsPerVoxel,
|  | const openvdb::math::Mat4d & | matrix,
|  | const openvdb::Index | decimalPlaces,
|  | openvdb::util::NullInterrupter & | interrupter )

Compute a voxel size from a Houdini detail.

Parameters

  detail | GU_Detail to compute the voxel size from
  pointsPerVoxel | the target number of points per voxel, must be positive and non-zero
  matrix | voxel size will be computed using this transform
  decimalPlaces | for readability, truncate voxel size to this number of decimals
  interrupter | a Houdini interrupter

## ◆ convertGeometry()

OPENVDB_HOUDINI_API std::unique_ptr< GU_Detail > convertGeometry | ( | const GU_Detail & | ,
|  | std::string & | warning,
|  | openvdb::util::NullInterrupter * | )

Convert geometry to quads and triangles.

Returns
  a pointer to a new GU_Detail object if the geometry was converted or subdivided, otherwise a null pointer

## ◆ convertHoudiniToPointDataGrid()

OPENVDB_HOUDINI_API openvdb::points::PointDataGrid::Ptr convertHoudiniToPointDataGrid | ( | const GU_Detail & | detail,
|  | const int | compression,
|  | const AttributeInfoMap & | attributes,
|  | const openvdb::math::Transform & | transform,
|  | const WarnFunc & | warnings = [](const std::string &){} )

Convert a Houdini detail into a VDB Points grid.

Parameters

  detail | GU_Detail to convert the points and attributes from
  compression | position compression to use
  attributes | a vector of VDB Points attributes to be included (empty vector defaults to all)
  transform | transform to use for the new point grid
  warnings | list of warnings to be added to the SOP

## ◆ convertMetadataToHoudini()

OPENVDB_HOUDINI_API void convertMetadataToHoudini | ( | GU_Detail & | detail,
|  | const openvdb::MetaMap & | metaMap,
|  | const WarnFunc & | warnings = [](const std::string &){} )

Convert VDB Points grid metadata into Houdini detail attributes.

Parameters

  detail | GU_Detail to add the Houdini detail attributes
  metaMap | the metamap to create the Houdini detail attributes from
  warnings | list of warnings to be added to the SOP

## ◆ convertPointDataGridToHoudini()

OPENVDB_HOUDINI_API void convertPointDataGridToHoudini | ( | GU_Detail & | detail,
|  | const openvdb::points::PointDataGrid & | grid,
|  | const std::vector< std::string > & | attributes = {},
|  | const std::vector< std::string > & | includeGroups = {},
|  | const std::vector< std::string > & | excludeGroups = {},
|  | const bool | inCoreOnly = false )

Convert a VDB Points grid into Houdini points and append them to a Houdini Detail.

Parameters

  detail | GU_Detail to append the converted points and attributes to
  grid | grid containing the points that will be converted
  attributes | a vector of VDB Points attributes to be included (empty vector defaults to all)
  includeGroups | a vector of VDB Points groups to be included (empty vector defaults to all)
  excludeGroups | a vector of VDB Points groups to be excluded (empty vector defaults to none)
  inCoreOnly | true if out-of-core leaf nodes are to be ignored

## ◆ createAttributeCopier()

AttributeCopyBase::Ptr createAttributeCopier | ( | const GA_Attribute & | sourceAttr,
|  | GA_Attribute & | targetAttr )
| inline

## ◆ createVdbPrimitive()

OPENVDB_HOUDINI_API GU_PrimVDB * createVdbPrimitive | ( | GU_Detail & | gdp,
|  | GridPtr | grid,
|  | const char * | name = nullptr )

Store a VDB grid in a new VDB primitive and add the primitive to a geometry detail.

Returns
  the newly-created VDB primitive.

Parameters

  gdp | the detail to which to add the primitive
  grid | the VDB grid to be added
  name | if non-null, set the new primitive's `name` attribute to this string

Note
  This operation clears the input grid's metadata.

## ◆ drawFrustum()

OPENVDB_HOUDINI_API void drawFrustum | ( | GU_Detail & | ,
|  | const openvdb::math::Transform & | ,
|  | const UT_Vector3 * | boxColor,
|  | const UT_Vector3 * | tickColor,
|  | bool | shaded,
|  | bool | drawTicks = true )

Add geometry to the given detail to indicate the extents of a frustum transform.

## ◆ evalAttr()

template<typename ValueType>

ValueType evalAttr | ( | const GA_Attribute * | atr,
|  | const GA_AIFTuple * | aif,
|  | GA_Offset | off,
|  | int | idx )
| inline

Get OpenVDB specific value, by calling GA_AIFTuple::get() with appropriate arguments.

## ◆ evalAttr< float >()

template<>

float evalAttr< float > | ( | const GA_Attribute * | atr,
|  | const GA_AIFTuple * | aif,
|  | GA_Offset | off,
|  | int | idx )
| inline

## ◆ evalAttr< openvdb::Int32 >()

template<>

openvdb::Int32 evalAttr< openvdb::Int32 > | ( | const GA_Attribute * | atr,
|  | const GA_AIFTuple * | aif,
|  | GA_Offset | off,
|  | int | idx )
| inline

## ◆ evalAttr< openvdb::Int64 >()

template<>

openvdb::Int64 evalAttr< openvdb::Int64 > | ( | const GA_Attribute * | atr,
|  | const GA_AIFTuple * | aif,
|  | GA_Offset | off,
|  | int | idx )
| inline

## ◆ evalAttr< openvdb::Vec3d >()

template<>

openvdb::Vec3d evalAttr< openvdb::Vec3d > | ( | const GA_Attribute * | atr,
|  | const GA_AIFTuple * | aif,
|  | GA_Offset | off,
|  | int | )
| inline

## ◆ evalAttr< openvdb::Vec3i >()

template<>

openvdb::Vec3i evalAttr< openvdb::Vec3i > | ( | const GA_Attribute * | atr,
|  | const GA_AIFTuple * | aif,
|  | GA_Offset | off,
|  | int | )
| inline

## ◆ evalAttr< openvdb::Vec3s >()

template<>

openvdb::Vec3s evalAttr< openvdb::Vec3s > | ( | const GA_Attribute * | atr,
|  | const GA_AIFTuple * | aif,
|  | GA_Offset | off,
|  | int | )
| inline

## ◆ evalAttrDefault()

template<typename ValueType>

ValueType evalAttrDefault | ( | const GA_Defaults & | defaults,
|  | int | idx )
| inline

Get an OpenVDB-specific value by evaluating GA_Default::get() with appropriate arguments.

## ◆ evalAttrDefault< float >()

template<>

float evalAttrDefault< float > | ( | const GA_Defaults & | defaults,
|  | int | )
| inline

## ◆ evalAttrDefault< openvdb::Int32 >()

template<>

openvdb::Int32 evalAttrDefault< openvdb::Int32 > | ( | const GA_Defaults & | defaults,
|  | int | idx )
| inline

## ◆ evalAttrDefault< openvdb::Int64 >()

template<>

openvdb::Int64 evalAttrDefault< openvdb::Int64 > | ( | const GA_Defaults & | defaults,
|  | int | idx )
| inline

## ◆ evalAttrDefault< openvdb::math::Mat3< double > >()

template<>

openvdb::math::Mat3< double > evalAttrDefault< openvdb::math::Mat3< double > > | ( | const GA_Defaults & | defaults,
|  | int | )
| inline

## ◆ evalAttrDefault< openvdb::math::Mat3< float > >()

template<>

openvdb::math::Mat3< float > evalAttrDefault< openvdb::math::Mat3< float > > | ( | const GA_Defaults & | defaults,
|  | int | )
| inline

## ◆ evalAttrDefault< openvdb::math::Mat4< double > >()

template<>

openvdb::math::Mat4< double > evalAttrDefault< openvdb::math::Mat4< double > > | ( | const GA_Defaults & | defaults,
|  | int | )
| inline

## ◆ evalAttrDefault< openvdb::math::Mat4< float > >()

template<>

openvdb::math::Mat4< float > evalAttrDefault< openvdb::math::Mat4< float > > | ( | const GA_Defaults & | defaults,
|  | int | )
| inline

## ◆ evalAttrDefault< openvdb::math::Quat< double > >()

template<>

openvdb::math::Quat< double > evalAttrDefault< openvdb::math::Quat< double > > | ( | const GA_Defaults & | defaults,
|  | int | )
| inline

## ◆ evalAttrDefault< openvdb::math::Quat< float > >()

template<>

openvdb::math::Quat< float > evalAttrDefault< openvdb::math::Quat< float > > | ( | const GA_Defaults & | defaults,
|  | int | )
| inline

## ◆ evalAttrDefault< openvdb::Vec3d >()

template<>

openvdb::Vec3d evalAttrDefault< openvdb::Vec3d > | ( | const GA_Defaults & | defaults,
|  | int | )
| inline

## ◆ evalAttrDefault< openvdb::Vec3i >()

template<>

openvdb::Vec3i evalAttrDefault< openvdb::Vec3i > | ( | const GA_Defaults & | defaults,
|  | int | )
| inline

## ◆ evalAttrDefault< openvdb::Vec3s >()

template<>

openvdb::Vec3s evalAttrDefault< openvdb::Vec3s > | ( | const GA_Defaults & | defaults,
|  | int | )
| inline

## ◆ evalGridBBox()

OPENVDB_HOUDINI_API bool evalGridBBox | ( | GridCRef | grid,
|  | UT_Vector3 | corners[8],
|  | bool | expandHalfVoxel = false )

Return in corners the corners of the given grid's active voxel bounding box.

Returns
  `false` if the grid has no active voxels.

## ◆ findClosestPrimitiveToPoint() [1/2]

GA_Offset findClosestPrimitiveToPoint | ( | const GU_Detail & | geo,
|  | const std::set< GA_Index > & | primitives,
|  | const openvdb::Vec3d & | p,
|  | GA_Offset & | vert0,
|  | GA_Offset & | vert1,
|  | GA_Offset & | vert2,
|  | openvdb::Vec3d & | uvw )
| inline

## ◆ findClosestPrimitiveToPoint() [2/2]

GA_Offset findClosestPrimitiveToPoint | ( | const GU_Detail & | geo,
|  | std::vector< GA_Index > & | primitives,
|  | const openvdb::Vec3d & | p,
|  | GA_Offset & | vert0,
|  | GA_Offset & | vert1,
|  | GA_Offset & | vert2,
|  | openvdb::Vec3d & | uvw )
| inline

## ◆ frustumTransformFromCamera()

OPENVDB_HOUDINI_API openvdb::math::Transform::Ptr frustumTransformFromCamera | ( | OP_Node & | ,
|  | OP_Context & | ,
|  | OBJ_Camera & | ,
|  | float | offset,
|  | float | nearPlaneDist,
|  | float | farPlaneDist,
|  | float | voxelDepthSize = 1.0,
|  | int | voxelCountX = 100 )

Construct a frustum transform from a Houdini camera.

## ◆ GEOvdbApply() [1/2]

template<typename GridTypeListT, typename OpT>

bool GEOvdbApply | ( | const GEO_PrimVDB & | vdb,
|  | OpT & | op )
| inline

If the given primitive's grid resolves to one of the listed grid types, invoke the functor op on the resolved grid.

Returns
  `true` if the functor was invoked, `false` otherwise

## ◆ GEOvdbApply() [2/2]

template<typename GridTypeListT, typename OpT>

bool GEOvdbApply | ( | GEO_PrimVDB & | vdb,
|  | OpT & | op,
|  | bool | makeUnique = true )
| inline

If the given primitive's grid resolves to one of the listed grid types, invoke the functor op on the resolved grid.

Returns
  `true` if the functor was invoked, `false` otherwise

If makeUnique is true, deep copy the grid's tree before invoking the functor if the tree is shared with other grids.

## ◆ isLogForwarding()

OPENVDB_HOUDINI_API bool isLogForwarding | ( | OP_OpTypeId |  | ) |

Return `true` if OpenVDB messages logged by operators of the given type are forwarded to the Houdini error manager.

See also
  startLogForwarding(), stopLogForwarding()

## ◆ makeCoordBBox()

OPENVDB_HOUDINI_API openvdb::CoordBBox makeCoordBBox | ( | const UT_BoundingBox & | ,
|  | const openvdb::math::Transform & | )

Construct an index-space CoordBBox from a UT_BoundingBox.

## ◆ pointDataGridSpecificInfoText()

OPENVDB_HOUDINI_API void pointDataGridSpecificInfoText | ( | std::ostream & | ,
|  | const openvdb::GridBase & | )

If the given grid is a PointDataGrid, add node specific info text to the stream provided. This is used to populate the MMB window in Houdini versions 15 and earlier, as well as the Operator Information Window.

## ◆ pointInPrimGroup()

OPENVDB_HOUDINI_API bool pointInPrimGroup | ( | GA_Offset | ptnOffset,
|  | GU_Detail & | ,
|  | const GA_PrimitiveGroup & | )

Return `true` if the point at the given offset is referenced by primitives from a certain primitive group.

## ◆ populateMetadataFromHoudini()

OPENVDB_HOUDINI_API void populateMetadataFromHoudini | ( | openvdb::points::PointDataGrid & | grid,
|  | const GU_Detail & | detail,
|  | const WarnFunc & | warnings = [](const std::string &){} )

Populate VDB Points grid metadata from Houdini detail attributes.

Parameters

  grid | grid to be populated with metadata
  detail | GU_Detail to extract the detail attributes from
  warnings | list of warnings to be added to the SOP

## ◆ replaceVdbPrimitive()

OPENVDB_HOUDINI_API GU_PrimVDB * replaceVdbPrimitive | ( | GU_Detail & | gdp,
|  | GridPtr | grid,
|  | GEO_PrimVDB & | src,
|  | const bool | copyAttrs = true,
|  | const char * | name = nullptr )

Replace an existing VDB primitive with a new primitive that contains the given grid.

Returns
  the newly-created VDB primitive.

Parameters

  gdp | the detail to which to add the primitive
  grid | the VDB grid to be added
  src | replace this primitive with the newly-created primitive
  copyAttrs | if `true`, copy attributes and group membership from the src primitive
  name | if non-null, set the new primitive's `name` attribute to this string; otherwise, if copyAttrs is `true`, copy the name from src

Note
  This operation clears the input grid's metadata.

## ◆ startLogForwarding()

OPENVDB_HOUDINI_API void startLogForwarding | ( | OP_OpTypeId |  | ) |

Start forwarding OpenVDB log messages to the Houdini error manager for all operators of the given type.

Typically, log forwarding is enabled for specific operator types during initialization of the openvdb_houdini library, and there's no need for client code to call this function.

This function has no effect unless OpenVDB was built with log4cplus.

Note
  OpenVDB messages are typically logged to the console as well. This function has no effect on console logging.

See also
  stopLogForwarding(), isLogForwarding()

## ◆ stopLogForwarding()

OPENVDB_HOUDINI_API void stopLogForwarding | ( | OP_OpTypeId |  | ) |

Stop forwarding OpenVDB log messages to the Houdini error manager for all operators of the given type.

Typically, log forwarding is enabled for specific operator types during initialization of the openvdb_houdini library, and there's no need for client code to disable it.

This function has no effect unless OpenVDB was built with log4cplus.

Note
  OpenVDB messages are typically logged to the console as well. This function has no effect on console logging.

See also
  startLogForwarding(), isLogForwarding()

## ◆ transferPrimitiveAttributes()

template<class GridType>

void transferPrimitiveAttributes | ( | const GU_Detail & | sourceGeo,
|  | GU_Detail & | targetGeo,
|  | GridType & | indexGrid,
|  | openvdb::util::NullInterrupter & | boss,
|  | const GA_PrimitiveGroup * | primitives = nullptr )
| inline

## Variable Documentation

## ◆ META_GROUP_VIEWPORT

const std::string META_GROUP_VIEWPORT = "group_viewport"

Metadata name for viewport groups.

## ◆ VDBPointsGroupMenu

OPENVDB_HOUDINI_API const PRM_ChoiceList VDBPointsGroupMenu
| extern

Note
  Use this if you have more than 4 inputs, otherwise use the input specific menus instead which automatically handle the appropriate spare data settings.

## ◆ VDBPointsGroupMenuInput1

OPENVDB_HOUDINI_API const PRM_ChoiceList VDBPointsGroupMenuInput1
| extern

## ◆ VDBPointsGroupMenuInput2

OPENVDB_HOUDINI_API const PRM_ChoiceList VDBPointsGroupMenuInput2
| extern

## ◆ VDBPointsGroupMenuInput3

OPENVDB_HOUDINI_API const PRM_ChoiceList VDBPointsGroupMenuInput3
| extern

## ◆ VDBPointsGroupMenuInput4

OPENVDB_HOUDINI_API const PRM_ChoiceList VDBPointsGroupMenuInput4
| extern