Page MenuHome

Fix T99004: Scaling volume down results in crash.
ClosedPublic

Authored by Jacques Lucke (JacquesLucke) on Aug 29 2022, 11:30 AM.

Details

Summary

Openvdb does the following check in a couple of places:

if (std::abs(determinant) < 3.0 * math::Tolerance<double>::value()) {
    OPENVDB_THROW(ArithmeticError, "Non-zero scale values required");
}

This leads to crashes even in release builds when volumes are scaled down too much.

The solution proposed in T99004 is to detect when volumes get too small and to replace those with empty volumes instead.

Diff Detail

Repository
rB Blender
Branch
openvdb-min-determinant (branched from master)
Build Status
Buildable 23526
Build 23526: arc lint + arc unit

Event Timeline

Jacques Lucke (JacquesLucke) requested review of this revision.Aug 29 2022, 11:30 AM
Jacques Lucke (JacquesLucke) created this revision.
Brecht Van Lommel (brecht) requested changes to this revision.Aug 29 2022, 1:19 PM

I think it would be good to at least preserve the translation. We use grid->transform().baseMap()->getAffineMap().getMat4() elsewhere, I think that should work.

source/blender/nodes/geometry/nodes/node_geo_transform.cc
118–119

This loses grid metadata, and changes the order of grids in the list.

I think it would be better to call clear() and setTransform() on the OpenVDB grid instead of creating a new one.

122

openvdb -> OpenVDB

source/blender/nodes/geometry/nodes/node_geo_volume_cube.cc
143

openvdb -> OpenVDB

This revision now requires changes to proceed.Aug 29 2022, 1:19 PM
  • Merge branch 'blender-v3.3-release' into openvdb-min-determinant
  • keep meta data, translation and rotation (if possible) intact
This revision is now accepted and ready to land.Aug 29 2022, 4:39 PM