12 #include <pxr/usd/usdVol/openVDBAsset.h>
13 #include <pxr/usd/usdVol/volume.h>
19 static const pxr::TfToken
density(
"density", pxr::TfToken::Immortal);
45 pxr::UsdVolVolume::FieldMap fields = volume_.GetFieldPaths();
47 for (pxr::UsdVolVolume::FieldMap::const_iterator it = fields.begin(); it != fields.end(); ++it) {
49 pxr::UsdPrim fieldPrim =
prim_.GetStage()->GetPrimAtPath(it->second);
51 if (!fieldPrim.IsA<pxr::UsdVolOpenVDBAsset>()) {
55 pxr::UsdVolOpenVDBAsset fieldBase(fieldPrim);
57 pxr::UsdAttribute filepathAttr = fieldBase.GetFilePathAttr();
59 if (filepathAttr.IsAuthored()) {
61 filepathAttr.Get(&fp, motionSampleTime);
63 if (filepathAttr.ValueMightBeTimeVarying()) {
64 std::vector<double> filePathTimes;
65 filepathAttr.GetTimeSamples(&filePathTimes);
67 if (!filePathTimes.empty()) {
68 int start =
static_cast<int>(filePathTimes.front());
69 int end =
static_cast<int>(filePathTimes.back());
77 std::string filepath = fp.GetResolvedPath();
79 strcpy(volume->
filepath, filepath.c_str());
General operations, lookup, etc. for blender objects.
struct Object * BKE_object_add_only_object(struct Main *bmain, int type, const char *name) ATTR_RETURNS_NONNULL
void * BKE_volume_add(struct Main *bmain, const char *name)
Object is a sort of wrapper for general info.
void create_object(Main *bmain, double motionSampleTime) override
void read_object_data(Main *bmain, double motionSampleTime) override
static const pxr::TfToken density("density", pxr::TfToken::Immortal)