Skip to content

Commit

Permalink
Misc. minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pcucka committed Apr 2, 2018
1 parent 72db118 commit cd1f16d
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 40 deletions.
2 changes: 2 additions & 0 deletions openvdb/CHANGES
Expand Up @@ -47,6 +47,8 @@ Version 5.1.0 - In development
- Grid transforms are now more aggressively simplified, making it
less likely to produce nonuniform voxels erroneously.
[Contributed by Jeff Lait]
- Fixed a bug when copying and pasting a Create SOP that could cause
the Voxel Size toggle to change state.
- Added a houdini_utils::OpFactory::setVerb() method to register
compilable SOPs.
- Made SOP_NodeVDB::cookMySop() final (that is, non-overridable)
Expand Down
2 changes: 1 addition & 1 deletion openvdb/CMakeLists.txt
Expand Up @@ -123,7 +123,7 @@ INCLUDE_DIRECTORIES ( . ) # So they can simulate referencing installed headers

IF (WIN32)
# Because of implicit linking!
LINK_DIRECTORIES ( SYSTEM ${Boost_LIBRARY_DIR} )
LINK_DIRECTORIES ( ${Boost_LIBRARY_DIR} )
ENDIF ()

INCLUDE_DIRECTORIES ( SYSTEM ${BLOSC_INCLUDE_DIR} )
Expand Down
2 changes: 2 additions & 0 deletions openvdb/doc/changes.txt
Expand Up @@ -60,6 +60,8 @@ Houdini:
- Grid transforms are now more aggressively simplified, making it less likely
to produce nonuniform voxels erroneously.
<I>[Contributed by Jeff&nbsp;Lait]</I>
- Fixed a bug when copying and pasting a Create&nbsp;SOP that could cause
the Voxel&nbsp;Size toggle to change state.
- Added a @b houdini_utils::OpFactory::setVerb method to register
<A HREF="http://www.sidefx.com/docs/houdini/model/compile">
compilable</A>&nbsp;SOPs.
Expand Down
2 changes: 1 addition & 1 deletion openvdb/points/AttributeArray.h
Expand Up @@ -908,7 +908,7 @@ TypedAttributeArray<ValueType_, Codec_>::TypedAttributeArray(const TypedAttribut


template<typename ValueType_, typename Codec_>
typename TypedAttributeArray<ValueType_, Codec_>::TypedAttributeArray&
TypedAttributeArray<ValueType_, Codec_>&
TypedAttributeArray<ValueType_, Codec_>::operator=(const TypedAttributeArray& rhs)
{
if (&rhs != this) {
Expand Down
2 changes: 1 addition & 1 deletion openvdb/points/IndexFilter.h
Expand Up @@ -114,7 +114,7 @@ class MultiGroupFilter
for (const auto& name : names) {
try {
indices.emplace_back(attributeSet.groupIndex(name));
} catch (LookupError) {
} catch (LookupError&) {
// silently drop group names that don't exist
}
}
Expand Down
15 changes: 9 additions & 6 deletions openvdb/points/PointAttribute.h
Expand Up @@ -53,7 +53,10 @@ namespace points {
namespace point_attribute_internal {

template <typename ValueType>
inline ValueType defaultValue() { return zeroVal<ValueType>(); }
struct Default
{
static inline ValueType value() { return zeroVal<ValueType>(); }
};

} // namespace point_attribute_internal

Expand Down Expand Up @@ -93,7 +96,7 @@ template <typename ValueType, typename CodecType, typename PointDataTree>
inline void appendAttribute(PointDataTree& tree,
const std::string& name,
const ValueType& uniformValue =
point_attribute_internal::defaultValue<ValueType>(),
point_attribute_internal::Default<ValueType>::value(),
const Index strideOrTotalSize = 1,
const bool constantStride = true,
Metadata::Ptr metaDefaultValue = Metadata::Ptr(),
Expand All @@ -114,7 +117,7 @@ template <typename ValueType, typename PointDataTree>
inline void appendAttribute(PointDataTree& tree,
const std::string& name,
const ValueType& uniformValue =
point_attribute_internal::defaultValue<ValueType>(),
point_attribute_internal::Default<ValueType>::value(),
const Index strideOrTotalSize = 1,
const bool constantStride = true,
Metadata::Ptr metaDefaultValue = Metadata::Ptr(),
Expand All @@ -130,7 +133,7 @@ template <typename ValueType, typename PointDataTree>
inline void collapseAttribute( PointDataTree& tree,
const Name& name,
const ValueType& uniformValue =
point_attribute_internal::defaultValue<ValueType>());
point_attribute_internal::Default<ValueType>::value());

/// @brief Drops attributes from the VDB tree.
///
Expand Down Expand Up @@ -527,13 +530,13 @@ inline void appendAttribute(PointDataTree& tree,
"ValueType must not be derived from AttributeArray");

using point_attribute_internal::AttributeTypeConversion;
using point_attribute_internal::defaultValue;
using point_attribute_internal::Default;
using point_attribute_internal::MetadataStorage;

appendAttribute(tree, name, AttributeTypeConversion<ValueType, CodecType>::type(),
strideOrTotalSize, constantStride, metaDefaultValue, hidden, transient);

if (!math::isExactlyEqual(uniformValue, defaultValue<ValueType>())) {
if (!math::isExactlyEqual(uniformValue, Default<ValueType>::value())) {
MetadataStorage<PointDataTree, ValueType>::add(tree, uniformValue);
collapseAttribute<ValueType>(tree, name, uniformValue);
}
Expand Down
30 changes: 15 additions & 15 deletions openvdb/python/pyOpenVDBModule.cc
Expand Up @@ -617,21 +617,21 @@ struct VecTypeDescr
{
return
"The type of a vector determines how transforms are applied to it.\n"
"- INVARIANT:\n"
" does not transform (e.g., tuple, uvw, color)\n"
"- COVARIANT:\n"
" apply inverse-transpose transformation with w = 0\n"
" and ignore translation (e.g., gradient/normal)\n"
"- COVARIANT_NORMALIZE:\n"
" apply inverse-transpose transformation with w = 0\n"
" and ignore translation, vectors are renormalized\n"
" (e.g., unit normal)\n"
"- CONTRAVARIANT_RELATIVE:\n"
" apply \"regular\" transformation with w = 0 and ignore\n"
" translation (e.g., displacement, velocity, acceleration)\n"
"- CONTRAVARIANT_ABSOLUTE:\n"
" apply \"regular\" transformation with w = 1 so that\n"
" vector translates (e.g., position)";
" - INVARIANT:\n"
" does not transform (e.g., tuple, uvw, color)\n"
" - COVARIANT:\n"
" apply inverse-transpose transformation with w = 0\n"
" and ignore translation (e.g., gradient/normal)\n"
" - COVARIANT_NORMALIZE:\n"
" apply inverse-transpose transformation with w = 0\n"
" and ignore translation, vectors are renormalized\n"
" (e.g., unit normal)\n"
" - CONTRAVARIANT_RELATIVE:\n"
" apply \"regular\" transformation with w = 0 and ignore\n"
" translation (e.g., displacement, velocity, acceleration)\n"
" - CONTRAVARIANT_ABSOLUTE:\n"
" apply \"regular\" transformation with w = 1 so that\n"
" vector translates (e.g., position)\n";
}
static pyutil::CStringPair item(int i)
{
Expand Down
19 changes: 4 additions & 15 deletions openvdb/tools/ValueTransformer.h
Expand Up @@ -646,17 +646,9 @@ class OpAccumulator
OpAccumulator(const IterT& iter, OpT& op):
mIsRoot(true),
mIter(iter),
////
//mOp(&op),
//mOrigOp(new OpT(op))
mOp(NULL),
mOrigOp(NULL)
{
mOp = &op;
mOrigOp = new OpT(op);
}
//{}
////
mOp(&op),
mOrigOp(new OpT(op))
{}

// When splitting this task, give the subtask a copy of the original functor,
// not of this task's functor, which might have been modified arbitrarily.
Expand Down Expand Up @@ -687,10 +679,7 @@ mOrigOp(NULL)
const bool mIsRoot;
const IterT mIter;
OpT* mOp; // pointer to original functor, which might get modified
////
//OpT const * const mOrigOp; // const copy of original functor
OpT const * mOrigOp; // const copy of original functor
////
OpT const * const mOrigOp; // const copy of original functor
}; // class OpAccumulator

} // namespace valxform
Expand Down
3 changes: 2 additions & 1 deletion openvdb_houdini/houdini/SOP_OpenVDB_Create.cc
Expand Up @@ -697,7 +697,8 @@ void
SOP_OpenVDB_Create::resolveObsoleteParms(PRM_ParmList* obsoleteParms)
{
if (!obsoleteParms) return;
if (nullptr != obsoleteParms->getParmPtr("matchVoxelSize")) {
PRM_Parm* parm = obsoleteParms->getParmPtr("matchVoxelSize");
if (parm && !parm->isFactoryDefault()) {
const bool matchVoxelSize = obsoleteParms->evalInt("matchVoxelSize", 0, /*time=*/0.0);
setInt("useVoxelSize", 0, 0.0, !matchVoxelSize);
}
Expand Down

0 comments on commit cd1f16d

Please sign in to comment.