texturecraft
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTextureCraft
TextureCraft
Operate TextureCraft through its structured automation interface. Preserve the user's requested texturing workflow and target texture set.
通过结构化自动化接口操作 TextureCraft。保留用户所请求的纹理绘制工作流和目标纹理集。
Protocol reference
协议参考
Read the relevant sections of references/control-protocol.md before constructing calls. This is the downloaded upstream protocol, captured on 2026-11-04.
Source: TextureCraft control protocol.
Useful sections: the Control channel method table, the MCP server tool table, MaterialCraft materials, and CLI. Relative links inside the downloaded document refer to upstream documentation; resolve them against when needed. The document lists example commands, not the full command library: discover command ids, labels, parameter docs and current enabled state at runtime with (MCP: ) instead of inventing ids.
https://github.com/storytold/texturecraft/blob/main/docs/command.list {filter?}command_list在构建调用前,阅读 references/control-protocol.md 的相关章节。这是下载的上游协议,捕获于 2026-11-04。
有用章节:Control channel 方法表、MCP server 工具表、MaterialCraft materials 和 CLI。下载文档中的相对链接指向上游文档;需要时,应基于 解析。该文档列出的是示例命令,而非完整命令库:应在运行时使用 (MCP:)发现命令 ID、标签、参数文档和当前启用状态,而不是凭空编造 ID。
https://github.com/storytold/texturecraft/blob/main/docs/command.list {filter?}command_listLocate the executables
定位可执行文件
texturecrafttexturecraft-cliPATH- PATH: (POSIX) or
command -v texturecraft texturecraft-cli(Windows).where texturecraft texturecraft-cli - macOS: look for in
TextureCraft.appand/Applications, or run~/Applications; the binary insidemdfind -name TextureCraft.appis the desktop app.Contents/MacOS/ - Linux: AppImage, Flatpak, deb/rpm, or tarball installs; the CLI may be a separate download.
- Built from source: and
cargo run --release -p texturecraft.cargo run --release -p texturecraft-cli -- …
即使已安装 TextureCraft, 和 也可能不在 中。在假定任何内容缺失前应先发现它们,绝不能臆造路径——请搜索:
texturecrafttexturecraft-cliPATH- PATH: (POSIX)或
command -v texturecraft texturecraft-cli(Windows)。where texturecraft texturecraft-cli - macOS: 在 和
/Applications中查找~/Applications,或运行TextureCraft.app;桌面应用的可执行文件位于mdfind -name TextureCraft.app中。Contents/MacOS/ - Linux: AppImage、Flatpak、deb/rpm 或 tarball 安装;CLI 可能需要单独下载。
- 从源代码构建: 和
cargo run --release -p texturecraft。cargo run --release -p texturecraft-cli -- …
Select the session
选择会话
- For a user's open project or visible application, use a TextureCraft MCP bridge () or the app's control channel (
texturecraft-cli mcp --bridge <port>). A headless session has its own in-process project and cannot edit the user's live window.texturecraft --control <port> - For unattended file processing, use headless MCP (), the JSON-lines server (
texturecraft-cli mcp --read-root DIR --write-root DIR), or one-shot CLI subcommands (texturecraft-cli serve [--port <port>],new,run,batch,bake,export,render).info
The control channel requires an request first on every connection: token from or the file . Then one JSON object per line, ; match replies by and check . Set (any value) for scripted runs so the user's layout and settings are left alone. Keep TCP on loopback and credentials in a private token file; do not print, commit, or expose tokens in command arguments.
authTEXTURECRAFT_CONTROL_TOKEN<temp>/texturecraft-control-<port>.token{"id", "method", "params"}idokTEXTURECRAFT_NO_PREFS- 对于用户已打开的项目或可见应用,使用 TextureCraft MCP 桥接()或应用的控制通道(
texturecraft-cli mcp --bridge <port>)。无头会话拥有自己的进程内项目,无法编辑用户当前可见的窗口。texturecraft --control <port> - 对于无人值守的文件处理,使用无头 MCP()、JSON-lines 服务器(
texturecraft-cli mcp --read-root DIR --write-root DIR)或单次执行的 CLI 子命令(texturecraft-cli serve [--port <port>]、new、run、batch、bake、export、render)。info
控制通道要求每次连接时首先发送 请求:令牌来自 或文件 。随后每行传入一个 JSON 对象 ;通过 匹配响应并检查 。脚本运行时设置 (任意值),避免改动用户的布局和设置。TCP 应保持在环回地址上,凭据应存放在私有令牌文件中;不要打印、提交令牌,也不要在命令参数中暴露令牌。
authTEXTURECRAFT_CONTROL_TOKEN<temp>/texturecraft-control-<port>.token{"id", "method", "params"}idokTEXTURECRAFT_NO_PREFSInspect, edit, and verify
检查、编辑和验证
Inspect before editing: returns the project, mesh, texture sets, the layer stack with every layer, mask, effect and fill source, painted tile counts, the tool, camera, display and history — an agent can verify most work without a screenshot. shows a fill layer's (the MaterialCraft graph's exposed inputs, presets and image inputs).
session.inspectproject.inspect.mcmatlinkEdit through engine commands via : (built-in meshes: , , , , , , , ), , , , , / for imported mesh maps, , , and painting through (or the MCP tool, whose points are viewport pixels). / move through history; any command accepts to fold its edit into the previous undo step.
command.runproject.new {mesh?, resolution?, name?, template?}material_ballspherecuberounded_cubecylindertorusplanecratelayer.add.fill {color?, roughness?, metallic?, …}layer.add.imagemask.add.blackeffect.add.generator {generator: "edgeWear"|…}textureSet.meshMap.settextureSet.meshMap.clearbake.run {resolution?, maps?}material.apply {material}tool.strokepaint_strokeedit.undo {steps?}edit.redo {steps?}merge: trueCommands run programmatically and never open dialogs. Use only when interactive menu behavior is intended. In the app, can change layout, dock, preferences (language, brightness, accent) and keymap; and exist for performance work.
ui.menu.invokeui.setdebug.paintTestdebug.framesVerify visually and structurally: re-run , then render — (app), (MCP; up to 4096 path-traces the 3D view), (JSON-lines), or (CLI). Stroke points and render sizes share one space: the default render size is the session viewport (1280×800), so points can be read straight off a image.
session.inspectviewport.screenshot {view: "3d"|"2d"}viewport_rendersamplesrendertexturecraft-cli render project.tcraft out.png --size 1280x800 --yaw 30 --pitch 15paint_strokeviewport_render编辑前先进行检查: 返回项目、网格、纹理集、包含每个图层、蒙版、效果和填充源的图层堆栈、已绘制图块数量、工具、相机、显示设置和历史记录——Agent 无需截图即可验证大部分工作。 显示 填充图层的 (MaterialCraft 图的公开输入、预设和图像输入)。
session.inspectproject.inspect.mcmatlink通过 使用引擎命令进行编辑:(内置网格:、、、、、、、)、、、、、用于导入网格贴图的 / 、、,以及通过 进行绘制(或使用 MCP 工具,其 points 为视口像素)。 / 可在历史记录中前后移动;任何命令都接受 ,用于将当前编辑合并到上一个撤销步骤中。
command.runproject.new {mesh?, resolution?, name?, template?}material_ballspherecuberounded_cubecylindertorusplanecratelayer.add.fill {color?, roughness?, metallic?, …}layer.add.imagemask.add.blackeffect.add.generator {generator: "edgeWear"|…}textureSet.meshMap.settextureSet.meshMap.clearbake.run {resolution?, maps?}material.apply {material}tool.strokepaint_strokeedit.undo {steps?}edit.redo {steps?}merge: true命令以编程方式运行,不会打开对话框。仅当需要交互式菜单行为时才使用 。在应用中, 可更改布局、停靠面板、首选项(语言、亮度、强调色)和按键映射; 和 可用于性能工作。
ui.menu.invokeui.setdebug.paintTestdebug.frames从视觉和结构两方面进行验证:重新运行 ,然后进行渲染——(应用)、(MCP; 最多为 4096 时会对 3D 视图执行路径追踪)、(JSON-lines),或 (CLI)。笔划点和渲染尺寸共用同一坐标空间:默认渲染尺寸为会话视口大小(1280×800),因此可以直接从 图像读取 的 points。
session.inspectviewport.screenshot {view: "3d"|"2d"}viewport_rendersamplesrendertexturecraft-cli render project.tcraft out.png --size 1280x800 --yaw 30 --pitch 15viewport_renderpaint_strokeFile access and output
文件访问和输出
Headless file access is workspace-scoped by launch-time roots ( / ); use task-scoped roots and forward-slash relative paths within them. , absolute paths, drive letters and symlink escapes are refused. Do not bypass rejected paths by switching to ambient filesystem commands. Through , path-carrying commands ( except / , , , …) are refused in both MCP modes: use the dedicated tools.
--read-root--write-root..command_runfile.*file.closefile.removeUnusedresource.importmaterial.save- Projects: (
project_open {path}or a mesh file) /.tcraft; in bridge modeproject_save {path?}without a path invokes File › Save. Meshes:project_save(glTF/GLB, FBX, COLLADA, USD, Alembic, OBJ, PLY, STL),mesh_import {path, resolution?},mesh_reimport(textured obj, glb, usd).mesh_export {path, format?} - Resources and baking: embeds an image (for
resource_import {path}orlayer.add.image, or as a mesh map viatool.stencil);textureSet.meshMap.setadds a high-poly mesh;bake_mesh_add {path, cage?}bakes mesh maps, on the GPU when there is one.bake {resolution?, maps?, cpu?} - Materials: writes a
material_save {path, layer?, name?}smart material;.tcmatreadsmaterial_load {path}, a MaterialCraft.tcmator.mcmatpackage; drive.mcraftinputs with.mcmat/material.link.set/material.link.preset(re-cooks callmaterial.link.cook, found viamaterialcraft-clior next to the executable).$MATERIALCRAFT_CLI - Textures: writes engine-ready maps (PNG, JPEG, TGA, TIFF, BMP, WEBP, EXR, HDR at 8, 16 or 32 bits); CLI:
textures_export {dir, preset?, ts?, format?, padding?, size?}.texturecraft-cli export model.tcraft out/ --preset "Unreal Engine (Packed)" - Report successful saves and exports with the exact output path and format. Do not overwrite the user's source project unless asked; save a copy under a new name.
无头文件访问受启动时指定的根目录限制( / );应使用任务范围的根目录,并在其中使用正斜杠相对路径。、绝对路径、驱动器号和符号链接越界均会被拒绝。不要改用外部文件系统命令来绕过被拒绝的路径。通过 执行时,两种 MCP 模式都会拒绝带路径的命令( 除外,但不包括 / 、、 等);应改用专用工具。
--read-root--write-root..command_runfile.*file.closefile.removeUnusedresource.importmaterial.save- 项目:(
project_open {path}或网格文件)/.tcraft;在桥接模式下,不带路径调用project_save {path?}会触发 File › Save。网格:project_save(glTF/GLB、FBX、COLLADA、USD、Alembic、OBJ、PLY、STL)、mesh_import {path, resolution?}、mesh_reimport(带纹理的 obj、glb、usd)。mesh_export {path, format?} - 资源和烘焙:可嵌入图像(用于
resource_import {path}或layer.add.image,也可通过tool.stencil作为网格贴图);textureSet.meshMap.set添加高模网格;bake_mesh_add {path, cage?}烘焙网格贴图,存在 GPU 时会使用 GPU。bake {resolution?, maps?, cpu?} - 材质:写入
material_save {path, layer?, name?}智能材质;.tcmat读取material_load {path}、MaterialCraft.tcmat或.mcmat包;使用.mcraft/material.link.set/material.link.preset驱动material.link.cook输入(重新计算会调用.mcmat,该命令可通过materialcraft-cli或可执行文件所在位置找到)。$MATERIALCRAFT_CLI - 纹理:写入引擎可用贴图(PNG、JPEG、TGA、TIFF、BMP、WEBP、EXR、HDR,支持 8、16 或 32 位);CLI:
textures_export {dir, preset?, ts?, format?, padding?, size?}。texturecraft-cli export model.tcraft out/ --preset "Unreal Engine (Packed)" - 报告成功保存和导出的结果时,应提供精确的输出路径和格式。除非用户明确要求,否则不要覆盖用户的源项目;应使用新名称保存副本。
Batches and uncertain outcomes
批处理和不确定结果
Use (MCP, JSON-lines , or ) for known sequences; it stops at the first error and reports . Batches are not transactions: earlier steps persist on failure, so inspect per-step results. Replies are capped (8 MiB of JSON, 5 MiB per PNG, 256 batch steps).
command_batch {steps}command.batchtexturecraft-cli batch script.json{completed, results, failed}After a disconnect or any other unclear failure, run before retrying a mutation — the command may already have completed. Stop and report unresolved state if inspection cannot determine whether replay is safe.
session.inspect对于已知操作序列,使用 (MCP、JSON-lines 或 );它会在首个错误处停止,并报告 。批处理并非事务:失败时,之前执行的步骤仍会保留,因此需要检查每个步骤的结果。响应存在大小上限(JSON 为 8 MiB、PNG 为 5 MiB、批处理步骤为 256 步)。
command_batch {steps}command.batchtexturecraft-cli batch script.json{completed, results, failed}断线或发生其他不明确的故障后,重试修改操作前应先运行 ——该命令可能已经完成。如果检查后仍无法确定是否可以安全重放,应停止操作并报告未解决的状态。
session.inspect