added vdb option to -soup2ls action and improved error handeling - #2266
Open
kmuseth wants to merge 1 commit into
Open
added vdb option to -soup2ls action and improved error handeling#2266kmuseth wants to merge 1 commit into
kmuseth wants to merge 1 commit into
Conversation
Signed-off-by: Ken Museth <ken.museth@gmail.com>
kmuseth
requested review from
Idclip,
apradhana,
danrbailey,
jmlait and
richhones
as code owners
August 4, 2026 03:34
swahtz
requested changes
Aug 4, 2026
swahtz
left a comment
Contributor
There was a problem hiding this comment.
Changes look good, I would just request we have some tests for the fixed crash when the requested voxel size is too coarse for the input and a basic test for the output vdb=* and vdb=0,1,2 new features.
| // index produces a clean error with no partial output on the stack. | ||
| for (const int lvl : levels) { | ||
| if (lvl < 0 || lvl >= count) { | ||
| throw std::invalid_argument("soup2ls: requested output grid vdb=" + std::to_string(lvl) + |
Contributor
There was a problem hiding this comment.
💡 suggestion: Use OPENVDB_THROW to be consistent with other throws
| mGrids.push_back(this->offset(dx, offset_mode)); | ||
| } | ||
|
|
||
| // The loop above produces no grids when mMinVoxelSize > mMaxVoxelSize (i.e. the |
Contributor
There was a problem hiding this comment.
☑️ todo: We should have a test for this case now that it's fixed.
| auto myProgress = [&](const std::string &s){if constexpr(!std::is_same<ProgressT,void>::value) if (progress) (*progress)(s);}; | ||
|
|
||
| // Fine to coarse offset generation | ||
| for (float dx = mMinVoxelSize; dx <= mMaxVoxelSize; dx *= 2.0f) { |
Contributor
There was a problem hiding this comment.
❓ question: This loop doesn't produce any grids when mMinVoxelSize>mMaxVoxelSize but the assertions in the constructor fire when mMinVoxelSize>mMaxVoxelSize/2, is that the correct behaviour here?
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.
I've made two improvements to the vdb_tool: