Skip to content

Add camera_fov getter/setter to fvdb.viz.Scene#558

Merged
swahtz merged 8 commits into
openvdb:mainfrom
swahtz:vis_camera_fov
Mar 26, 2026
Merged

Add camera_fov getter/setter to fvdb.viz.Scene#558
swahtz merged 8 commits into
openvdb:mainfrom
swahtz:vis_camera_fov

Conversation

@swahtz

@swahtz swahtz commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

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:

  • Added cameraFov and setCameraFov methods to the Viewer class in C++ for retrieving and updating the camera's vertical FOV, and updated the header file accordingly. [1] [2]
  • Exposed the new FOV methods to Python via ViewerBinding.cpp, allowing Python users to get and set the camera's vertical FOV.
  • Added a camera_fov property with getter and setter to the Python Scene class, including validation to ensure the FOV value is within a valid range.

Camera method correctness:

  • Updated several camera-related methods in the C++ Viewer class to call getCamera(scene_name) to ensure operations are performed on the correct camera for the given scene. [1] [2] [3]

swahtz added 2 commits March 19, 2026 11:42
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>
@swahtz swahtz added the Viewer Issues related to the viewer in fvdb label Mar 23, 2026
@swahtz swahtz requested a review from a team as a code owner March 23, 2026 03:13
@swahtz swahtz added this to fVDB Mar 23, 2026
@swahtz swahtz requested review from harrism and matthewdcong March 23, 2026 03:13
@phapalova phapalova requested a review from Copilot March 23, 2026 10:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 / setCameraFov to the C++ fvdb::detail::viewer::Viewer API and exposed them through the Python bindings.
  • Added Scene.camera_fov property (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.

Comment thread src/fvdb/detail/viewer/Viewer.cpp
Comment thread fvdb/viz/_scene.py Outdated
Comment thread fvdb/viz/_scene.py

@fwilliams fwilliams left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Copilot review surfaced some good points and I added a few comments. Fix those up and this should be good to go.

Comment thread src/fvdb/detail/viewer/Viewer.cpp
Comment thread fvdb/viz/_scene.py Outdated
Comment thread fvdb/viz/_scene.py
swahtz and others added 6 commits March 26, 2026 16:13
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>
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
@swahtz swahtz added this to the v0.5 milestone Mar 26, 2026
@swahtz swahtz enabled auto-merge (squash) March 26, 2026 04:27
@swahtz swahtz merged commit 95196f4 into openvdb:main Mar 26, 2026
38 checks passed
@github-project-automation github-project-automation Bot moved this to Done in fVDB Mar 26, 2026
@swahtz swahtz deleted the vis_camera_fov branch March 26, 2026 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Viewer Issues related to the viewer in fvdb

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants