New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redpawfx #21

Open
wants to merge 470 commits into
base: master
from
Commits
Jump to file or symbol
Failed to load files and symbols.
+9 −3
Diff settings

Always

Just for now

Viewing a subset of changes. View all

Exit in a better way from the partio format.

  • Loading branch information...
sirpalee committed May 16, 2017
commit 85e7a8bf073c7096f743513670b6db24a8e3bf6c
@@ -7,6 +7,7 @@
#include <Partio.h>
#include <boost/regex.hpp>
#include <functional>
PXR_NAMESPACE_OPEN_SCOPE
@@ -123,6 +124,12 @@ namespace {
const VtArray<T>& a, const UsdTimeCode& usdTime) {
points.GetPrim().CreateAttribute(TfToken(name), typeName, false, SdfVariabilityVarying).Set(a, usdTime);
}
struct ScopeExit {
ScopeExit(std::function<void()> _f) : f(_f) { }
~ScopeExit() { f(); }
std::function<void()> f;
};
}
UsdPartIOFileFormat::~UsdPartIOFileFormat() {
@@ -147,10 +154,11 @@ bool UsdPartIOFileFormat::Read(const SdfLayerBasePtr& layerBase,
return false;
}
ScopeExit scopeExit([&layerBase, &layer]() { TfDynamic_cast<SdfLayerHandle>(layerBase)->TransferContent(layer); });
const auto pointCount = points->numParticles();
if (pointCount < 1) {
TF_WARN("[partIO] Particle count is zero in %s", resolvedPath.c_str());
return false;
return true;
}
// We are trying to guess the frame of the cache here.
@@ -212,8 +220,6 @@ bool UsdPartIOFileFormat::Read(const SdfLayerBasePtr& layerBase,
}
}
TfDynamic_cast<SdfLayerHandle>(layerBase)->TransferContent(layer);
return true;
}
ProTip! Use n and p to navigate between commits in a pull request.