OpenVDB: Support build without delay loading
This commit is contained in:
@@ -599,7 +599,9 @@ int readObjectsVDB(const string &filename, std::vector<PbClass *> *objects, floa
|
||||
registerCustomCodecs();
|
||||
|
||||
try {
|
||||
#ifdef OPENVDB_USE_DELAYED_LOADING
|
||||
file.setCopyMaxBytes(0);
|
||||
#endif
|
||||
file.open();
|
||||
gridsVDB = *(file.getGrids());
|
||||
openvdb::MetaMap::Ptr metadata = file.getMetadata();
|
||||
|
||||
@@ -31,7 +31,9 @@ class HdCyclesVolumeLoader : public VDBImageLoader {
|
||||
const bool delay_load = false;
|
||||
try {
|
||||
openvdb::io::File file(filePath);
|
||||
# ifdef OPENVDB_USE_DELAYED_LOADING
|
||||
file.setCopyMaxBytes(0);
|
||||
# endif
|
||||
if (file.open(delay_load)) {
|
||||
grid = file.readGrid(gridName);
|
||||
}
|
||||
|
||||
@@ -89,7 +89,9 @@ static FileCache create_file_cache(const StringRef file_path)
|
||||
/* Disable delay loading and file copying, this has poor performance
|
||||
* on network drives. */
|
||||
const bool delay_load = false;
|
||||
# ifdef OPENVDB_USE_DELAYED_LOADING
|
||||
file.setCopyMaxBytes(0);
|
||||
# endif
|
||||
file.open(delay_load);
|
||||
vdb_grids = *(file.readAllGridMetadata());
|
||||
file_cache.meta_data = *file.getMetadata();
|
||||
@@ -185,7 +187,9 @@ static openvdb::GridBase::Ptr load_single_grid_from_disk(const StringRef file_pa
|
||||
const bool delay_load = false;
|
||||
|
||||
openvdb::io::File file(file_path);
|
||||
# ifdef OPENVDB_USE_DELAYED_LOADING
|
||||
file.setCopyMaxBytes(0);
|
||||
# endif
|
||||
file.open(delay_load);
|
||||
return file.readGrid(grid_name);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user