Editor/Tools/WorkflowTools.OrbitSnapshot.cs

Editor MCP assistant tools for taking orbit/inspection snapshots of a GameObject. Exposes two MCP tools: AssetOrbitSnapshot which captures an asset orbit snapshot with a resolution parameter, and OrbitSnapshot which supports radius/pitch/yaw/presets/resolution/filename/includeUi and returns serialized JSON results or failures.

File Access
#nullable enable
using System;
using System.ComponentModel;

namespace Editor.Mcp
{
	public static partial class SboxMcpAssistant
	{
		[McpTool( "pocketknife_asset_orbit_snapshot" )]
		public static string AssetOrbitSnapshot(
			[Description( "Target GameObject name" )] string target,
			[Description( "Resolution per quadrant (default 512)" )] int resolution = 512 )
		{
			try
			{
				return McpJson.Write( OrbitSnapshotDriver.CaptureOrbit( target, resolution: resolution ) );
			}
			catch ( Exception ex )
			{
				return McpJson.Write( ToolOutcome<object>.Failure( null, ToolStatus.Failed, "orbit.capture_failed", "Orbit snapshot capture failed.", ex ) );
			}
		}

		/// <summary>
		/// Virtual drone/orbit inspection camera: orbits a target GameObject at specified spherical coordinates
		/// (radius, pitch, yaw) or camera angle presets (front, back, left, right, top, isometric, cinematic),
		/// captures a visual verification snapshot via CameraScreenshot, saves the artifact, and cleans up.
		/// </summary>
		[McpTool( "pocketknife_orbit_snapshot" )]
		public static string OrbitSnapshot(
			[Description( "Target GameObject name or GUID" )] string target,
			[Description( "Orbit radius in units (if omitted/0, calculated from bounds)" )] float radius = 0f,
			[Description( "Vertical pitch angle in degrees (-89 to 89, default 25)" )] float pitch = 25f,
			[Description( "Horizontal yaw orbit angle in degrees (0 to 360, default 45)" )] float yaw = 45f,
			[Description( "Camera preset: front, back, left, right, top, isometric, cinematic (overrides pitch/yaw)" )] string? preset = null,
			[Description( "Image resolution (128-4096, default 1024)" )] int resolution = 1024,
			[Description( "Custom destination filename (e.g. 'hero_preview.png')" )] string? fileName = null,
			[Description( "Whether to render UI panels in the snapshot" )] bool includeUi = false )
		{
			try
			{
				var result = OrbitSnapshotDriver.CaptureOrbit(
					target,
					radius > 0f ? radius : null,
					pitch,
					yaw,
					preset,
					resolution,
					fileName,
					includeUi
				);
				return McpJson.Write( result );
			}
			catch ( Exception ex )
			{
				return McpJson.Write( ToolOutcome<object>.Failure( null, ToolStatus.Failed, "orbit.snapshot_failed", "Orbit snapshot failed.", ex ) );
			}
		}
	}
}