download-svg-assets
Download specific SVG assets from a Figma file by node ID. Specify file key, node details, and local path for saving. Handles PNG scaling and customizable SVG export options.
Instructions
根据图像或图标节点的ID,仅下载Figma文件中使用的SVG资源
Input Schema
Name | Required | Description | Default |
---|---|---|---|
fileKey | Yes | The key of the Figma file containing the node | |
localPath | Yes | The absolute path to the directory where images are stored in the project. If the directory does not exist, it will be created. The format of this path should respect the directory format of the operating system you are running on. Don't use any special character escaping in the path name either. | |
nodes | Yes | The nodes to fetch as images | |
pngScale | No | Export scale for PNG images. Optional, defaults to 2 if not specified. Affects PNG images only. | |
svgOptions | No | Options for SVG export |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"fileKey": {
"description": "The key of the Figma file containing the node",
"type": "string"
},
"localPath": {
"description": "The absolute path to the directory where images are stored in the project. If the directory does not exist, it will be created. The format of this path should respect the directory format of the operating system you are running on. Don't use any special character escaping in the path name either.",
"type": "string"
},
"nodes": {
"description": "The nodes to fetch as images",
"items": {
"additionalProperties": false,
"properties": {
"fileName": {
"description": "The local name for saving the fetched file",
"type": "string"
},
"imageRef": {
"description": "If a node has an imageRef fill, you must include this variable. Leave blank when downloading Vector SVG images.",
"type": "string"
},
"nodeId": {
"description": "The ID of the Figma image node to fetch, formatted as 1234:5678",
"type": "string"
}
},
"required": [
"nodeId",
"fileName"
],
"type": "object"
},
"type": "array"
},
"pngScale": {
"default": 2,
"description": "Export scale for PNG images. Optional, defaults to 2 if not specified. Affects PNG images only.",
"exclusiveMinimum": 0,
"type": "number"
},
"svgOptions": {
"additionalProperties": false,
"default": {},
"description": "Options for SVG export",
"properties": {
"includeId": {
"default": false,
"description": "Whether to include IDs in SVG exports. Default is false.",
"type": "boolean"
},
"outlineText": {
"default": true,
"description": "Whether to outline text in SVG exports. Default is true.",
"type": "boolean"
},
"simplifyStroke": {
"default": true,
"description": "Whether to simplify strokes in SVG exports. Default is true.",
"type": "boolean"
}
},
"type": "object"
}
},
"required": [
"fileKey",
"nodes",
"localPath"
],
"type": "object"
}