Add camera_fov getter/setter to fvdb.viz.Scene#558
Merged
Conversation
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
…irection to make sure `mEditor.camera` data is available Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds camera vertical field-of-view (FOV, radians) support to the viewer API, exposing it through the C++ Viewer class and the Python fvdb.viz.Scene interface.
Changes:
- Added
cameraFov/setCameraFovto the C++fvdb::detail::viewer::ViewerAPI and exposed them through the Python bindings. - Added
Scene.camera_fovproperty (getter/setter) in Python with basic range validation. - Updated several camera getters in C++ to call
getCamera(scene_name)for scene-correct reads.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/python/ViewerBinding.cpp |
Exposes C++ camera FOV getter/setter to Python as camera_fov / set_camera_fov. |
src/fvdb/detail/viewer/Viewer.h |
Declares new cameraFov / setCameraFov methods. |
src/fvdb/detail/viewer/Viewer.cpp |
Implements camera FOV getter/setter and updates some camera getters to load the correct scene camera. |
fvdb/viz/_scene.py |
Adds Scene.camera_fov property with validation and forwards calls to the viewer server. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fwilliams
requested changes
Mar 23, 2026
fwilliams
left a comment
Collaborator
There was a problem hiding this comment.
Copilot review surfaced some good points and I added a few comments. Fix those up and this should be good to go.
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Implemented tests to validate the camera_fov property in the Scene class, ensuring correct value assignments and appropriate error handling for invalid inputs. This enhances the robustness of the camera functionality in the visualization module. Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
fwilliams
approved these changes
Mar 26, 2026
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.
This pull request adds support for getting and setting the camera's vertical field of view (FOV) in radians to the viewer API, exposing this functionality through both the C++ and Python interfaces.
Camera FOV support:
cameraFovandsetCameraFovmethods to theViewerclass in C++ for retrieving and updating the camera's vertical FOV, and updated the header file accordingly. [1] [2]ViewerBinding.cpp, allowing Python users to get and set the camera's vertical FOV.camera_fovproperty with getter and setter to the PythonSceneclass, including validation to ensure the FOV value is within a valid range.Camera method correctness:
Viewerclass to callgetCamera(scene_name)to ensure operations are performed on the correct camera for the given scene. [1] [2] [3]