2.3 KiB
2.3 KiB
Why
Camera prims exist in the USD scene but are invisible in the viewport — there is no visual indication of a camera's position, orientation, or field of view. Users cannot tell where cameras are in the scene, cannot click to select them, and cannot use the transform manipulator to reposition them. This is a critical gap for any scene with multiple cameras (rendering, animation, layout).
What Changes
- Draw a 3D frustum wireframe for every
UsdGeomCameraprim in the viewport, rendered into the FBO using the existing GL overlay infrastructure (BindDrawTarget/UnbindDrawTarget). - Highlight the active camera (the one currently driving the viewport via the camera toolbar) with a distinct colour; all other cameras use the standard camera wire colour.
- Highlight the selected camera with the selection accent colour.
- Support viewport click-selection of camera prims by screen-space hit-testing mouse clicks against projected frustum segments.
- Camera prims, once selected, can be translated/rotated/scaled through the existing
TransformManipulator(they areXformable; no manipulator changes are required).
Capabilities
New Capabilities
camera-frustum-overlay: Per-frame GL wireframe rendering of allUsdGeomCameraprims' frustums into the viewport FBO, with colour-coding for active vs. selected vs. inactive cameras.camera-viewport-picking: Screen-space hit-testing that maps a viewport mouse click to a camera prim when the click is within a threshold distance of any projected frustum edge; integrates with the existing prim-selection callbacks.
Modified Capabilities
(none — no existing spec-level requirements are changing)
Impact
- Modified:
src/core/UsdSceneRenderer.h/.cpp— addDrawCameraWireframes(stage, selectedPaths, activeCameraPath, viewProjMatrix)andPickCameraAtPoint(stage, mouseScreenPos, viewProjMatrix, imagePos, viewW, viewH, outPath). - Modified:
src/ui/ViewportPanel.cpp— callDrawCameraWireframeseach frame afterDrawBoundingBoxes; callPickCameraAtPointinside the single-click pick path before the existingPickObjectgeometry pick so camera hits take priority. - No new external dependencies. Uses existing GLSL shader program already compiled for
DrawAxis/DrawBoundingBoxes.