Skip to main content

manage_camera

Auto-generated from the Python tool registry. Do not hand-edit outside <!-- examples:start --><!-- examples:end --> blocks — the generator (tools/generate_docs_reference.py) will overwrite them.

Group: core  ·  Module: services.tools.manage_camera

Description

Manage cameras (Unity Camera + Cinemachine). Works without Cinemachine using basic Camera; unlocks presets, pipelines, and blending when Cinemachine is installed. Use ping to check Cinemachine availability.

SETUP:

  • ping: Check if Cinemachine is available
  • ensure_brain: Ensure CinemachineBrain exists on main camera
  • get_brain_status: Get Brain state (active camera, blend, etc.)

CAMERA CREATION:

  • create_camera: Create camera with preset (third_person, freelook, follow, dolly, static, top_down, side_scroller). Falls back to basic Camera without Cinemachine.

CAMERA CONFIGURATION:

  • set_target: Set Follow and/or LookAt targets on a camera
  • set_priority: Set camera priority for Brain selection
  • set_lens: Configure lens (fieldOfView, nearClipPlane, farClipPlane, orthographicSize, dutch)
  • set_body: Configure Body component (bodyType to swap, plus component properties)
  • set_aim: Configure Aim component (aimType to swap, plus component properties)
  • set_noise: Configure Noise component (amplitudeGain, frequencyGain)

EXTENSIONS:

  • add_extension: Add extension (extensionType: CinemachineConfiner2D, CinemachineDeoccluder, CinemachineImpulseListener, CinemachineFollowZoom, CinemachineRecomposer, etc.)
  • remove_extension: Remove extension by type

CAMERA CONTROL:

  • set_blend: Configure default blend (style: Cut/EaseInOut/Linear/etc., duration)
  • force_camera: Override Brain to use specific camera
  • release_override: Release camera override
  • list_cameras: List all cameras with status

CAPTURE:

  • screenshot: Capture a screenshot. By default (no camera specified) uses ScreenCapture API, which captures all render layers including Screen Space - Overlay UI canvases. Specifying a camera uses direct camera rendering, which EXCLUDES Screen Space - Overlay canvases (use only when you need a specific viewpoint without UI). Supports include_image=true for inline base64 PNG, batch='surround' for 6-angle contact sheet, batch='orbit' for configurable grid, view_target/view_position for positioned capture, and capture_source='scene_view' to capture the active Unity Scene View viewport.
  • screenshot_multiview: Shorthand for screenshot with batch='surround' and include_image=true.

Parameters

NameTypeRequiredDescription
actionstryesThe camera action to perform.
targetstr | NoneTarget camera (name, path, or instance ID).
search_methodLiteral['by_id', 'by_name', 'by_path'] | NoneHow to find target.
propertiesdict[str, Any] | str | NoneAction-specific parameters (dict or JSON string).
screenshot_file_namestr | NoneScreenshot file name (optional). Defaults to timestamp.
screenshot_super_sizeint | str | NoneScreenshot supersize multiplier (integer >= 1).
camerastr | NoneCamera to capture from (name, path, or instance ID). Omit to use ScreenCapture API (captures all layers including Screen Space Overlay UI). Specify only when you need a particular camera viewpoint; note that Screen Space - Overlay canvases will NOT appear in camera-rendered captures.
include_imagebool | str | NoneIf true, return screenshot as inline base64 PNG. Default false.
max_resolutionint | str | NoneMax resolution (longest edge px) for inline image. Default 640.
capture_sourceLiteral['game_view', 'scene_view'] | NoneScreenshot source. 'game_view' (default) captures the game/camera path; 'scene_view' captures the active Unity Scene View viewport.
batchstr | NoneBatch capture mode: 'surround' (6 angles) or 'orbit' (configurable grid).
view_targetstr | int | list[float] | NoneTarget to focus on. GameObject name/path/ID or [x,y,z]. For game_view: aims camera at target. For scene_view: frames the Scene View on the target.
view_positionlist[float] | str | NoneWorld position [x,y,z] to place camera for positioned capture.
view_rotationlist[float] | str | NoneEuler rotation [x,y,z] for camera. Overrides view_target if both provided.
orbit_anglesint | str | NoneNumber of azimuth samples for batch='orbit' (default 8, max 36).
orbit_elevationslist[float] | str | NoneElevation angles in degrees for batch='orbit' (default [0, 30, -15]).
orbit_distancefloat | str | NoneCamera distance from target for batch='orbit' (default auto).
orbit_fovfloat | str | NoneCamera FOV in degrees for batch='orbit' (default 60).
output_folderstr | NoneOptional folder for screenshot output. Project-relative (e.g. 'Assets/Screenshots' or 'Captures') or absolute path inside the project. Overrides the user's Editor preference. If omitted, falls back to the Editor preference, then to the built-in default (Assets/Screenshots).

Returns

A dict containing the Unity response. The exact shape depends on the action.

Examples

No examples yet. Add usage examples here — they will be preserved across regenerations.