跳到正文
cccskills
免费在 GitHub 公开

screenshot-isolated

Render a target GameObject from a chosen camera angle with optional layer-based isolation, configurable background (solid/skybox/transparent), multi-light setup via JSON, and Composite (2x2 Front/Right/Back/Top) mode. Returns a PNG image. When isolated=true, inactive children may briefly fire OnEnable — see the body for side-effect notes.

中文简介正在准备中。当前显示原文说明。

集成工具Unity
查看安装方法

包含的文件(1)

  • SKILL.md7.7 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Screenshot / Isolated GameObject

Renders a screenshot of a target GameObject with configurable isolation, background, camera angle, and lighting. When isolated=true (default), only the target object is visible via layer-based culling and inactive children of the target are temporarily activated for the render (their OnEnable callbacks may fire — restored in finally, but side effects like audio/network/animation events are not undoable). When isolated=false, the existing scene state is rendered as-is without activating inactive objects. Supports custom multi-light setups via JSON. Returns a base64-encoded PNG.

Camera views

Front (-Z), Back (+Z), Left (-X), Right (+X), Top (+Y), Bottom (-Y). Composite produces a single 2x2 image (Front, Right, Back, Top) where each sub-view uses the requested resolution, so the final image is resolution*2 x resolution*2.

Background modes

  • SolidColor — flat color from backgroundColor (hex string).
  • Skybox — current scene skybox.
  • Transparent — alpha-zero (ARGB32 PNG; useful for compositing).

Lights

lights is an optional JSON array of IsolatedLightConfig objects (type, color, intensity, rotation, position, range, spotAngle, innerSpotAngle, shadows, shadowStrength, bounceIntensity, colorTemperature, cookieSize, cullingMask, renderMode). When null, a default 1.0-intensity white directional light at rotation (50, -30, 0) is used. Empty array [] explicitly disables extra lights.

Side-effect caveat

Isolation temporarily activates inactive child GameObjects so their renderers participate in the cull. Activation state is restored in finally, but OnEnable-triggered side effects (audio, networking, animation events) are not rewindable. Set isolated=false if your scene contains scripts that must not fire OnEnable during the capture.

How to Call

unity-mcp-cli run-tool screenshot-isolated --input '{
  "gameObjectRef": "string_value",
  "includeChildren": "string_value",
  "isolated": "string_value",
  "backgroundMode": "string_value",
  "backgroundColor": "string_value",
  "cameraView": "string_value",
  "fieldOfView": "string_value",
  "nearClipPlane": "string_value",
  "farClipPlane": "string_value",
  "padding": "string_value",
  "lights": "string_value",
  "resolution": "string_value"
}'

For complex input (multi-line strings, code), save the JSON to a file and use:

unity-mcp-cli run-tool screenshot-isolated --input-file args.json

Or pipe via stdin (recommended):

unity-mcp-cli run-tool screenshot-isolated --input-file - <<'EOF'
{"param": "value"}
EOF

Troubleshooting

If unity-mcp-cli is not found, either install it globally (npm install -g unity-mcp-cli) or use npx unity-mcp-cli instead. Read the /unity-initial-setup skill for detailed installation instructions.

Input

NameTypeRequiredDescription
gameObjectRefanyYesReference to the target GameObject (by instanceId, path, or name).
includeChildrenanyNoInclude child GameObjects in the render. Default: true.
isolatedanyNoWhen true, renders only the target object using layer-based culling. When false, renders the full scene from the computed camera position. Default: true.
backgroundModeanyNoBackground mode. Default: SolidColor.
backgroundColorstringNoHex background color (e.g. '#404040'). Only used when backgroundMode is SolidColor.
cameraViewanyNoCamera angle relative to the target object's bounding box. Default: Front.
fieldOfViewanyNoCamera vertical field of view in degrees. Default: 60.
nearClipPlaneanyNoCamera near clip plane distance. Default: 0.01.
farClipPlaneanyNoCamera far clip plane distance. Default: 1000.
paddinganyNoFraming multiplier around the object. 1.0 = tight fit, 1.5 = 50% extra space. Default: 1.2.
lightsstringNoJSON array of light configurations. Each object defines type, color, intensity, rotation, position, range, spotAngle, shadows, etc. When null, a default white directional light at rotation (50,-30,0) is used. Example: [{"type":"Directional","color":"#FFF4E5","intensity":1.2,"rotation":[45,-45,0]}]
resolutionanyNoOutput image resolution in pixels (width = height). Default: 512.

Input JSON Schema

{
  "type": "object",
  "properties": {
    "gameObjectRef": {
      "$ref": "#/$defs/AIGD.GameObjectRef"
    },
    "includeChildren": {
      "$ref": "#/$defs/System.Boolean"
    },
    "isolated": {
      "$ref": "#/$defs/System.Boolean"
    },
    "backgroundMode": {
      "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Screenshot-BackgroundMode"
    },
    "backgroundColor": {
      "type": "string"
    },
    "cameraView": {
      "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Screenshot-CameraView"
    },
    "fieldOfView": {
      "$ref": "#/$defs/System.Single"
    },
    "nearClipPlane": {
      "$ref": "#/$defs/System.Single"
    },
    "farClipPlane": {
      "$ref": "#/$defs/System.Single"
    },
    "padding": {
      "$ref": "#/$defs/System.Single"
    },
    "lights": {
      "type": "string"
    },
    "resolution": {
      "$ref": "#/$defs/System.Int32"
    }
  },
  "$defs": {
    "UnityEngine.EntityId": {
      "type": "string",
      "pattern": "^[0-9]+$"
    },
    "System.Type": {
      "type": "string"
    },
    "AIGD.GameObjectRef": {
      "type": "object",
      "properties": {
        "instanceID": {
          "$ref": "#/$defs/UnityEngine.EntityId",
          "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)"
        },
        "path": {
          "type": "string",
          "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2."
        },
        "name": {
          "type": "string",
          "description": "Name of a GameObject in hierarchy. Priority: 3."
        },
        "assetType": {
          "$ref": "#/$defs/System.Type",
          "description": "Type of the asset."
        },
        "assetPath": {
          "type": "string",
          "description": "Path to the asset within the project. Starts with 'Assets/'"
        },
        "assetGuid": {
          "type": "string",
          "description": "Unique identifier for the asset."
        }
      },
      "required": [
        "instanceID"
      ],
      "description": "Find GameObject in opened Prefab or in the active Scene."
    },
    "System.Boolean": {
      "type": "boolean"
    },
    "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Screenshot-BackgroundMode": {
      "type": "string",
      "enum": [
        "SolidColor",
        "Skybox",
        "Transparent"
      ]
    },
    "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Screenshot-CameraView": {
      "type": "string",
      "enum": [
        "Front",
        "Back",
        "Left",
        "Right",
        "Top",
        "Bottom",
        "Composite"
      ]
    },
    "System.Single": {
      "type": "number"
    },
    "System.Int32": {
      "type": "integer"
    }
  },
  "required": [
    "gameObjectRef"
  ]
}

Output

This tool does not return structured output.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

build-cli

免费

Build the unity-mcp-cli TypeScript CLI tool and link it globally for terminal use.

中文简介正在准备中。当前显示原文说明。

IvanMurzak/Unity-MCP44952026年10月19日 更新

Review and resolve PR comments from GitHub. Validates each comment, fixes legitimate issues.

中文简介正在准备中。当前显示原文说明。

IvanMurzak/Unity-MCP44952026年10月19日 更新

Install a Unity package from the registry, a Git URL, or a local path. Modifies `manifest.json` and triggers package resolution; may also trigger a domain reload — the final result is delivered after the reload via the request's `requestId`. Use 'package-search' / 'package-list' for discovery first.

中文简介正在准备中。当前显示原文说明。

IvanMurzak/Unity-MCP44952026年10月19日 更新

List all UPM packages installed in the Unity project — name, version, source, description. Optionally filter by source (registry, embedded, local, git, built-in, local tarball), by name/display/description substring, and by direct-dependency-only.

中文简介正在准备中。当前显示原文说明。

IvanMurzak/Unity-MCP44952026年10月19日 更新

Uninstall a UPM package from the Unity project. Modifies `manifest.json` and may trigger a domain reload — the final result is delivered after the reload via the request's `requestId`. Built-in packages and packages that are dependencies of others cannot be removed. Use 'package-list' to list installed packages first.

中文简介正在准备中。当前显示原文说明。

IvanMurzak/Unity-MCP44952026年10月19日 更新

Search Unity's package registry plus locally installed packages (Git, local, embedded sources) by query string. Returns available versions and installation status. Online mode fetches exact matches from the live registry then supplements with cached substring matches.

中文简介正在准备中。当前显示原文说明。

IvanMurzak/Unity-MCP44952026年10月19日 更新

查看 IvanMurzak 的全部技能

报告此技能的问题