Added new actions to vdb tool - #2259
Open
kmuseth wants to merge 7 commits into
Open
Conversation
Signed-off-by: Ken Museth <ken.museth@gmail.com>
… vdb_tool Signed-off-by: Ken Museth <ken.museth@gmail.com>
Signed-off-by: Ken Museth <ken.museth@gmail.com>
Signed-off-by: Ken Museth <ken.museth@gmail.com>
Signed-off-by: Ken Museth <ken.museth@gmail.com>
kmuseth
requested review from
Idclip,
apradhana,
danrbailey,
jmlait and
richhones
as code owners
July 23, 2026 06:34
Signed-off-by: Ken Museth <ken.museth@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New actions in vdb_tool:
Stack management
-copy — deep-copies VDB grids and/or Geometry by index onto the top of their stacks. Supports comma-separated indices, * wildcard, and an optional prefix= to rename copies. Defaults to vdb=0 (top grid).
-rename — renames a VDB grid and/or Geometry on the stack by age index.
-swap — swaps two VDB grids and/or two Geometry entries. O(1), no data copied.
Composite math (via tools::compMul / tools::compDiv)
-multiply (alias -mul) — per-voxel product of two scalar grids.
-divide — per-voxel quotient of two scalar grids.
Inspection
-stats — prints a value-derived table per grid: background, min, max, mean, std. dev., and for level sets: world-space surface area and enclosed volume. Intentionally complementary to -print which is structural-only.
-diagnose — runs tools::checkLevelSet / tools::checkFogVolume / NaN+Inf checks per grid. Prints OK or FAILED with indented messages. Options: vdb=, checks=N (default 9), fatal=true.
Changes to existing actions
-print — removed level=2 (background, value range, area, volume moved to -stats). Now level=0 and level=1 only.
-copy — vdb defaults to 0 so -copy alone duplicates the top grid.
-diagnose — gained checks=N option to control how many checks to run.
Bug fixes
Diagnostics.h — fixed a floating-point false positive in CheckLevelSet::checkBackground() where background / voxelSize could compute to just below LEVEL_SET_HALF_WIDTH due to IEEE 754 precision, causing a correctly-created level set to fail check #4. Fixed with a relative tolerance of 1e-6. Regression test added to TestDiagnostics.cc.
Config file improvement
Backslash line continuation in config files — a line ending with \ (trailing whitespace is ignored) is joined to the next line before tokenization, allowing long action invocations to be split across multiple lines. Unit test added (ToolConfigLineContinuation).
CMake fixes
vdb_tool/CMakeLists.txt — fixed OpenEXR v2/v3 compatibility: checks for OpenEXR::OpenEXR (v3) first, falls back to OpenEXR::IlmImf (v2). Also added find_package(Imath) + Imath::ImathConfig to propagate Imath include paths, fixing a build failure on systems where OpenEXR 3.x's headers use bare <ImathBox.h> includes.
Documentation
README.md — added actions to the table (copy, diagnose, divide, multiply, rename, stats, swap); updated -print and -stats descriptions to reflect the structural vs value-derived distinction; added a new "Inspecting grids: -print vs -stats" section; documented backslash line continuation in the config file format section.
pendingchanges/openvdb_cmd.txt — added entries for all new actions, updated -print and -stats descriptions, added the Diagnostics.h float fix entry.