Merge branch 'blender-v3.6-release' into main

This commit is contained in:
Brecht Van Lommel 2023-05-24 17:59:14 +02:00
commit f3f2f7fd47
3 changed files with 28 additions and 6 deletions

View File

@ -26,12 +26,20 @@ class HdCyclesVolumeLoader : public VDBImageLoader {
HdCyclesVolumeLoader(const std::string &filePath, const std::string &gridName)
: VDBImageLoader(gridName)
{
/* Disable delay loading and file copying, this has poor performance on network drivers. */
/* Disable delay loading and file copying, this has poor performance on network drives. */
const bool delay_load = false;
openvdb::io::File file(filePath);
file.setCopyMaxBytes(0);
if (file.open(delay_load)) {
grid = file.readGrid(gridName);
try {
openvdb::io::File file(filePath);
file.setCopyMaxBytes(0);
if (file.open(delay_load)) {
grid = file.readGrid(gridName);
}
}
catch (const openvdb::IoError &e) {
VLOG_WARNING << "Error loading OpenVDB file: " << e.what();
}
catch (...) {
VLOG_WARNING << "Error loading OpenVDB file: Unknown error";
}
}
};

View File

@ -72,6 +72,9 @@ struct ToNanoOp {
catch (const std::exception &e) {
VLOG_WARNING << "Error converting OpenVDB to NanoVDB grid: " << e.what();
}
catch (...) {
VLOG_WARNING << "Error converting OpenVDB to NanoVDB grid: Unknown error";
}
return true;
}
else {

View File

@ -335,6 +335,9 @@ struct VolumeGrid {
catch (const openvdb::IoError &e) {
entry->error_msg = e.what();
}
catch (...) {
entry->error_msg = "Unknown error reading VDB file";
}
});
std::atomic_thread_fence(std::memory_order_release);
@ -879,7 +882,7 @@ bool BKE_volume_load(const Volume *volume, const Main *bmain)
try {
/* Disable delay loading and file copying, this has poor performance
* on network drivers. */
* on network drives. */
const bool delay_load = false;
file.setCopyMaxBytes(0);
file.open(delay_load);
@ -890,6 +893,10 @@ bool BKE_volume_load(const Volume *volume, const Main *bmain)
grids.error_msg = e.what();
CLOG_INFO(&LOG, 1, "Volume %s: %s", volume_name, grids.error_msg.c_str());
}
catch (...) {
grids.error_msg = "Unknown error reading VDB file";
CLOG_INFO(&LOG, 1, "Volume %s: %s", volume_name, grids.error_msg.c_str());
}
/* Add grids read from file to own vector, filtering out any NULL pointers. */
for (const openvdb::GridBase::Ptr &vdb_grid : vdb_grids) {
@ -959,6 +966,10 @@ bool BKE_volume_save(const Volume *volume,
BKE_reportf(reports, RPT_ERROR, "Could not write volume: %s", e.what());
return false;
}
catch (...) {
BKE_reportf(reports, RPT_ERROR, "Could not write volume: Unknown error writing VDB file");
return false;
}
return true;
#else