Feature: Reliable View Control Tools
As a retopology artist
I want reliable viewport navigation controls
So that I can inspect mesh from all angles without context errors
Background:
Given the MCP server is running
And the Blender addon is connected
And a 3D viewport is available
# ============================================================================
# set_view_axis - Reliable Axis Alignment (Fixed align_view_to_axis)
# ============================================================================
Scenario Outline: Set view to standard axis
When I call set_view_axis with axis="<axis>"
Then viewport aligns to <axis> view
And no context error occurs
And the view transition is smooth
Examples:
| axis |
| FRONT |
| BACK |
| LEFT |
| RIGHT |
| TOP |
| BOTTOM |
Scenario: Set view with orthographic mode
When I call set_view_axis with axis="FRONT"
And I call set_view_projection with projection="ORTHO"
Then viewport shows orthographic front view
And this is ideal for retopology reference
Scenario: Set view preserves camera position for orbit
Given the view has a specific orbit center
When I call set_view_axis with axis="TOP"
Then the view aligns to top
And the orbit center is preserved
# ============================================================================
# orbit_view - Orbital Camera Control
# ============================================================================
Scenario: Orbit view around object
Given a mesh object is in the scene
When I call orbit_view with target="Cube", yaw_delta=45, pitch_delta=15
Then viewport rotates 45 degrees horizontally
And viewport rotates 15 degrees vertically
And the rotation is around the object center
Scenario: Orbit around specific point
When I call orbit_view with target="POINT", point=(0.5, 0.5, 0.5), yaw_delta=90
Then viewport rotates around the specified point
And the rotation is 90 degrees horizontal
Scenario Outline: Orbit with different angles
When I call orbit_view with yaw_delta=<yaw> and pitch_delta=<pitch>
Then viewport rotates by the specified amounts
Examples:
| yaw | pitch |
| 0 | 45 |
| 90 | 0 |
| 45 | 30 |
| -45 | -15 |
Scenario: Orbit with distance change
When I call orbit_view with distance_delta=2.0
Then viewport moves further from the center
And objects appear smaller
Scenario: Orbit to zoom in
When I call orbit_view with distance_delta=-1.0
Then viewport moves closer to the center
And objects appear larger
# ============================================================================
# frame_selected - Reliable Frame Selection (Fixed)
# ============================================================================
Scenario: Frame selected object
Given a mesh object is selected
When I call frame_selected
Then viewport centers on the selected object
And viewport zooms to fit the selection
And no poll() error occurs
Scenario: Frame multiple selected objects
Given multiple objects are selected
When I call frame_selected
Then viewport centers on the bounding box of all selected
And all selected objects are visible
Scenario: Frame with no selection
Given no objects are selected
When I call frame_selected
Then I receive a message indicating nothing to frame
And viewport remains unchanged
# ============================================================================
# focus_view_on_point - Navigate to Coordinates (Fixed)
# ============================================================================
Scenario: Focus on specific 3D point
When I call focus_view_on_point with x=1.0, y=2.0, z=3.0
Then viewport centers on point (1.0, 2.0, 3.0)
And view_distance is returned
Scenario: Focus with distance parameter
When I call focus_view_on_point with x=0, y=0, z=0, distance=5.0
Then viewport centers on origin
And viewing distance is set to 5.0 units
Scenario: Focus with axis alignment
When I call focus_view_on_point with x=0, y=0, z=1, view_axis="FRONT"
Then viewport centers on point (0, 0, 1)
And view aligns to front axis
And no context error occurs
Scenario Outline: Focus from different axes
When I call focus_view_on_point with view_axis="<axis>"
Then viewport aligns to <axis> while centering on point
Examples:
| axis |
| FRONT |
| TOP |
| RIGHT |
# ============================================================================
# Combined Navigation Workflows
# ============================================================================
Scenario: Navigate to problem area from analyze_mesh_regions
Given analyze_mesh_regions returned a problem region at (0.5, -0.138, 0.2)
When I call focus_view_on_point with x=0.5, y=-0.138, z=0.2, distance=0.5
And I call set_view_axis with axis="FRONT"
Then viewport is focused on the problem area
And I can inspect the issue in detail
Scenario: Complete inspection workflow
Given a mesh with topology issues
When I call frame_selected to frame the mesh
And I call set_view_axis with axis="FRONT"
And I call orbit_view with yaw_delta=45
And I capture a screenshot
Then I have a 45-degree angle screenshot of the mesh
# ============================================================================
# Error Handling
# ============================================================================
Scenario: Invalid axis name
When I call set_view_axis with axis="INVALID"
Then I receive an error message
And the error lists valid axis names
Scenario: No 3D viewport available
Given no 3D viewport area exists
When I call orbit_view
Then I receive an error message
And the error indicates no 3D viewport found
Scenario: Orbit with non-existent target object
When I call orbit_view with target="NonExistentObject"
Then I receive an error message
And the error indicates object not found