Skip to content

Added new actions to vdb tool - #2259

Open
kmuseth wants to merge 7 commits into
AcademySoftwareFoundation:masterfrom
kmuseth:add_copy_vdb_tool
Open

Added new actions to vdb tool#2259
kmuseth wants to merge 7 commits into
AcademySoftwareFoundation:masterfrom
kmuseth:add_copy_vdb_tool

Conversation

@kmuseth

@kmuseth kmuseth commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

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.

kmuseth added 5 commits July 20, 2026 21:48
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 kmuseth changed the title Add new actions to vdb tool Added new actions to vdb tool Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant