Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VDBObject bindings : Adapt for OpenVDB 10.1 #1402

Merged
merged 3 commits into from
Feb 2, 2024

Conversation

johnhaddon
Copy link
Member

OpenVDB 10.1 switched from Boost to PyBind11 for its bindings, so we need to bind VDBObject differently based on which version of OpenVDB we're building for. But with the new PyBindConverter class, the new bindings actually come out simpler than the old ones.

This is essentially the same as the one we've used in Gaffer for interfacing with OpenColorIO bindings for a little while now.
The grid value class bindings are intended to provide everything both as an item (`["value"]`) and as an attribute (`.value`), but in OpenVDB 10.1 the item bindings seem broken, so we must use the attribute instead.

Also added a missing import, and used `next()` to get the first element from `citerAllValues()`, knockin 2s off the runtime of the test.
OpenVDB 10.1 switched from Boost to PyBind11 for its bindings, so we need to bind VDBObject differently based on which version of OpenVDB we're building for. But with the new PyBindConverter class, the new bindings actually come out simpler than the old ones.
@johnhaddon johnhaddon self-assigned this Feb 1, 2024
@johnhaddon
Copy link
Member Author

This will let us upgrade Gaffer to OpenVDB 10.1, which will in turn fix crashes caused by compiling OpenVDB 10.0 with GCC 11 - see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103629.

Copy link
Collaborator

@murraystevenson murraystevenson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@johnhaddon johnhaddon merged commit 6af71fb into ImageEngine:RB-10.5 Feb 2, 2024
4 checks passed
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.

2 participants