Feature: Advanced Viewport Controls
As a retopology artist
I want to control viewport shading, overlays, and capture topology screenshots
So that I can visualize and document mesh topology effectively
Background:
Given the MCP server is running
And the Blender addon is connected
And a 3D viewport is visible
And a mesh object exists in the scene
# ============================================================================
# set_shading_mode - Viewport Display Control
# ============================================================================
Scenario Outline: Set viewport shading mode
When I call set_shading_mode with mode="<mode>"
Then the viewport displays in <mode> mode
And the display matches Blender's <mode> shading
Examples:
| mode |
| WIREFRAME |
| SOLID |
| MATERIAL |
| RENDERED |
Scenario: Enable wireframe overlay on solid shading
Given the viewport is in SOLID mode
When I call set_shading_mode with mode="SOLID" and show_wireframe=true
Then the viewport shows solid shading
And wireframe edges are visible on top
And I can see face structure with surface shading
Scenario: Enable X-Ray mode for retopology
Given a high-poly and low-poly mesh overlap
When I call set_shading_mode with show_xray=true
Then X-Ray mode is enabled
And I can see through the low-poly mesh
And the high-poly reference is visible behind
Scenario: Configure X-Ray transparency
When I call set_shading_mode with show_xray=true and xray_alpha=0.3
Then X-Ray mode is enabled
And transparency level is 30%
And both meshes are visible with appropriate blending
Scenario Outline: X-Ray alpha levels for different workflows
When I call set_shading_mode with show_xray=true and xray_alpha=<alpha>
Then X-Ray transparency is <alpha>
And visibility matches the alpha level
Examples:
| alpha |
| 0.2 |
| 0.5 |
| 0.8 |
Scenario: Combined shading settings for retopo
When I call set_shading_mode with mode="SOLID", show_wireframe=true, show_xray=true, xray_alpha=0.5
Then viewport is in SOLID mode
And wireframe overlay is visible
And X-Ray is enabled at 50% transparency
And this is optimal for retopology work
Scenario: Invalid shading mode fails gracefully
When I call set_shading_mode with mode="INVALID"
Then I receive an error message
And the error lists valid shading modes
# ============================================================================
# set_overlay_options - Topology Visualization Overlays
# ============================================================================
Scenario: Enable wireframe overlay
When I call set_overlay_options with show_wireframe=true
Then wireframe overlay is enabled
And mesh edges are visible
Scenario: Enable face orientation display
When I call set_overlay_options with show_face_orientation=true
Then face orientation colors are shown
And front-facing faces appear blue
And back-facing faces appear red
And I can identify inverted normals
Scenario: Enable normals display
When I call set_overlay_options with show_normals=true and normals_length=0.2
Then vertex/face normals are displayed
And normal lines have length 0.2
And I can verify normal directions
Scenario: Enable mesh statistics overlay
When I call set_overlay_options with show_stats=true
Then mesh statistics overlay is shown
And I see vertex/edge/face counts
And I see tri/quad counts
Scenario: Enable UV seams display
When I call set_overlay_options with show_edge_seams=true
Then UV seams are highlighted
And seam edges are visually distinct
And I can verify UV island boundaries
Scenario: Enable sharp edges display
When I call set_overlay_options with show_edge_sharp=true
Then sharp edges are highlighted
And I can verify hard edge placement
And shading breaks are visible
Scenario: Configure multiple overlays simultaneously
When I call set_overlay_options with show_wireframe=true, show_face_orientation=true, show_edge_sharp=true
Then wireframe is visible
And face orientation colors are shown
And sharp edges are highlighted
And all overlays work together
Scenario: Disable specific overlay
Given show_wireframe is currently enabled
When I call set_overlay_options with show_wireframe=false
Then wireframe overlay is disabled
And other overlays remain unchanged
# ============================================================================
# get_topology_screenshot - Topology Visualization Capture
# ============================================================================
Scenario: Capture topology screenshot with wireframe
Given a mesh is visible in viewport
When I call get_topology_screenshot with show_wireframe=true
Then I receive a screenshot image
And the screenshot shows wireframe overlay
And mesh topology is clearly visible
Scenario: Capture topology screenshot with face orientation
Given a mesh is visible in viewport
When I call get_topology_screenshot with show_face_orientation=true
Then I receive a screenshot image
And the screenshot shows face orientation colors
And normal issues are visible in the image
Scenario: Capture screenshot with custom shading mode
When I call get_topology_screenshot with shading_mode="WIREFRAME"
Then I receive a screenshot image
And the screenshot uses wireframe shading
And only edges are visible
Scenario: Original settings restored after screenshot
Given viewport has specific shading settings
When I call get_topology_screenshot with show_wireframe=true, show_face_orientation=true
Then I receive a screenshot with requested overlays
And original viewport settings are restored
And viewport looks the same as before
Scenario Outline: Screenshot with different max sizes
When I call get_topology_screenshot with max_size=<size>
Then I receive a screenshot image
And the largest dimension is at most <size> pixels
Examples:
| size |
| 512 |
| 1024 |
| 2048 |
Scenario: Combined topology screenshot for documentation
When I call get_topology_screenshot with show_wireframe=true, show_face_orientation=false, shading_mode="SOLID", max_size=1024
Then I receive a high-quality topology visualization
And the image is suitable for documentation
And mesh structure is clearly visible
# ============================================================================
# Integration Scenarios
# ============================================================================
Scenario: Visual topology inspection workflow
Given a mesh requires topology inspection
When I call set_shading_mode with mode="SOLID" and show_wireframe=true
And I call set_overlay_options with show_face_orientation=true
Then I can visually inspect topology quality
And I can identify areas needing attention
Scenario: Document topology before and after retopo
Given a high-poly mesh "Before" and retopo mesh "After"
When I select "Before" and call get_topology_screenshot
And I select "After" and call get_topology_screenshot
Then I have visual documentation of both meshes
And I can compare topology quality
Scenario: Verify normals using face orientation
Given a mesh with potential normal issues
When I call set_overlay_options with show_face_orientation=true
And I call get_topology_screenshot
Then the screenshot reveals any inverted normals
And red faces indicate areas needing recalculate_normals