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

Add pybind11 wrappings for Imath::Frustum #456

Merged
merged 4 commits into from
Dec 16, 2024

Conversation

TodicaIonut
Copy link
Contributor

No description provided.

Signed-off-by: Todica Ionut <[email protected]>
Signed-off-by: Todica Ionut <[email protected]>
Signed-off-by: Todica Ionut <[email protected]>
Signed-off-by: Todica Ionut <[email protected]>
@TodicaIonut
Copy link
Contributor Author

good @cary-ilm

Copy link
Member

@cary-ilm cary-ilm left a comment

Choose a reason for hiding this comment

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

Looks good, thanks.

@cary-ilm
Copy link
Member

CI failures are unrelated, and should be fixed by #455. Thanks!

@cary-ilm cary-ilm merged commit 2e78172 into AcademySoftwareFoundation:main Dec 16, 2024
19 of 31 checks passed
@TodicaIonut TodicaIonut deleted the patch-1 branch December 16, 2024 19:14
@cary-ilm
Copy link
Member

@TodicaIonut, looks like I merged too soon, the code doesn't compile. On line line 19 of src/pybind11/PyBindImath/PyBindImathFrustum.cpp:

.def(pybind11::init<S>(), pybind11::arg("nearPlane"), pybind11::arg("farPlane"), pybind11::arg("fovx"), pybind11::arg("aspect"), "Initialize with basic frustum properties")

S is not declared. Same thing in subsequent lines.

This slipped through because the previous state the CI checks failed to actually build with -DPYBIND11=ON. Without that, the pybind11 code does not get compiled.

Could you kindly submit a separate PR to resolve this?

pybind11::class_<T> c(m, name);
c.def(pybind11::init<>(), "Uninitialized by default")
.def(pybind11::init<T>(), pybind11::arg("frustum"), "Copy constructor")
.def(pybind11::init<S>(), pybind11::arg("nearPlane"), pybind11::arg("farPlane"), pybind11::arg("fovx"), pybind11::arg("aspect"), "Initialize with basic frustum properties")
Copy link
Member

Choose a reason for hiding this comment

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

S is undeclared.

.def_readwrite("fovx", &T::fovx, "The field of view in x direction")
.def_readwrite("aspect", &T::aspect, "The aspect ratio")

.def("set", pybind11::overload_cast<S, S, S, S>(&T::set), pybind11::arg("nearPlane"), pybind11::arg("farPlane"), pybind11::arg("fovx"), pybind11::arg("aspect"), "Set frustum properties")
Copy link
Member

Choose a reason for hiding this comment

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

Same here, S is undeclared.

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